Pular para o conteúdo principal

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

CampoDescrição
symbolPar de mercado
timestampTimestamp da mensagem
high / lowMáxima e mínima das últimas 24h (R$)
bid / askMelhor preço de compra/venda com spread aplicado (R$)
bidVolume / askVolumeVolume disponível no melhor preço
open / closePreço de abertura/fechamento do dia (R$)
lastÚltimo preço negociado (R$)
change / percentageVariação absoluta e percentual 24h
averagePreço médio 24h (R$)
quoteVolume / baseVolumeVolume em FIAT / cripto 24h
currentSpreadBuy / currentSpreadSellSpreads de compra/venda configurados
currentFeeTierRateTaxa de serviço Liqi Crypto
currentFeePriceBuyBrl / currentFeePriceSellBrlTaxa 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}%)`);
}
};