Skip to content

Commit

Permalink
sqs pools handle no pools (#3801)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonator authored Aug 28, 2024
1 parent b9fddb5 commit caacfd4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export function getPoolsFromSidecar({
minLiquidityUsd?: number;
withMarketIncentives?: boolean;
}): Promise<Pool[]> {
if (poolIds && !poolIds.length) return Promise.resolve([]);

return cachified({
cache: poolsCache,
key:
Expand Down
11 changes: 5 additions & 6 deletions packages/server/src/queries/complex/pools/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,13 @@ export async function getUserPools(params: {
.map(({ position: { pool_id } }) => pool_id)
.forEach((poolId) => userUniquePoolIds.add(poolId));

const eventualPools = await timeout(
() => getPools({ ...params, poolIds: Array.from(userUniquePoolIds) }),
10_000, // 10 seconds
"getPools"
)();
const pools = await getPools({
...params,
poolIds: Array.from(userUniquePoolIds),
});

return await Promise.all(
eventualPools.map(async (pool) => {
pools.map(async (pool) => {
const { id, reserveCoins, totalFiatValueLocked, type } = pool;
let userValue: PricePretty = new PricePretty(
DEFAULT_VS_CURRENCY,
Expand Down
37 changes: 0 additions & 37 deletions packages/web/pages/test-bridge.tsx

This file was deleted.

0 comments on commit caacfd4

Please sign in to comment.