File tree Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Expand file tree Collapse file tree 2 files changed +2
-3
lines changed Original file line number Diff line number Diff 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 } )
Original file line number Diff line number Diff line change @@ -49,9 +49,7 @@ const PERP_MARKETS = {
4949} ;
5050
5151function 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
You can’t perform that action at this time.
0 commit comments