Skip to content

Commit

Permalink
Prevent getAllGauges from breaking if temp pool mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
philippe-git committed Oct 31, 2023
1 parent b63704c commit db8747c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pages/api/getAllGauges.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ export default fn(async ({ blockchainId } = {}) => {
])),
})).map((gaugeData) => {
const pool = getPoolByLpTokenAddress(gaugeData.lpTokenAddress, 'ethereum');
if (!pool) {
console.log('MISSING POOL:', gaugeData.lpTokenAddress)
return null;
}

return {
...gaugeData,
Expand All @@ -228,7 +232,7 @@ export default fn(async ({ blockchainId } = {}) => {
type: ((pool.registryId === 'crypto' || pool.registryId === 'factory-crypto') ? 'crypto' : 'stable'),
lpTokenPrice: (pool.usdTotal / (pool.totalSupply / 1e18)),
};
});
}).filter((o) => o !== null);

const mainGaugesEthereum = arrayToHashmap(gaugesData.map(({
address,
Expand Down

1 comment on commit db8747c

@vercel
Copy link

@vercel vercel bot commented on db8747c Oct 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.