Data Sources
Market Stats
Funding, liquidations, and mark price data.
Legacy Scripting v2
These docs remain available while the v2 engine is supported. For new scripts, use Scripting v3.
data.STAT exposes per-bar liquidation totals, mark price, and funding rate.
data.STAT supports aggregated exchange strings such as "binancef:bybitf".
const stat = subscribe(data.STAT)Functions
stat.sellLiq(offset?) -> number
stat.buyLiq(offset?) -> number
stat.markPrice(offset?) -> number
stat.fundingRate(offset?) -> number
stat.unix(offset?) -> numberoffset?: optional bar offset on the STAT subscription clock
Example
//@version=2
indicator("Funding and Mark", false)
const stat = subscribe(data.STAT)
function onBar(index) {
plot("Mark Price", stat.markPrice(), { color: color.white, forceOverlay: true })
plot("Funding Rate", stat.fundingRate(), { color: color.orange })
}