Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit c197032

Browse files
vladanthalesVladan ThalesChaituVR
authored
[overtime] Pass smart account addresses the base strategy along with the initial addresses (#1764)
* Change Base subgraph URL for Thales strategy * Update src/strategies/thales/index.ts Co-authored-by: Chaitanya <yourchaitu@gmail.com> * Overtime strategy * Remove resetting smartAccount voting power * Pass smart account addresses the base strategy along with the initial addresses --------- Co-authored-by: Vladan Thales <vladan@thalesmarket.io> Co-authored-by: Chaitanya <yourchaitu@gmail.com>
1 parent 3cb1625 commit c197032

2 files changed

Lines changed: 20 additions & 11 deletions

File tree

src/strategies/overtime/examples.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"network": "10",
1414
"addresses": [
1515
"0x9f8e4ee788D9b00A3409584E18034aA7B736C396",
16-
"0x3e09230ed70b667256BBaf1FDf949050D312D066",
1716
"0x7d2824F1825da25072011B3e326025172E404b15",
1817
"0x3320EE0189aAD77b3aB570a00464Ce7a45B6E465",
1918
"0x28b2Be30b0AE526aF0cB94984B750d4C35e913c0",

src/strategies/overtime/index.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { customFetch } from '../../utils';
22
import { strategy as erc20BalanceOfStrategy } from '../erc20-balance-of';
33

44
export const author = 'thales-markets';
5-
export const version = '1.0.0';
5+
export const version = '1.0.1';
66

77
export async function strategy(
88
space,
@@ -12,15 +12,6 @@ export async function strategy(
1212
options,
1313
snapshot
1414
): Promise<Record<string, number>> {
15-
const scores = await erc20BalanceOfStrategy(
16-
space,
17-
network,
18-
provider,
19-
addresses,
20-
options,
21-
snapshot
22-
);
23-
2415
const response = await customFetch(options.eoaToSmartAccountMapApi, {
2516
method: 'GET',
2617
headers: {
@@ -30,6 +21,25 @@ export async function strategy(
3021
});
3122
const eoaToSmartAccountMapping = await response.json();
3223

24+
// Build a list of smart account addresses, and pass it to the base strategy along with the initial addresses.
25+
const smartAccountAddresses: string[] = [];
26+
for (let i = 0; i < addresses.length; i++) {
27+
const address = addresses[i];
28+
const smartAccount = eoaToSmartAccountMapping[address];
29+
if (smartAccount !== undefined) {
30+
smartAccountAddresses.push(smartAccount);
31+
}
32+
}
33+
34+
const scores = await erc20BalanceOfStrategy(
35+
space,
36+
network,
37+
provider,
38+
[...addresses, ...smartAccountAddresses],
39+
options,
40+
snapshot
41+
);
42+
3343
for (let i = 0; i < Object.keys(scores).length; i++) {
3444
const address = Object.keys(scores)[i];
3545
const smartAccount = eoaToSmartAccountMapping[address];

0 commit comments

Comments
 (0)