Skip to content

Commit

Permalink
fix: temporarily remove premiumpaids to field
Browse files Browse the repository at this point in the history
There is currently a bug in the subgraph where if a premium is paid to a null address (which has been the case), fetching the to field will throw an error.
Until this is fixed we will need to omit the to field from the premiumPaids object.
  • Loading branch information
jackmellis committed Feb 9, 2024
1 parent 60d17d5 commit 0ac7c3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export const makeFetchLiquidityPools =
});
const premiumPaids = await fetchPremiumPaids({
network,
vaultAddresses: allVaultAddresses,
});

const pools: LiquidityPool[] = [];
Expand Down
6 changes: 4 additions & 2 deletions packages/core/src/pools/fetchPremiumPaids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const makeFetchPremiumPaids =
s.amount,
s.date,
s.id,
s.to((to) => [to.id]),
// s.to((to) => [to.id]),
s.vault((vault) => [vault.id, vault.vaultId]),
]);
const data = await querySubgraph({
Expand All @@ -53,7 +53,9 @@ export const makeFetchPremiumPaids =
date: Number(p.date),
amount: BigInt(p.amount),
vaultId: p.vault.vaultId,
to: p.to.id as Address,
// FIXME: restore when the subgraph fixes this field
// to: p.to.id as Address,
to: undefined as unknown as Address,
vaultAddress: p.vault.id as Address,
};
})
Expand Down

0 comments on commit 0ac7c3b

Please sign in to comment.