Aurelia

Crypto WebSocket API

One socket for every chain and channel. Open it once, then subscribe to as many things as your plan allows.

Connect and subscribe

Open wss://app.aurelia.build/api/live with your key in the URL as apiKey, because browsers cannot set headers on a WebSocket. Each subscription has an id you choose, and every message for it carries that id.

Follow a token's trades:

const ws = new WebSocket("wss://app.aurelia.build/api/live?apiKey=<key>");
ws.onopen = () => {
  ws.send(JSON.stringify({ op: "subscribe", id: "sol", channel: "trades", chain: "solana", token: "So11111111111111111111111111111111111111112" }));
};
ws.onmessage = (e) => {
  const m = JSON.parse(e.data);
  if (m.type === "trades") for (const t of m.data) console.log(t.side, t.amount, t.priceUsd);
};

Channels

ChannelFollowsRead
tradesEvery swap of a token, a pool or a walletTrades
candlesThe bar in progress, then each bar's final valuesCandles
token, poolA token's or pool's page, and the price between updatesToken and pool
holdersA token's 100 largest holdersHolders
balances, positionsA wallet's holdings and PnLBalances and positions
pulseNew launches, curves and graduationsPulse lists

Recover from gaps

Nothing is replayed. After a resubscribed message, what was indexed during the outage was not sent: snapshot channels send their snapshot again, and for trades and candles you read the recent ones over REST and merge them.

Errors and closing

  • An error message ends that subscription only. The socket stays open.
  • 4401: the key was refused. 4402: your credits ran out, so add credit and connect again.
  • Unsubscribe with {"op":"unsubscribe","id":"sol"}. It is free.

What it costs

Opening a socket costs 1 credit, each subscription 1, and each data message 0.01. A free account gets 5 sockets of 25 subscriptions each, and a paid one 5 sockets of 100. See authentication and limits.

Related

Free to start: 10,000 credits, with no card and no subscription.

Create a free accountRead the API reference