watchTicker
Receba atualizações de preço em tempo real para um par de trading específico.
Subscrição
{
"action": "subscribe",
"channel": "watchTicker",
"data": {
"symbol": "BTC/BRL"
}
}
Símbolos Disponíveis
BTC/BRL, ETH/BRL, SOL/BRL, USDC/BRL
Payload de Dados
{
"channel": "watchTicker",
"message": {
"symbol": "BTC/BRL",
"timestamp": "1719941355512",
"high": 365754.71,
"low": 353851.69,
"bid": 349984.21,
"bidVolume": 0.06122,
"ask": 354901.29,
"askVolume": 1.14199,
"open": 359800.00,
"close": 355000.00,
"last": 355000.00,
"change": -4800.00,
"percentage": -1.33,
"average": 359813.06,
"quoteVolume": 2762677452.45,
"baseVolume": 4445.0876,
"currentSpreadBuy": 0.01,
"currentSpreadSell": 0.01,
"currentFeePoolRateBuy": 0.001,
"currentFeePoolRateSell": 0.001,
"currentFeeTierRate": 0.0025,
"currentFeePriceBuyBrl": 887.50,
"currentFeePriceSellBrl": 887.50
}
}
Campos
| Campo | Descrição |
|---|---|
symbol | Par de mercado |
timestamp | Timestamp da mensagem |
high / low | Máxima e mínima das últimas 24h (R$) |
bid / ask | Melhor preço de compra/venda com spread aplicado (R$) |
bidVolume / askVolume | Volume disponível no melhor preço |
open / close | Preço de abertura/fechamento do dia (R$) |
last | Último preço negociado (R$) |
change / percentage | Variação absoluta e percentual 24h |
average | Preço médio 24h (R$) |
quoteVolume / baseVolume | Volume em FIAT / cripto 24h |
currentSpreadBuy / currentSpreadSell | Spreads de compra/venda configurados |
currentFeeTierRate | Taxa de serviço Liqi Crypto |
currentFeePriceBuyBrl / currentFeePriceSellBrl | Taxa Liqi em R$ |
Exemplo
const ws = new WebSocket('wss://websocket-caas-it-sandbox.liqi.app.br/');
ws.onopen = () => {
ws.send(JSON.stringify({
action: 'subscribe',
channel: 'watchTicker',
data: { symbol: 'BTC/BRL' }
}));
};
ws.onmessage = (event) => {
const { channel, message } = JSON.parse(event.data);
if (channel === 'watchTicker') {
console.log(`BTC/BRL: R$ ${message.last} (${message.percentage}%)`);
}
};