{"version":3,"file":"dataMappers.cjs","names":["ProductEngineType","toBigNumber"],"sources":["../src/dataMappers.ts"],"sourcesContent":["import {\n  mapEngineServerPerpProduct,\n  mapEngineServerSpotProduct,\n} from '@nadohq/engine-client';\nimport {\n  getRecvTimeFromOrderNonce,\n  mapValues,\n  Market,\n  PerpMarket,\n  ProductEngineType,\n  removeDecimals,\n  SpotMarket,\n  subaccountFromHex,\n  toBigNumber,\n  toIntegerString,\n  unpackOrderAppendix,\n} from '@nadohq/shared';\nimport {\n  Candlestick,\n  GetIndexerPortfolioCalendarResponse,\n  GetIndexerPortfolioResponse,\n  IndexerEvent,\n  IndexerEventWithTx,\n  IndexerFundingRate,\n  IndexerFundingRateHistoryEntry,\n  IndexerLeaderboardContest,\n  IndexerLeaderboardParticipant,\n  IndexerLeaderboardRegistration,\n  IndexerMaker,\n  IndexerMarketSnapshot,\n  IndexerMatchEventBalances,\n  IndexerNlpSnapshot,\n  IndexerOrder,\n  IndexerPerpBalance,\n  IndexerPerpPrices,\n  IndexerPortfolioCalendarDay,\n  IndexerPortfolioPoint,\n  IndexerPosition,\n  IndexerProductPayment,\n  IndexerServerBalance,\n  IndexerServerCandlestick,\n  IndexerServerEvent,\n  IndexerServerFundingRate,\n  IndexerServerFundingRateHistoryEntry,\n  IndexerServerLeaderboardContest,\n  IndexerServerLeaderboardPosition,\n  IndexerServerLeaderboardRegistration,\n  IndexerServerMaker,\n  IndexerServerMarketSnapshot,\n  IndexerServerMatchEventBalances,\n  IndexerServerNlpSnapshot,\n  IndexerServerOrder,\n  IndexerServerPerpPrices,\n  IndexerServerPortfolioCalendarDay,\n  IndexerServerPortfolioCalendarResponse,\n  IndexerServerPortfolioPoint,\n  IndexerServerPortfolioResponse,\n  IndexerServerPosition,\n  IndexerServerProduct,\n  IndexerServerProductPayment,\n  IndexerServerSnapshotsInterval,\n  IndexerServerTx,\n  IndexerServerV2MarketHours,\n  IndexerServerV2Symbol,\n  IndexerServerV2TickerResponse,\n  IndexerSnapshotsIntervalParams,\n  IndexerSpotBalance,\n  IndexerV2MarketHours,\n  IndexerV2Symbol,\n  IndexerV2TickerResponse,\n  IndexerV2TradingStatus,\n} from './types';\n\nexport function mapSnapshotsIntervalToServerParams(\n  params: IndexerSnapshotsIntervalParams,\n): IndexerServerSnapshotsInterval {\n  return {\n    count: params.limit,\n    max_time: params.maxTimeInclusive\n      ? toIntegerString(params.maxTimeInclusive)\n      : undefined,\n    granularity: params.granularity,\n  };\n}\n\nexport function mapIndexerServerProduct(product: IndexerServerProduct): Market {\n  if ('spot' in product) {\n    return mapEngineServerSpotProduct(product.spot);\n  }\n  return mapEngineServerPerpProduct(product.perp);\n}\n\nexport function mapIndexerServerBalance(\n  balance: IndexerServerBalance,\n): IndexerSpotBalance | IndexerPerpBalance {\n  if ('spot' in balance) {\n    return {\n      amount: toBigNumber(balance.spot.balance.amount),\n      productId: balance.spot.product_id,\n      type: ProductEngineType.SPOT,\n    };\n  }\n  return {\n    amount: toBigNumber(balance.perp.balance.amount),\n    productId: balance.perp.product_id,\n    type: ProductEngineType.PERP,\n    vQuoteBalance: toBigNumber(balance.perp.balance.v_quote_balance),\n  };\n}\n\nexport function mapIndexerOrder(order: IndexerServerOrder): IndexerOrder {\n  const appendix = unpackOrderAppendix(order.appendix);\n  return {\n    amount: toBigNumber(order.amount),\n    digest: order.digest,\n    expiration: Number(order.expiration),\n    appendix,\n    nonce: toBigNumber(order.nonce),\n    isolated: order.isolated,\n    recvTimeSeconds: getRecvTimeFromOrderNonce(order.nonce) / 1000,\n    price: removeDecimals(order.price_x18),\n    productId: order.product_id,\n    subaccount: order.subaccount,\n    submissionIndex: order.submission_idx,\n    lastFillSubmissionIndex: order.last_fill_submission_idx,\n    baseFilled: toBigNumber(order.base_filled),\n    quoteFilled: toBigNumber(order.quote_filled),\n    totalFee: toBigNumber(order.fee),\n    builderFee: toBigNumber(order.builder_fee),\n    realizedPnl: toBigNumber(order.realized_pnl),\n    closedAmount: toBigNumber(order.closed_amount),\n    closedNetEntry: toBigNumber(order.closed_net_entry),\n    preCloseMargin: order.closed_margin\n      ? toBigNumber(order.closed_margin)\n      : null,\n    firstFillTimestamp: toBigNumber(order.first_fill_timestamp),\n    lastFillTimestamp: toBigNumber(order.last_fill_timestamp),\n    preBalances: mapIndexerMatchEventBalances(order.pre_balance),\n    postBalances: mapIndexerMatchEventBalances(order.post_balance),\n  };\n}\n\nexport function mapIndexerEvent(event: IndexerServerEvent): IndexerEvent {\n  const eventState: IndexerEvent['state'] = (() => {\n    // Assume backend data is consistent\n    if ('spot' in event.pre_balance) {\n      return {\n        type: ProductEngineType.SPOT,\n        market: mapIndexerServerProduct(event.product) as SpotMarket,\n        preBalance: mapIndexerServerBalance(\n          event.pre_balance,\n        ) as IndexerSpotBalance,\n        postBalance: mapIndexerServerBalance(\n          event.post_balance,\n        ) as IndexerSpotBalance,\n      };\n    }\n    return {\n      type: ProductEngineType.PERP,\n      market: mapIndexerServerProduct(event.product) as PerpMarket,\n      preBalance: mapIndexerServerBalance(\n        event.pre_balance,\n      ) as IndexerPerpBalance,\n      postBalance: mapIndexerServerBalance(\n        event.post_balance,\n      ) as IndexerPerpBalance,\n    };\n  })();\n\n  return {\n    eventType: event.event_type,\n    productId: event.product_id,\n    isolated: event.isolated,\n    isolatedProductId: event.isolated_product_id,\n    state: eventState,\n    subaccount: event.subaccount,\n    submissionIndex: event.submission_idx,\n    trackedVars: {\n      netEntryCumulative: toBigNumber(event.net_entry_cumulative),\n      netEntryUnrealized: toBigNumber(event.net_entry_unrealized),\n      netFundingCumulative: toBigNumber(event.net_funding_cumulative),\n      netFundingUnrealized: toBigNumber(event.net_funding_unrealized),\n      netInterestCumulative: toBigNumber(event.net_interest_cumulative),\n      netInterestUnrealized: toBigNumber(event.net_interest_unrealized),\n      quoteVolumeCumulative: toBigNumber(event.quote_volume_cumulative),\n      cumulativeTradeCount: toBigNumber(event.cumulative_trade_count),\n    },\n  };\n}\n\nexport function mapIndexerEventWithTx(\n  event: IndexerServerEvent,\n  tx: IndexerServerTx,\n): IndexerEventWithTx {\n  return {\n    timestamp: toBigNumber(tx.timestamp),\n    tx: tx.tx,\n    ...mapIndexerEvent(event),\n  };\n}\n\nexport function mapIndexerMatchEventBalances(\n  eventBalances: IndexerServerMatchEventBalances,\n): IndexerMatchEventBalances {\n  return {\n    base: mapIndexerServerBalance(eventBalances.base),\n    quote: eventBalances.quote\n      ? (mapIndexerServerBalance(eventBalances.quote) as IndexerSpotBalance)\n      : undefined,\n  };\n}\n\n/**\n * Maps a position returned by the indexer positions query to its client representation.\n * @param position - The position in server (snake_case, x18 prices) format.\n * @returns The position with camelCase fields and BigNumber values.\n */\nexport function mapIndexerPosition(\n  position: IndexerServerPosition,\n): IndexerPosition {\n  return {\n    subaccount: position.subaccount,\n    productId: position.product_id,\n    isolated: position.isolated,\n    direction: position.direction,\n    openId: position.open_id,\n    closeId: position.close_id,\n    submissionIndex: position.submission_idx,\n    amount: toBigNumber(position.amount),\n    maxAmount: toBigNumber(position.max_amount),\n    totalOpenAmount: toBigNumber(position.total_open_amount),\n    totalCloseAmount: toBigNumber(position.total_close_amount),\n    averageEntryPrice: removeDecimals(position.average_entry_price),\n    averageExitPrice: removeDecimals(position.average_exit_price),\n    liquidatedAmount: toBigNumber(position.liquidated_amount),\n    maxIsolatedLeverage: removeDecimals(position.max_isolated_leverage_x18),\n    openFee: toBigNumber(position.open_fee),\n    closeFee: toBigNumber(position.close_fee),\n    realizedPnl: toBigNumber(position.realized_pnl),\n    openTimestamp: toBigNumber(position.open_timestamp),\n    updateTimestamp: toBigNumber(position.update_timestamp),\n    openReason: position.open_reason,\n    closeReason: position.close_reason,\n    netFundingPayment: toBigNumber(position.net_funding_payment),\n    netInterestPayment: toBigNumber(position.net_interest_payment),\n    openDigest: position.open_digest,\n    closeDigest: position.close_digest,\n    netEntryUnrealized: toBigNumber(position.net_entry_unrealized),\n  };\n}\n\nexport function mapIndexerProductPayment(\n  payment: IndexerServerProductPayment,\n): IndexerProductPayment {\n  return {\n    submissionIndex: payment.idx,\n    timestamp: toBigNumber(payment.timestamp),\n    paymentAmount: toBigNumber(payment.amount),\n    balanceAmount: toBigNumber(payment.balance_amount),\n    annualPaymentRate: removeDecimals(payment.rate_x18),\n    oraclePrice: removeDecimals(payment.oracle_price_x18),\n    isolated: payment.isolated,\n    productId: payment.product_id,\n    isolatedProductId: payment.isolated_product_id,\n  };\n}\n\nexport function mapIndexerPerpPrices(\n  perpPrices: IndexerServerPerpPrices,\n): IndexerPerpPrices {\n  return {\n    indexPrice: removeDecimals(perpPrices.index_price_x18),\n    markPrice: removeDecimals(perpPrices.mark_price_x18),\n    updateTime: toBigNumber(perpPrices.update_time),\n    productId: perpPrices.product_id,\n  };\n}\n\nexport function mapIndexerFundingRate(\n  fundingRate: IndexerServerFundingRate,\n): IndexerFundingRate {\n  return {\n    fundingRate: removeDecimals(fundingRate.funding_rate_x18),\n    updateTime: toBigNumber(fundingRate.update_time),\n    productId: fundingRate.product_id,\n  };\n}\n\nexport function mapIndexerFundingRateHistory(\n  entry: IndexerServerFundingRateHistoryEntry,\n): IndexerFundingRateHistoryEntry {\n  return {\n    productId: entry.product_id,\n    timestamp: toBigNumber(entry.timestamp),\n    fundingRateFrac: removeDecimals(entry.funding_rate_x18),\n  };\n}\n\nfunction mapIndexerPortfolioPoint([\n  timestamp,\n  value,\n]: IndexerServerPortfolioPoint): IndexerPortfolioPoint {\n  return {\n    timestamp: toBigNumber(timestamp),\n    value: toBigNumber(value),\n  };\n}\n\nexport function mapIndexerPortfolio(\n  response: IndexerServerPortfolioResponse,\n): GetIndexerPortfolioResponse {\n  return Object.fromEntries(\n    response.map(([period, history]) => [\n      period,\n      {\n        accountValueHistory: history.accountValueHistory.map(\n          mapIndexerPortfolioPoint,\n        ),\n        pnlHistory: history.pnlHistory.map(mapIndexerPortfolioPoint),\n        volumeHistory: history.volumeHistory.map(mapIndexerPortfolioPoint),\n        tradeSizeHistory: history.tradeSizeHistory.map(\n          mapIndexerPortfolioPoint,\n        ),\n        marketCountHistory: history.marketCountHistory.map(\n          mapIndexerPortfolioPoint,\n        ),\n      },\n    ]),\n  ) as GetIndexerPortfolioResponse;\n}\n\nfunction mapIndexerPortfolioCalendarDay(\n  day: IndexerServerPortfolioCalendarDay,\n): IndexerPortfolioCalendarDay {\n  return {\n    date: toBigNumber(day.date),\n    pnl: toBigNumber(day.pnl),\n    volume: toBigNumber(day.volume),\n    tradeCount: toBigNumber(day.trade_count),\n    productIds: day.product_ids,\n  };\n}\n\nexport function mapIndexerPortfolioCalendar(\n  response: IndexerServerPortfolioCalendarResponse,\n): GetIndexerPortfolioCalendarResponse {\n  return {\n    spot: response.spot.map(mapIndexerPortfolioCalendarDay),\n    perp: response.perp.map(mapIndexerPortfolioCalendarDay),\n  };\n}\n\nexport function mapIndexerMakerStatistics(\n  maker: IndexerServerMaker,\n): IndexerMaker {\n  return {\n    address: maker.address,\n    snapshots: maker.data.map((makerData) => {\n      return {\n        timestamp: toBigNumber(makerData.timestamp),\n        makerFee: toBigNumber(makerData.maker_fee),\n        uptime: toBigNumber(makerData.uptime),\n        sumQMin: toBigNumber(makerData.sum_q_min),\n        qScore: toBigNumber(makerData.q_score),\n        makerShare: toBigNumber(makerData.maker_share),\n        expectedMakerReward: toBigNumber(makerData.expected_maker_reward),\n      };\n    }),\n  };\n}\n\nexport function mapIndexerLeaderboardPosition(\n  position: IndexerServerLeaderboardPosition,\n): IndexerLeaderboardParticipant {\n  const tracks = mapValues(position.tracks, (trackData) => ({\n    value: toBigNumber(trackData.value),\n    rank: toBigNumber(trackData.rank),\n    qualificationStatus: trackData.qualification_status,\n  }));\n\n  return {\n    subaccount: subaccountFromHex(position.subaccount),\n    contestId: position.contest_id,\n    accountValue: toBigNumber(position.account_value),\n    updateTime: toBigNumber(position.update_time),\n    tracks,\n    socialAccounts: position.social_accounts.map((account) => ({\n      provider: account.provider,\n      username: account.username,\n      displayName: account.display_name,\n      profileImageUrl: account.profile_image_url,\n    })),\n  };\n}\n\nexport function mapIndexerLeaderboardRegistration(\n  registration: IndexerServerLeaderboardRegistration,\n): IndexerLeaderboardRegistration {\n  return {\n    subaccount: subaccountFromHex(registration.subaccount),\n    contestId: registration.contest_id,\n    updateTime: toBigNumber(registration.update_time),\n  };\n}\n\nexport function mapIndexerLeaderboardContest(\n  contest: IndexerServerLeaderboardContest,\n): IndexerLeaderboardContest {\n  const startTime = toBigNumber(contest.start_time);\n  const endTime = toBigNumber(contest.end_time);\n\n  return {\n    contestId: contest.contest_id,\n    startTime,\n    endTime,\n    totalParticipants: toBigNumber(contest.count),\n    requiredProductIds: contest.product_ids,\n    active: contest.active,\n    lastUpdated: toBigNumber(contest.last_updated),\n    title: contest.title,\n    description: contest.description,\n    tracks: contest.tracks.map((track) => ({\n      trackId: track.track_id,\n      rankType: track.rank_type,\n      sortOrder: track.sort_order,\n      accountValueThreshold: toBigNumber(track.threshold),\n      volumeThreshold: toBigNumber(track.volume_threshold),\n    })),\n  };\n}\n\nexport function mapIndexerCandlesticks(\n  candlestick: IndexerServerCandlestick,\n): Candlestick {\n  return {\n    close: removeDecimals(candlestick.close_x18),\n    high: removeDecimals(candlestick.high_x18),\n    low: removeDecimals(candlestick.low_x18),\n    open: removeDecimals(candlestick.open_x18),\n    time: toBigNumber(candlestick.timestamp),\n    volume: toBigNumber(candlestick.volume),\n  };\n}\n\nexport function mapIndexerMarketSnapshot(\n  snapshot: IndexerServerMarketSnapshot,\n): IndexerMarketSnapshot {\n  return {\n    timestamp: toBigNumber(snapshot.timestamp),\n    cumulativeUsers: toBigNumber(snapshot.cumulative_users),\n    dailyActiveUsers: toBigNumber(snapshot.daily_active_users),\n    tvl: toBigNumber(snapshot.tvl),\n    borrowRates: mapValues(snapshot.borrow_rates, (value) =>\n      removeDecimals(value),\n    ),\n    cumulativeLiquidationAmounts: mapValues(\n      snapshot.cumulative_liquidation_amounts,\n      toBigNumber,\n    ),\n    cumulativeMakerFees: mapValues(snapshot.cumulative_maker_fees, toBigNumber),\n    cumulativeSequencerFees: mapValues(\n      snapshot.cumulative_sequencer_fees,\n      toBigNumber,\n    ),\n    cumulativeTakerFees: mapValues(snapshot.cumulative_taker_fees, toBigNumber),\n    cumulativeTrades: mapValues(snapshot.cumulative_trades, toBigNumber),\n    cumulativeVolumes: mapValues(snapshot.cumulative_volumes, toBigNumber),\n    depositRates: mapValues(snapshot.deposit_rates, (value) =>\n      removeDecimals(value),\n    ),\n    fundingRates: mapValues(snapshot.funding_rates, (value) =>\n      removeDecimals(value),\n    ),\n    openInterestsQuote: mapValues(snapshot.open_interests, toBigNumber),\n    totalBorrows: mapValues(snapshot.total_borrows, toBigNumber),\n    totalDeposits: mapValues(snapshot.total_deposits, toBigNumber),\n    cumulativeTradeSizes: mapValues(\n      snapshot.cumulative_trade_sizes,\n      toBigNumber,\n    ),\n    cumulativeInflows: mapValues(snapshot.cumulative_inflows, toBigNumber),\n    cumulativeOutflows: mapValues(snapshot.cumulative_outflows, toBigNumber),\n    oraclePrices: mapValues(snapshot.oracle_prices, (value) =>\n      removeDecimals(value),\n    ),\n  };\n}\n\nexport function mapIndexerNlpSnapshot(\n  snapshot: IndexerServerNlpSnapshot,\n): IndexerNlpSnapshot {\n  return {\n    submissionIndex: snapshot.submission_idx,\n    timestamp: toBigNumber(snapshot.timestamp),\n    cumulativeBurnAmountQuote: toBigNumber(snapshot.cumulative_burn_quote),\n    cumulativeMintAmountQuote: toBigNumber(snapshot.cumulative_mint_quote),\n    cumulativePnl: toBigNumber(snapshot.cumulative_pnl),\n    cumulativeTrades: toBigNumber(snapshot.cumulative_trades),\n    cumulativeVolume: toBigNumber(snapshot.cumulative_volume),\n    depositors: toBigNumber(snapshot.depositors),\n    oraclePrice: removeDecimals(snapshot.oracle_price_x18),\n    tvl: toBigNumber(snapshot.tvl),\n  };\n}\n\nexport function mapIndexerV2Ticker(\n  ticker: IndexerServerV2TickerResponse,\n): IndexerV2TickerResponse {\n  return {\n    productId: ticker.product_id,\n    tickerId: ticker.ticker_id,\n    baseCurrency: ticker.base_currency,\n    quoteCurrency: ticker.quote_currency,\n    lastPrice: ticker.last_price,\n    baseVolume: ticker.base_volume,\n    quoteVolume: ticker.quote_volume,\n    priceChangePercent24h: ticker.price_change_percent_24h,\n  };\n}\n\nexport function mapIndexerV2MarketHours(\n  hours: IndexerServerV2MarketHours,\n): IndexerV2MarketHours {\n  return {\n    isOpen: hours.is_open,\n    reason: hours.reason,\n    nextClose: hours.next_close,\n    nextOpen: hours.next_open,\n  };\n}\n\nexport function mapIndexerV2Symbols(\n  symbol: IndexerServerV2Symbol,\n): IndexerV2Symbol {\n  return {\n    type: symbol.type,\n    productId: symbol.product_id,\n    symbol: symbol.symbol,\n    priceIncrement: removeDecimals(symbol.price_increment_x18),\n    sizeIncrement: symbol.size_increment,\n    minSize: symbol.min_size,\n    makerFeeRate: removeDecimals(symbol.maker_fee_rate_x18),\n    takerFeeRate: removeDecimals(symbol.taker_fee_rate_x18),\n    longWeightInitial: removeDecimals(symbol.long_weight_initial_x18),\n    longWeightMaintenance: removeDecimals(symbol.long_weight_maintenance_x18),\n    maxOpenInterest: symbol.max_open_interest_x18\n      ? removeDecimals(symbol.max_open_interest_x18)\n      : null,\n    exchangeRate: symbol.exchange_rate_x18\n      ? removeDecimals(symbol.exchange_rate_x18)\n      : null,\n    tradingStatus: symbol.trading_status as IndexerV2TradingStatus,\n    isolatedOnly: symbol.isolated_only,\n    marketHours: symbol.market_hours\n      ? mapIndexerV2MarketHours(symbol.market_hours)\n      : null,\n    boostType: symbol.boost_type ?? null,\n    takerMultiplier: symbol.taker_multiplier ?? null,\n    makerMultiplier: symbol.maker_multiplier ?? null,\n  };\n}\n"],"mappings":";;;;AAyEA,SAAgB,mCACd,QACgC;CAChC,OAAO;EACL,OAAO,OAAO;EACd,UAAU,OAAO,oBAAA,GAAA,eAAA,iBACG,OAAO,gBAAgB,IACvC,KAAA;EACJ,aAAa,OAAO;CACtB;AACF;AAEA,SAAgB,wBAAwB,SAAuC;CAC7E,IAAI,UAAU,SACZ,QA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