Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/strategies/overtime/examples.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"network": "10",
"addresses": [
"0x9f8e4ee788D9b00A3409584E18034aA7B736C396",
"0x3e09230ed70b667256BBaf1FDf949050D312D066",
"0x7d2824F1825da25072011B3e326025172E404b15",
"0x3320EE0189aAD77b3aB570a00464Ce7a45B6E465",
"0x28b2Be30b0AE526aF0cB94984B750d4C35e913c0",
Expand Down
30 changes: 20 additions & 10 deletions src/strategies/overtime/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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 version = '1.0.1';

export async function strategy(
space,
Expand All @@ -12,15 +12,6 @@ export async function strategy(
options,
snapshot
): Promise<Record<string, number>> {
const scores = await erc20BalanceOfStrategy(
space,
network,
provider,
addresses,
options,
snapshot
);

const response = await customFetch(options.eoaToSmartAccountMapApi, {
method: 'GET',
headers: {
Expand All @@ -30,6 +21,25 @@ export async function strategy(
});
const eoaToSmartAccountMapping = await response.json();

// Build a list of smart account addresses, and pass it to the base strategy along with the initial addresses.
const smartAccountAddresses: string[] = [];
for (let i = 0; i < addresses.length; i++) {
const address = addresses[i];
const smartAccount = eoaToSmartAccountMapping[address];
if (smartAccount !== undefined) {
smartAccountAddresses.push(smartAccount);
}
}

const scores = await erc20BalanceOfStrategy(
space,
network,
provider,
[...addresses, ...smartAccountAddresses],
options,
snapshot
);

for (let i = 0; i < Object.keys(scores).length; i++) {
const address = Object.keys(scores)[i];
const smartAccount = eoaToSmartAccountMapping[address];
Expand Down
Loading