From 0ac7c3b6bb6b77e90423ab9ebd3b3e6fa11fdecf Mon Sep 17 00:00:00 2001 From: Jack Ellis Date: Fri, 9 Feb 2024 11:51:07 +0000 Subject: [PATCH] fix: temporarily remove premiumpaids to field 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. --- .../src/pools/fetchLiquidityPools/fetchLiquidityPools.ts | 1 - packages/core/src/pools/fetchPremiumPaids.ts | 6 ++++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/core/src/pools/fetchLiquidityPools/fetchLiquidityPools.ts b/packages/core/src/pools/fetchLiquidityPools/fetchLiquidityPools.ts index 33fcef7..121ecb5 100644 --- a/packages/core/src/pools/fetchLiquidityPools/fetchLiquidityPools.ts +++ b/packages/core/src/pools/fetchLiquidityPools/fetchLiquidityPools.ts @@ -52,7 +52,6 @@ export const makeFetchLiquidityPools = }); const premiumPaids = await fetchPremiumPaids({ network, - vaultAddresses: allVaultAddresses, }); const pools: LiquidityPool[] = []; diff --git a/packages/core/src/pools/fetchPremiumPaids.ts b/packages/core/src/pools/fetchPremiumPaids.ts index f543979..fe7a94e 100644 --- a/packages/core/src/pools/fetchPremiumPaids.ts +++ b/packages/core/src/pools/fetchPremiumPaids.ts @@ -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({ @@ -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, }; })