channels.liquidations
Builds a channel for live futures buy and sell liquidation counts. Accepts a product on one exchange or a coin across exchanges.
Pass it to velo.channels.feed() with a data listener to receive updates.
Imports
import { Velo } from 'velo-sdk';Example
const velo = new Velo({ apiKey: process.env.VELO_API_KEY! });
const product = {
exchange: 'binance-futures',
coin: 'BTC',
product: 'BTCUSDT',
} as const;
const single = velo.channels.liquidations(product).on({
data: (row) => console.log(row.time, row.buy_liquidations),
error: ({ reason }) => console.error('Channel error:', reason),
});
const aggregated = velo.channels.liquidations({ coin: product.coin }).on({
data: (entries) => console.table(entries),
error: ({ reason }) => console.error('Aggregated channel error:', reason),
});
const watcher = await velo.watch(velo.channels.feed([single, aggregated]), {
on: { error: (error) => console.error('Connection error:', error) },
});
// Later:
watcher.close();Definition
Simplified signature. The SDK infers the returned channel's data type from the target.
function liquidations(target: Target<FuturesExchange>): Channel;Parameters
target
- Type:
Target<FuturesExchange> - Required
A futures product with exchange, coin, and product, as returned by the
catalog. Pass { coin } on its own for
an aggregated channel across futures exchanges.
Return Type
- Type:
Channel
Returns a channel typed with the selected target.
| Field | Description |
|---|---|
buy_liquidations | Forced buys that close short positions |
sell_liquidations | Forced sells that close long positions |
{
"exchange": "binance-futures",
"coin": "BTC",
"product": "BTCUSDT",
"time": 1785160560000,
"buy_liquidations": 3,
"sell_liquidations": 5
}[
{
"exchange": "binance-futures",
"coin": "BTC",
"buy_liquidations": 3,
"sell_liquidations": 5
}
]