Skip to main content

tracer.stock_perps.funding#

Stock-perp funding from /api/v1/stock-perps/funding.

SYNTAX#

tracer.stock_perps.funding: SourceHandle  // Stock-perp funding (HOURLY cadence)

ARGUMENTS#

  • opts.symbol (string) — Stock-perp symbol.
  • opts.exchange (string) — 'hyperliquid' or 'lighter'.

RETURNS#

GenericSeriesSourceData — { values: { time, rate (per-hour), annualized_rate } }

REMARKS#

Generic series — rows arrive at the source's native cadence and are NOT 1:1 with chart candles. To align, match values.time[i] (unix SECONDS) against candles[j].time; do not assume row i corresponds to bar i (values.annualized_rate[i] is generally NOT bar i's value). (Per-candle kinds like oi/funding are the exception — those are forward-filled to your candles.)

EXAMPLE#

const sf = tracer.stock_perps.funding;
function onBar(i, ctx) {
  // generic series: match by timestamp, not bar index (see REMARKS)
  const j = sf.values.time.lastIndexOf(candles[i].time);
  plot("ann_rate", j >= 0 ? sf.values.annualized_rate[j] : null);
}