Skip to content

Commit

Permalink
Merge pull request #14 from beefyfinance/fixes
Browse files Browse the repository at this point in the history
Fix graphql mesh same data returned
  • Loading branch information
seguido authored Jun 11, 2024
2 parents 53ed710 + 3f5a82e commit 7c352ca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/routes/v1/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ const getVaultPrice = async (chain: ChainId, vault_address: string) => {
throw new GraphQueryError(e);
});

const vault = res.clm || res.beta_clm;
const vault = res.clm || (chain === 'arbitrum' ? res.beta_clm : undefined);
if (!vault) {
return undefined;
}
Expand All @@ -204,7 +204,7 @@ const getVaultHarvests = async (chain: ChainId, vault_address: string) => {
throw new GraphQueryError(e);
});

const vault = res.clm || res.beta_clm;
const vault = res.clm || (chain === 'arbitrum' ? res.beta_clm : undefined);
if (!vault) {
return undefined;
}
Expand Down Expand Up @@ -268,7 +268,7 @@ const getVaultHistoricPrices = async (
throw new GraphQueryError(e);
});

const vault = res.clm || res.beta_clm;
const vault = res.clm || (chain === 'arbitrum' ? res.beta_clm : undefined);
if (!vault) {
return undefined;
}
Expand Down Expand Up @@ -302,7 +302,7 @@ const getVaultHistoricPricesRange = async (
throw new GraphQueryError(e);
});

const vault = res.clm || res.beta_clm;
const vault = res.clm || (chain === 'arbitrum' ? res.beta_clm : undefined);
if (!vault) {
return undefined;
}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/v1/vaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ const getVaults = async (chain: ChainId, period: Period) => {
const since = BigInt(Math.floor(now.getTime() / 1000) - periodSeconds);
const rawVaults = await getSdkForChain(chain)
.Vaults({ since: since.toString() })
.then(res => [...res.clms, ...res.beta_clms])
.then(res => [...res.clms, ...(chain === 'arbitrum' ? res.beta_clms : [])])
.catch((e: unknown) => {
throw new GraphQueryError(e);
});
Expand Down Expand Up @@ -167,7 +167,7 @@ const getVaultsHarvests = async (
: sdk.VaultsHarvests({ since: since.toString() });

const rawVaults = await queryPromise
.then(res => [...res.clms, ...res.beta_clms])
.then(res => [...res.clms, ...(chain === 'arbitrum' ? res.beta_clms : [])])
.catch((e: unknown) => {
throw new GraphQueryError(e);
});
Expand Down

0 comments on commit 7c352ca

Please sign in to comment.