Skip to content

Commit 5a256e6

Browse files
authored
Fix: Luckyfuture (#17036)
1 parent 90d8e0d commit 5a256e6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

projects/LuckyFuture/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ async function tvl(api) {
5959
if (spotPositions?.length) {
6060
spotPositions.forEach(position => {
6161
const tokenMint = getTokenMintFromMarketIndex(position.market_index)
62+
if (!tokenMint) return
6263
const adjustedBalance = processSpotPosition(position, spotAccountMap[position.market_index])
6364
api.add(tokenMint, adjustedBalance)
6465
})

projects/LuckyFuture/spotMarkets.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ const PERP_MARKETS = {
4949
};
5050

5151
function getTokenMintFromMarketIndex(marketIndex) {
52-
if (!SPOT_MARKETS[marketIndex]) {
53-
throw new Error(`Market index ${marketIndex} not found`);
54-
}
52+
if (!SPOT_MARKETS[marketIndex]) return null
5553
return SPOT_MARKETS[marketIndex].mint;
5654
}
5755

0 commit comments

Comments
 (0)