From 853baa2243a7895da4676568984869c0c20a539c Mon Sep 17 00:00:00 2001 From: Vladan Thales Date: Mon, 2 Dec 2024 20:35:54 +0100 Subject: [PATCH 1/4] Change Base subgraph URL for Thales strategy --- src/strategies/thales/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/strategies/thales/index.ts b/src/strategies/thales/index.ts index 30b963540..334670100 100644 --- a/src/strategies/thales/index.ts +++ b/src/strategies/thales/index.ts @@ -2,8 +2,8 @@ import { getAddress } from '@ethersproject/address'; import { formatUnits } from '@ethersproject/units'; import { getSnapshots, subgraphRequest } from '../../utils'; -export const author = 'vpoklopic'; -export const version = '1.0.4'; +export const author = 'vladanthales'; +export const version = '1.0.5'; enum NetworkId { Optimism = 10, @@ -16,7 +16,7 @@ const THALES_SUBGRAPH_URL = { 'https://subgrapher.snapshot.org/subgraph/arbitrum/2WQ9TKJt96NUxuS2DbR7B4aAwcU9CMiaBH7fwZZfjpn1', arbitrum: 'https://subgrapher.snapshot.org/subgraph/arbitrum/GRHJHjVRzHrQoN86VyjXMDTDiw9pHNB9NqQJxQmnZcwb', - base: 'https://api.studio.thegraph.com/query/11948/thales-token-base/version/latest' + base: 'https://subgrapher.snapshot.org/subgraph/arbitrum/3cwvVz7HwAJD76gfmjfu8A92e9cELN9TEvY6rkdxyjaY' }; function returnGraphParams(addresses: string[], block: string | number) { From d0dea09545e0e4e27a9bd151a4ca7d1c90bbc5c3 Mon Sep 17 00:00:00 2001 From: Vladan Thales <78506565+vladanthales@users.noreply.github.com> Date: Tue, 3 Dec 2024 08:07:57 +0100 Subject: [PATCH 2/4] Update src/strategies/thales/index.ts Co-authored-by: Chaitanya --- src/strategies/thales/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strategies/thales/index.ts b/src/strategies/thales/index.ts index 334670100..048504420 100644 --- a/src/strategies/thales/index.ts +++ b/src/strategies/thales/index.ts @@ -2,7 +2,7 @@ import { getAddress } from '@ethersproject/address'; import { formatUnits } from '@ethersproject/units'; import { getSnapshots, subgraphRequest } from '../../utils'; -export const author = 'vladanthales'; +export const author = 'thales-markets'; export const version = '1.0.5'; enum NetworkId { From 81703d56e4cfde4f14cb4ed61916c3e3f33c524f Mon Sep 17 00:00:00 2001 From: Vladan Thales Date: Wed, 25 Jun 2025 13:49:42 +0200 Subject: [PATCH 3/4] Overtime strategy --- src/strategies/index.ts | 4 ++- src/strategies/overtime/README.md | 17 ++++++++++ src/strategies/overtime/examples.json | 25 +++++++++++++++ src/strategies/overtime/index.ts | 46 +++++++++++++++++++++++++++ 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 src/strategies/overtime/README.md create mode 100644 src/strategies/overtime/examples.json create mode 100644 src/strategies/overtime/index.ts diff --git a/src/strategies/index.ts b/src/strategies/index.ts index dc67a5046..fb77cc64a 100644 --- a/src/strategies/index.ts +++ b/src/strategies/index.ts @@ -486,6 +486,7 @@ import * as pufferGetPastVotes from './puffer-getpastvotes'; import * as prlInSpRL2Balance from './prl-in-sprl2-balance'; import * as edenOnlineOverride from './eden-online-override'; import * as forteStaking from './forte-staking'; +import * as overtime from './overtime'; import { DEFAULT_SUPPORTED_PROTOCOLS } from '../constants'; @@ -985,7 +986,8 @@ const strategies = { 'puffer-getpastvotes': pufferGetPastVotes, 'prl-in-sprl2-balance': prlInSpRL2Balance, 'eden-online-override': edenOnlineOverride, - 'forte-staking': forteStaking + 'forte-staking': forteStaking, + overtime }; Object.keys(strategies).forEach(function (strategyName) { diff --git a/src/strategies/overtime/README.md b/src/strategies/overtime/README.md new file mode 100644 index 000000000..076af0bf8 --- /dev/null +++ b/src/strategies/overtime/README.md @@ -0,0 +1,17 @@ +# Overtime Strategy + +A governance strategy designed for Overtime. +Voting power is determined by the $OVER token balance. If the address is a smart contract account, the voting power is assigned to their externally owned account (EOA) owner. + +## Examples + +Here is an example of parameters: + +```JSON +{ + "address": "0xedf38688b27036816a50185caa430d5479e1c63e", + "symbol": "OVER", + "decimals": 18, + "eoaToSmartAccountMapApi": "https://overdrop.overtime.io/eoa-smart-account-map" +} +``` diff --git a/src/strategies/overtime/examples.json b/src/strategies/overtime/examples.json new file mode 100644 index 000000000..474db78c7 --- /dev/null +++ b/src/strategies/overtime/examples.json @@ -0,0 +1,25 @@ +[ + { + "name": "Example query OP", + "strategy": { + "name": "overtime", + "params": { + "address": "0xedf38688b27036816a50185caa430d5479e1c63e", + "symbol": "OVER", + "decimals": 18, + "eoaToSmartAccountMapApi": "https://overdrop.overtime.io/eoa-smart-account-map" + } + }, + "network": "10", + "addresses": [ + "0x9f8e4ee788D9b00A3409584E18034aA7B736C396", + "0x3e09230ed70b667256BBaf1FDf949050D312D066", + "0x7d2824F1825da25072011B3e326025172E404b15", + "0x3320EE0189aAD77b3aB570a00464Ce7a45B6E465", + "0x28b2Be30b0AE526aF0cB94984B750d4C35e913c0", + "0xc8038Fb922764405aF919A02BDd2792A36566074", + "0x0D858351A5FB419C9A3760647900d2F7aD526c83" + ], + "snapshot": 137587693 + } +] diff --git a/src/strategies/overtime/index.ts b/src/strategies/overtime/index.ts new file mode 100644 index 000000000..37584f66f --- /dev/null +++ b/src/strategies/overtime/index.ts @@ -0,0 +1,46 @@ +import { customFetch } from '../../utils'; +import { strategy as erc20BalanceOfStrategy } from '../erc20-balance-of'; + +export const author = 'thales-markets'; +export const version = '1.0.0'; +export const dependOnOtherAddress = true; + +export async function strategy( + space, + network, + provider, + addresses, + options, + snapshot +): Promise> { + const scores = await erc20BalanceOfStrategy( + space, + network, + provider, + addresses, + options, + snapshot + ); + + const response = await customFetch(options.eoaToSmartAccountMapApi, { + method: 'GET', + headers: { + Accept: 'application/json', + 'Content-Type': 'application/json' + } + }); + const eoaToSmartAccountMapping = await response.json(); + + for (let i = 0; i < Object.keys(scores).length; i++) { + const address = Object.keys(scores)[i]; + const smartAccount = eoaToSmartAccountMapping[address]; + // If the current address has a mapped smart account, add the smart account's score to the owner's score + // and set the smart account's score to 0 to prevent double counting. + if (smartAccount !== undefined) { + scores[address] = scores[address] + scores[smartAccount]; + scores[smartAccount] = 0; + } + } + + return scores; +} From 056cc2906eb92e7ca9c10aac0ec48471a63268d0 Mon Sep 17 00:00:00 2001 From: Vladan Thales Date: Thu, 26 Jun 2025 11:22:16 +0200 Subject: [PATCH 4/4] Remove resetting smartAccount voting power --- src/strategies/overtime/index.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/strategies/overtime/index.ts b/src/strategies/overtime/index.ts index 37584f66f..b67377f7d 100644 --- a/src/strategies/overtime/index.ts +++ b/src/strategies/overtime/index.ts @@ -3,7 +3,6 @@ import { strategy as erc20BalanceOfStrategy } from '../erc20-balance-of'; export const author = 'thales-markets'; export const version = '1.0.0'; -export const dependOnOtherAddress = true; export async function strategy( space, @@ -35,10 +34,8 @@ export async function strategy( const address = Object.keys(scores)[i]; const smartAccount = eoaToSmartAccountMapping[address]; // If the current address has a mapped smart account, add the smart account's score to the owner's score - // and set the smart account's score to 0 to prevent double counting. if (smartAccount !== undefined) { scores[address] = scores[address] + scores[smartAccount]; - scores[smartAccount] = 0; } }