Skip to main content

tracer.aggregated.funding#

OI-weighted cross-venue funding bucketed to a fixed 1h grid.

SYNTAX#

tracer.aggregated.funding: SourceHandle  // Cross-venue OI-weighted funding (1h grid)

ARGUMENTS#

  • opts.symbol (string) — Trading pair (default: chart symbol).
  • opts.from (number) — Window start, Unix-ms epoch (REQUIRED — archive-only).
  • opts.to (number) — Window end, Unix-ms epoch (REQUIRED).

RETURNS#

GenericSeriesSourceData — { kind: 'aggregated-funding', shape: 'series', values: { time: number[], rate: number[] } }

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.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#

// @indicator { name: "Funding Aggregated", pane: "sub" }
const af = tracer.aggregated.funding;
// Or: source("aggregated-funding", { from: 1704067200000, to: 1704153600000 })
function onBar(i, ctx) {
  // generic series: match by timestamp, not bar index (see REMARKS)
  const t = candles[i].time;
  const j = af.values.time.lastIndexOf(t); // exact ts; else scan for nearest ts <= t
  plot("funding", j >= 0 ? af.values.rate[j] * 100 : null);
}