Skip to content

Commit

Permalink
fix: fix invalid block value passed to thegraph
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Jan 31, 2024
1 parent b79cf32 commit 85699e4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/strategies/synthetix/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,27 @@ const MED_PRECISE_UNIT = 1e18;
const SCALING_FACTOR = 1e5;

function returnGraphParams(snapshot: number | string, addresses: string[]) {
return {
const params = {
snxholders: {
__args: {
where: {
id_in: addresses.map((address: string) => address.toLowerCase())
},
first: 1000,
block: {
number: snapshot
}
first: 1000
},
id: true,
initialDebtOwnership: true,
debtEntryAtIndex: true
}
};

if (snapshot !== 'latest') {
(params.snxholders.__args as any).block = {
number: snapshot
};
}

return params;
}

const loadLastDebtLedgerEntry = async (
Expand Down

0 comments on commit 85699e4

Please sign in to comment.