- API Reference
- Realtime
Market Datafeed
Stream candles, trades, holders and volume for a token over the Protobuf datafeed socket, and load chart history with its RPC commands.
The market datafeed serves chart data for one token at a time: historical candles, live candles, trades, holders, volume and price change. It is a WebSocket carrying Protocol Buffers frames, with a small request/response layer on top. Its RPC commands map one to one onto the TradingView Charting Library datafeed API.
| Environment | WebSocket | HTTP base |
|---|---|---|
| Production | wss://datafeed.proxima.tools/ws | https://datafeed.proxima.tools |
| Development | wss://datafeed.proximatool.dev/ws | https://datafeed.proximatool.dev |
The HTTP base also serves symbol stats, wallet reads and token images; see Datafeed HTTP.
Framing
- Binary frames carry Protocol Buffers from package
datafeed. SetbinaryType = "arraybuffer". Every frame, in both directions, is oneWsMessagewhosepayloadholds either an RPC (rpcRequest,rpcResponse) or a server push. - Text frames are keepalive only: the server sends
ping, and you answerpong. Ignore other text frames. WsMessage.serverEmitMsis the server’s send time in epoch milliseconds. Use it to estimate push latency.
Decode with default values filled in: an unset string reads as "", an unset number as 0. The JSON on this page
shows decoded messages. The full schema is at the end of the page.
RPC
A request is a WsMessage with rpcRequest set: a fresh UUID id and exactly one command.
{ "rpcRequest": { "id": "5b2f7c1e-9a4d-4e8b-b1c3-7d6e5f4a3b2c", "resolveSymbol": { "symbol": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU" } } }The response is a WsMessage with rpcResponse set. It echoes the id and carries either a non-empty error
string or one result field.
{ "rpcResponse": { "id": "5b2f7c1e-9a4d-4e8b-b1c3-7d6e5f4a3b2c", "error": "", "symbolInfo": { "name": "MCAT", "ticker": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU" } } }| Command | Params | Result field | Purpose |
|---|---|---|---|
authenticate | { token, licenceKey } | ok | Authorize one mint on this socket. See Authentication. |
getConfig | Empty | config | Supported resolutions and capabilities (TradingView onReady). |
getServerTime | Empty | serverTime | Server clock (TradingView getServerTime). |
resolveSymbol | { symbol } | symbolInfo | Resolve a mint address to its chart symbol. |
searchSymbols | { query, exchange, type } | searchSymbols | Symbol search. |
getBars | GetBarsParams | bars | Historical candles. See History. |
subscribeBars | { symbol, resolution, subscriberUid } | ok | Start live candles. |
unsubscribeBars | { subscriberUid } | none | Stop live candles. No reply is needed. |
getTransactionsHistory | GetTransactionsHistoryParams | transactions | Trades, cursor-paginated (50 per page by default). |
getHolders | GetHoldersParams | holders | Holders, cursor-paginated (100 per page by default). |
getTimedTransactions | GetTimedTransactionsParams | transactions | Trades in a time range, for chart marks. |
getMarks | GetMarksParams | marks | Pre-built chart marks. |
Give each RPC a timeout (10 seconds works well) and fail pending RPCs when the socket closes.
RPC errors
error | Meaning |
|---|---|
unknown_symbol | The indexer has not registered this mint yet. Retry resolveSymbol for up to about 30 seconds after a launch. |
token_expired, invalid_token, unknown_kid, invalid signature | The chart token was rejected. Fetch a new one and authenticate again. |
A message containing statement timeout | Transient. Retry with backoff. |
Authentication
The datafeed authenticates per mint with a chart token issued by the REST API. Request one for the launch you
want to chart with GET /charts/{launch_id}/subscribe:
curl "https://api-mig.proxima.tools/charts/4821/subscribe" \ -H "Authorization: Bearer $PROXIMA_JWT"{ "ok": true, "chain": "sol", "mint": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "token": "<chart token>" }Then authenticate that mint on the socket. Note the British spelling of licenceKey:
{ "rpcRequest": { "id": "0d8e6f4a-2b1c-4d3e-9f8a-7b6c5d4e3f2a", "authenticate": { "token": "<chart token>", "licenceKey": "<license_key>" } } }- One socket can hold several authenticated mints at once.
- The chart token is a JWT whose payload carries
mintandexp. Renew it about 90 seconds beforeexpand sendauthenticateagain on the open socket; your subscriptions stay in place. - On EVM chains, a launch that is not deployed yet has no mint and no chart token: the request answers
404with “Token not launched yet”. Retry with backoff (1 second, doubling up to 5 seconds) until it is. Solana launches reserve their mint at creation, so they get a chart token before the launch.
History
Load a chart in four steps: getConfig, resolveSymbol { symbol: <mint> }, getBars for each page, then
subscribeBars for live updates. Use the ticker returned by resolveSymbol as symbol in the later calls.
GetBarsParams field | Type | Description |
|---|---|---|
symbol | string | The ticker from resolveSymbol. |
resolution | string | A resolution string. |
from | int64 | Range start, epoch seconds. |
to | int64 | Range end, epoch seconds. |
countBack | int32 | Number of bars wanted up to to. |
firstDataRequest | bool | true on the first page of a series. |
The result is bars: { bars: Bar[], noData: bool }. noData: true means no older data exists.
{ "rpcResponse": { "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "error": "", "bars": { "bars": [ { "time": 1762001939000, "open": 0.0000120, "high": 0.0000121, "low": 0.0000119, "close": 0.0000121, "volume": 88.0 }, { "time": 1762001940000, "open": 0.0000121, "high": 0.0000122, "low": 0.0000121, "close": 0.0000121, "volume": 35.2 } ], "noData": false } }}Bar time is passed to TradingView unchanged, which expects epoch milliseconds. Prices are in USD. Retry a failed
page a few times on transient errors; TradingView treats a failed page as the end of history.
The trades and holders tables use getTransactionsHistory and getHolders, cursor-paginated through cursor and
nextCursor; an empty nextCursor means the last page. filters is a JSON string mapping a column to
{ "=": n, "MIN": n, "MAX": n }. wallets and origins are comma-separated lists.
Resolutions
The server lists its resolutions in ConfigResult.supportedResolutions. Charts on Proxima offer:
1S, 15S, 30S, 1, 3, 5, 15, 30, 60, 240, 360, 720, 1D
These are TradingView resolution strings: a bare number is minutes, S is seconds and D is days.
Live updates
Subscribe to live candles with an opaque subscriberUid of your choice. Every bar push for that subscription
carries it back.
{ "rpcRequest": { "id": "7c6b5a49-3827-4165-9a8b-1c2d3e4f5a6b", "subscribeBars": { "symbol": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "resolution": "1S", "subscriberUid": "chart-1S" } } }Pushes are WsMessage frames without an RPC id. They concern the mints the socket has authenticated.
| Payload | Message | Description |
|---|---|---|
bar | BarUpdate | Updated candle for one subscriberUid. |
trade | TradeUpdate | A new swap on the token. Filter on mint. |
volume | VolumeUpdate | Buy and sell counts and USD volume over 5m, 1h, 4h and 24h. |
holder | HolderUpdate | One holder’s updated position. Filter on mint. |
importStatus | ImportUpdate | Progress of the historical trade import: imported, count, stillExploring. |
priceChange | PriceChangeUpdate | Price change in percent over 5m, 1h, 4h and 24h. |
resetChart | ResetChart | Drop cached bars for mint and reload history. |
txDataUpdate | TxDataUpdate | Late additionalDatas for a trade, keyed by txHash. |
Bar
{ "serverEmitMs": 1762001941212, "bar": { "subscriberUid": "chart-1S", "time": 1762001941000, "open": 0.0000121, "high": 0.0000124, "low": 0.0000121, "close": 0.0000123, "vol": 412.5 }}vol is the bar volume. To chart market cap rather than price, multiply open, high, low and close by the
token supply.
Trade
| Field | Type | Description |
|---|---|---|
txHash | string | Transaction signature or hash. |
side | string | buy or sell. |
owner | string | Trader wallet. |
mint | string | Token address. |
tokenPriceUsd | double | Token price in USD. |
volumeUsd | double | Trade size in USD. |
quoteAmount, tokenAmount | double | Amounts in whole units. |
blockUnixTime | int64 | Block time, epoch seconds. |
platform, source | string | Launchpad and swap venue. |
txIndex, innerTxIndex | int32 | Position in the block and in the transaction. |
poolId | string | Pool address. |
quotePriceUsd | double | Quote token price in USD. |
tokenDecimals, quoteDecimals | int32 | Decimals, as exponents. |
isImported | bool | Backfilled from history rather than seen live. Keep these out of live views. |
additionalDatas | string | JSON string. Its origin is autobuy, autosell, volume_bot or cleanup when the trade came from a Proxima automation. |
chain, network | string | Datafeed chain name (solana, ethereum, bsc, …) and network. |
blockNumber | int64 | Block number or slot. |
quoteAddress, quoteSymbol | string | Quote token. |
tokenReserve, quoteReserve | double | Pool reserves after the swap. |
kol | Kol | Known influencer wallet: wallet, name, logo, twitter, telegram. An empty wallet means none. |
labels | TradeLabels | Trading terminal attribution: terminal, terminalConfidence, terminalStale. |
{ "serverEmitMs": 1762001941480, "trade": { "txHash": "5h8Fq3mTzW1rVvJ6Yk2pS9cX4bN7dL3eG8aH1jK6uM2nP5qR9sT4vW7xY2zA3bC6dE8fG1hJ4kL7mN9pQ2rS5tU", "side": "buy", "owner": "9WzDXwBbmkg8ZTbNMqUxvQRAyrZzDsGYdLVL9zYtAWWM", "mint": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU", "tokenPriceUsd": 0.0000123, "volumeUsd": 18.4, "quoteAmount": 0.0982, "tokenAmount": 1495934.9, "blockUnixTime": 1762001941, "platform": "pumpfun", "source": "pumpfun", "isImported": false, "additionalDatas": "{\"origin\":\"autobuy\"}", "chain": "solana", "quoteSymbol": "SOL", "kol": null, "labels": { "terminal": "axiom", "terminalConfidence": "high", "terminalStale": false } }}Holder
HolderUpdate carries one holder’s position: addr, mint, PnL (pnlUsd, pnlQuote), remaining position
(remainingUsd, remainingToken, remainingQuote), totals bought and sold with their counts, and average buy and
sell prices in USD and in the quote token. Upsert it by addr.
Volume and price change
{ "volume": { "buyCount_5m": 22, "sellCount_5m": 9, "buyVolume_5m": 600.2, "sellVolume_5m": 240.8, "buyCount_1h": 80, "sellCount_1h": 32, "buyVolume_1h": 2201.5, "sellVolume_1h": 902.1 } }{ "priceChange": { "change_5m": 12.5, "change_1h": 48.1, "change_4h": 48.1, "change_24h": 0 } }Reconnection
- Reconnect a few seconds after the socket closes.
- On reopen, send
authenticateagain for every chart token that is still valid for at least a minute, and request new tokens for the others. - Then resend every active
subscribeBarsand reload history, since pushes sent while you were disconnected are not replayed.
Example
A minimal browser client using protobufjs. It needs the datafeed
schema below, saved as datafeed.proto next to the script.
import protobuf from "protobufjs";
const API_URL = "https://api-mig.proxima.tools";const DATAFEED_WS = "wss://datafeed.proxima.tools/ws";const SESSION_JWT = "<session JWT>";const LICENSE_KEY = "<license_key>";const LAUNCH_ID = 4821;
const root = await protobuf.load("./datafeed.proto");const WsMessage = root.lookupType("datafeed.WsMessage");const encode = (message) => WsMessage.encode(WsMessage.fromObject(message)).finish();const decode = (buffer) => WsMessage.toObject(WsMessage.decode(new Uint8Array(buffer)), { longs: Number, defaults: true });
const pending = new Map();const ws = new WebSocket(DATAFEED_WS);ws.binaryType = "arraybuffer";
function rpc(command, params = {}) { const id = crypto.randomUUID(); ws.send(encode({ rpcRequest: { id, [command]: params } })); return new Promise((resolve, reject) => { const timer = setTimeout(() => { pending.delete(id); reject(new Error("rpc timeout")); }, 10_000); pending.set(id, { resolve, reject, timer }); });}
ws.onmessage = ({ data }) => { if (typeof data === "string") { if (data === "ping") ws.send("pong"); return; } const message = decode(data); if (message.rpcResponse) { const { id, error, ...result } = message.rpcResponse; const call = pending.get(id); if (!call) return; pending.delete(id); clearTimeout(call.timer); if (error) return call.reject(new Error(error)); return call.resolve(result.symbolInfo ?? result.bars ?? result.ok ?? result.transactions ?? result.holders ?? null); } if (message.bar) console.log("bar", message.bar.time, message.bar.close); if (message.trade && !message.trade.isImported) console.log("trade", message.trade.side, message.trade.volumeUsd);};
ws.onopen = async () => { const response = await fetch(`${API_URL}/charts/${LAUNCH_ID}/subscribe`, { headers: { Authorization: `Bearer ${SESSION_JWT}` }, }); const { token, mint } = await response.json(); await rpc("authenticate", { token, licenceKey: LICENSE_KEY });
const info = await rpc("resolveSymbol", { symbol: mint }); const now = Math.floor(Date.now() / 1000); const { bars, noData } = await rpc("getBars", { symbol: info.ticker, resolution: "1S", from: now - 300, to: now, countBack: 300, firstDataRequest: true, }); console.log(`${bars.length} bars, noData=${noData}`);
await rpc("subscribeBars", { symbol: info.ticker, resolution: "1S", subscriberUid: "chart-1S" });};Schema
Field names and numbers are exact.
syntax = "proto3";package datafeed;
message WsMessage { oneof payload { RpcRequest rpcRequest = 1; RpcResponse rpcResponse = 2; BarUpdate bar = 10; TradeUpdate trade = 11; VolumeUpdate volume = 12; HolderUpdate holder = 13; ImportUpdate importStatus = 14; PriceChangeUpdate priceChange = 15; ResetChart resetChart = 16; TxDataUpdate txDataUpdate = 17; } int64 serverEmitMs = 30;}
message RpcRequest { string id = 1; oneof cmd { Empty getConfig = 10; Empty getServerTime = 11; SearchSymbolsParams searchSymbols = 12; ResolveSymbolParams resolveSymbol = 13; GetBarsParams getBars = 14; SubscribeBarsParams subscribeBars = 15; UnsubscribeBarsParams unsubscribeBars = 16; AuthenticateParams authenticate = 17; GetTransactionsHistoryParams getTransactionsHistory = 18; GetHoldersParams getHolders = 19; GetMarksParams getMarks = 20; GetTimedTransactionsParams getTimedTransactions = 21; }}
message RpcResponse { string id = 1; string error = 2; oneof result { ConfigResult config = 10; ServerTimeResult serverTime = 11; SearchSymbolsResult searchSymbols = 12; SymbolInfoResult symbolInfo = 13; GetBarsResult bars = 14; OkResult ok = 15; TransactionsResult transactions = 16; HoldersResult holders = 17; MarksResult marks = 18; }}
message Empty {}message SearchSymbolsParams { string query = 1; string exchange = 2; string type = 3; }message ResolveSymbolParams { string symbol = 1; }message GetBarsParams { string symbol = 1; string resolution = 2; int64 from = 3; int64 to = 4; int32 countBack = 5; bool firstDataRequest = 6; }message SubscribeBarsParams { string symbol = 1; string resolution = 2; string subscriberUid = 3; }message UnsubscribeBarsParams { string subscriberUid = 1; }message AuthenticateParams { string token = 1; string licenceKey = 2; }
message GetTransactionsHistoryParams { string mint = 1; string wallet = 2; string wallets = 3; string cursor = 4; int32 perPage = 5; string search = 6; string sortBy = 7; string sortOrder = 8; string filters = 9; bool kolOnly = 10; string origins = 11; bool includeUntagged = 12;}message GetTimedTransactionsParams { string mint = 1; string wallet = 2; string wallets = 3; string search = 4; string sortBy = 5; string sortOrder = 6; string filters = 7; bool kolOnly = 8; int64 from = 9; int64 to = 10; string origins = 11; bool includeUntagged = 12;}message GetHoldersParams { string mint = 1; string addr = 2; string wallets = 3; string sortBy = 4; string sortOrder = 5; string cursor = 6; int32 perPage = 7; string filters = 8; bool kolOnly = 9;}message GetMarksParams { string symbol = 1; int64 from = 2; int64 to = 3; string resolution = 4; double supply = 5; string wallets = 6; string disabledOrigins = 7; bool rawFormat = 8; string trackedWallets = 9;}
message Kol { string wallet = 1; string name = 2; string logo = 3; string twitter = 4; string telegram = 5; }message TradeLabels { string terminal = 8; string terminalConfidence = 9; bool terminalStale = 11; }message LiquidityPool { string source = 1; }
message ConfigResult { repeated string supportedResolutions = 1; bool supportsSearch = 2; bool supportsTime = 3; bool supportsMarks = 4; bool supportsTimescaleMarks = 5; repeated Exchange exchanges = 6; repeated SymbolType symbolsTypes = 7; int32 symbolSearchRequestDelay = 8;}message Exchange { string value = 1; string name = 2; string desc = 3; }message SymbolType { string name = 1; string value = 2; }message ServerTimeResult { int64 time = 1; }message SearchSymbolsResult { repeated SearchResultItem items = 1; }message SearchResultItem { string symbol = 1; string description = 2; string exchange = 3; string ticker = 4; string type = 5; }
message SymbolInfoResult { string name = 1; string ticker = 2; string description = 3; string type = 4; string exchange = 5; string listedExchange = 6; string session = 7; string timezone = 8; int32 minmov = 9; int64 pricescale = 10; string format = 11; string currencyCode = 12; bool hasIntraday = 13; bool hasSeconds = 14; bool hasDaily = 15; bool hasWeeklyAndMonthly = 16; bool hasEmptyBars = 17; repeated string secondsMultipliers = 18; repeated string intradayMultipliers = 19; repeated string supportedResolutions = 20; string visiblePlotsSet = 21; int32 volumePrecision = 22; string dataStatus = 23;}
message GetBarsResult { repeated Bar bars = 1; bool noData = 2; }message Bar { int64 time = 1; double open = 2; double high = 3; double low = 4; double close = 5; double volume = 6; }message OkResult { bool ok = 1; }
message TransactionsResult { repeated TransactionRow data = 1; int64 total = 2; int32 perPage = 3; string nextCursor = 4; }message TransactionRow { string ts = 1; string signature = 2; int64 blockNumber = 3; int64 txIndex = 4; string mint = 5; string owner = 6; string side = 7; string platform = 8; string source = 9; string poolId = 10; string chain = 11; double tokenAmount = 12; int32 tokenDecimals = 13; double tokenPriceUsd = 14; double quoteAmount = 15; double quotePriceUsd = 16; string quoteAddress = 17; string quoteSymbol = 18; int32 quoteDecimals = 19; double volumeUsd = 20; double tokenReserve = 21; double quoteReserve = 22; int64 blockTime = 23; string additionalDatas = 24; Kol kol = 25; int64 innerTxIndex = 27; TradeLabels labels = 28;}
message HoldersResult { repeated HolderRow data = 1; int64 total = 2; int32 perPage = 3; string nextCursor = 4; }message HolderRow { string addr = 1; double pnlUsd = 2; double pnlQuote = 3; double remainingUsd = 4; double remainingToken = 5; double remainingQuote = 6; double totalBoughtUsd = 7; double totalBoughtToken = 8; double totalBoughtQuote = 9; int64 buyCount = 10; double totalSoldUsd = 11; double totalSoldToken = 12; double totalSoldQuote = 13; int64 sellCount = 14; double avgBuyPriceQuote = 15; double avgBuyPriceUsd = 16; double avgSoldPriceQuote = 17; double avgSoldPriceUsd = 18; Kol kol = 19; LiquidityPool pool = 25;}
message MarksResult { repeated Mark marks = 1; }message Mark { int64 id = 1; int64 time = 2; string color = 3; string text = 4; string label = 5; string labelFontColor = 6; int32 minSize = 7; string imageUrl = 8; string backgroundColor = 9; string origin = 10; bool nuke = 11; string owner = 12; string signature = 13; TransactionRow dataTx = 14;}
message BarUpdate { string subscriberUid = 1; int64 time = 2; double open = 3; double high = 4; double low = 5; double close = 6; double vol = 7; }
message TradeUpdate { string txHash = 1; string side = 2; string owner = 3; string mint = 4; double tokenPriceUsd = 5; double volumeUsd = 6; double quoteAmount = 7; double tokenAmount = 8; int64 blockUnixTime = 9; string platform = 10; string source = 11; int32 txIndex = 12; int32 innerTxIndex = 13; string poolId = 14; double quotePriceUsd = 15; int32 tokenDecimals = 16; bool isImported = 17; string additionalDatas = 18; string chain = 19; string network = 20; int64 blockNumber = 21; string quoteAddress = 22; string quoteSymbol = 23; int32 quoteDecimals = 24; double tokenReserve = 25; double quoteReserve = 26; Kol kol = 27; TradeLabels labels = 32;}
message VolumeUpdate { int64 buyCount_5m = 1; int64 sellCount_5m = 2; double buyVolume_5m = 3; double sellVolume_5m = 4; int64 buyCount_1h = 5; int64 sellCount_1h = 6; double buyVolume_1h = 7; double sellVolume_1h = 8; int64 buyCount_4h = 9; int64 sellCount_4h = 10; double buyVolume_4h = 11; double sellVolume_4h = 12; int64 buyCount_24h = 13; int64 sellCount_24h = 14; double buyVolume_24h = 15; double sellVolume_24h = 16;}
message HolderUpdate { string addr = 1; string mint = 2; double pnlUsd = 3; double pnlQuote = 4; double remainingUsd = 5; double remainingToken = 6; double remainingQuote = 7; double totalBoughtUsd = 8; double totalBoughtToken = 9; double totalBoughtQuote = 10; int64 buyCount = 11; double totalSoldUsd = 12; double totalSoldToken = 13; double totalSoldQuote = 14; int64 sellCount = 15; double avgBuyPriceQuote = 16; double avgBuyPriceUsd = 17; double avgSoldPriceQuote = 18; double avgSoldPriceUsd = 19;}
message ImportUpdate { int64 imported = 1; int64 count = 2; bool stillExploring = 3; }message PriceChangeUpdate { double change_5m = 1; double change_1h = 2; double change_4h = 3; double change_24h = 4; }message ResetChart { string mint = 1; }message TxDataUpdate { string txHash = 1; string additionalDatas = 2; }