{"openapi":"3.1.0","info":{"title":"Rocket Indexer API Documentation","description":"Welcome to the RocketChain Indexer API documentation!\n\nThe indexer REST API serves historical and aggregated market data from ClickHouse. Endpoints cover candles, trades, order history, portfolio curves, funding events, bridge events, vault events, current/historical instruments, and live instrument details.","license":{"name":"MIT","url":"https://github.com/rocketfoundation/rocket-sdk-rust/blob/main/LICENSE","identifier":"MIT"},"version":"1.0","x-logo":{"altText":"ROCKET","backgroundColor":"#00000000","url":"https://www.rocketfoundation.io/assets/rocket-logo.svg"}},"paths":{"/":{"get":{"tags":["Indexer REST-API"],"summary":"Ping","description":"Ping endpoint, can be used for connectivity testing.","operationId":"ping","responses":{"200":{"description":"Ping response","content":{"text/plain":{"schema":{"type":"string"},"example":"pong"}}}}}},"/bridge-events":{"get":{"tags":["Indexer REST-API"],"summary":"Get bridge events","description":"Paginated bridge deposit and withdrawal events.","operationId":"getBridgeEvents","parameters":[{"name":"account","in":"path","description":"Optional account address filter.","required":true,"schema":{"type":"string","format":"hex"},"example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"},{"name":"roundFrom","in":"path","description":"Optional start round (inclusive). If provided, `roundTo` should also be provided.","required":true,"schema":{"type":["string","null"]},"example":1000},{"name":"roundTo","in":"path","description":"Optional end round (inclusive). If provided, `roundFrom` should also be provided.","required":true,"schema":{"type":["string","null"]},"example":1100},{"name":"pageNumber","in":"path","description":"Zero-based page number.\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":0},"example":0},{"name":"pageSize","in":"path","description":"Page size (number of items per page).\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":2000},"example":100}],"responses":{"200":{"description":"Bridge events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetBridgeEventsResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/candles":{"get":{"tags":["Indexer REST-API"],"summary":"Get candles","description":"OHLCV candles for an instrument over a time range.","operationId":"getCandles","parameters":[{"name":"instrumentId","in":"path","description":"Instrument ID to fetch candles for.","required":true,"schema":{"$ref":"#/components/schemas/InstrumentId"},"example":"0x85d55cb42a3e6b50"},{"name":"interval","in":"path","description":"Candle timeframe (1m, 5m, 15m, 30m, 1h, 4h, 1d).","required":true,"schema":{"$ref":"#/components/schemas/CandleTimeframe"},"example":"1h"},{"name":"startTime","in":"path","description":"Start timestamp in milliseconds (optional, defaults to 24h ago).","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":1710000000000},{"name":"endTime","in":"path","description":"End timestamp in milliseconds (optional, defaults to now).","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":1710086400000},{"name":"limit","in":"path","description":"Maximum number of candles to return (optional, defaults to 500, max 1000).","required":true,"schema":{"type":["integer","null"],"default":500,"minimum":0},"example":500}],"responses":{"200":{"description":"Candles","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetCandlesResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/funding-rate-events":{"get":{"tags":["Indexer REST-API"],"summary":"Get funding rate events","description":"Paginated funding rate events for an instrument.","operationId":"getFundingRateEvents","parameters":[{"name":"instrumentId","in":"path","description":"Instrument id (hex string, `0x...`).","required":true,"schema":{"$ref":"#/components/schemas/InstrumentId"},"example":"0x85d55cb42a3e6b50"},{"name":"startRound","in":"path","description":"Optional start round (inclusive).","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":1000},{"name":"endRound","in":"path","description":"Optional end round (inclusive).","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":1100},{"name":"page_number","in":"path","description":"Zero-based page number.\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":0},"example":0},{"name":"page_size","in":"path","description":"Page size (number of items per page).\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":2000},"example":100}],"responses":{"200":{"description":"Funding rate events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetFundingRateEventsResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/instrument-details":{"get":{"tags":["Indexer REST-API"],"summary":"Get instrument details","description":"Live 24h traded volume and quote price change for one or all indexed instruments. When `instrumentId` is omitted, the result set can be narrowed with the same `contractType` / `expiry` / `underlyingAsset` filters as the `/instruments` endpoint.","operationId":"getInstrumentDetails","parameters":[{"name":"instrumentId","in":"path","description":"Instrument ID to fetch details for. When omitted, returns all indexed instruments\n(optionally narrowed by `contractType` / `expiry` / `underlyingAsset`). Cannot be\ncombined with those filters.","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/InstrumentId"}]},"example":"0x85d55cb42a3e6b50"},{"name":"contractType","in":"path","description":"Optional contract type filter (comma-separated). Accepted values\n(case-insensitive): `option`, `future`, `perp`, `spot`. Ignored (and rejected)\nwhen `instrumentId` is set.","required":true,"schema":{"type":"string"},"example":"perp,option"},{"name":"expiry","in":"path","description":"Optional expiry filter. Matches the instrument's formatted expiry (e.g. `28MAR25`).\nIgnored (and rejected) when `instrumentId` is set.","required":true,"schema":{"type":["string","null"]},"example":"28MAR25"},{"name":"underlyingAsset","in":"path","description":"Optional underlying asset ticker filter (e.g. `BTC`). Case-insensitive.\nIgnored (and rejected) when `instrumentId` is set.","required":true,"schema":{"type":["string","null"]},"example":"BTC"}],"responses":{"200":{"description":"Instrument details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetInstrumentDetailsResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/instruments":{"get":{"tags":["Indexer REST-API"],"summary":"Get instruments","description":"Current and historical instruments from the indexer `instruments` table, with the same `contractType` / `expiry` / `underlyingAsset` filters as the core-chain `/instruments` endpoint.","operationId":"getIndexedInstruments","parameters":[{"name":"pageNumber","in":"path","description":"Zero-based page number.\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":0},"example":0},{"name":"pageSize","in":"path","description":"Page size (number of items per page).\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":2000},"example":100},{"name":"contractType","in":"path","description":"Optional contract type filter (comma-separated). Accepted values\n(case-insensitive): `option`, `future`, `perp`, `spot`.","required":true,"schema":{"type":"string"},"example":"perp,option"},{"name":"expiry","in":"path","description":"Optional expiry filter. Matches the instrument's formatted expiry (e.g. `28MAR25`).","required":true,"schema":{"type":["string","null"]},"example":"28MAR25"},{"name":"underlyingAsset","in":"path","description":"Optional underlying asset ticker filter (e.g. `BTC`). Case-insensitive.","required":true,"schema":{"type":["string","null"]},"example":"BTC"}],"responses":{"200":{"description":"Instruments","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetIndexedInstrumentsResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/leaderboard":{"get":{"tags":["Indexer REST-API"],"summary":"Get user leaderboard","description":"Users ranked by equity change net of deposits, withdrawals, and vault flows, matching portfolio PnL. Volume is fill notional over the same range. When startTime is set, only accounts that filled in the window are ranked (open positions with no new trades are excluded). Omitting startTime/endTime (or passing 0) uses all available history, matching portfolio from=0/to=0.","operationId":"getLeaderboard","parameters":[{"name":"startTime","in":"path","description":"Start timestamp in milliseconds (optional). Omit or pass 0 for all available history.\nWhen set, only accounts with fills in `[startTime, endTime]` are ranked.","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":0},{"name":"endTime","in":"path","description":"End timestamp in milliseconds (optional). Omit or pass 0 for the latest available data.","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":1710086400000},{"name":"count","in":"path","description":"Maximum number of users to return (optional, defaults to 100, max 1000).","required":true,"schema":{"type":["integer","null"],"default":100,"minimum":0},"example":100},{"name":"metric","in":"path","description":"Ranking metric. `pnl` orders by portfolio PnL (equity change net of cash flows); `volume` orders by fill notional.","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/LeaderboardMetric"}],"default":"pnl"},"example":"pnl"},{"name":"account","in":"path","description":"Optional account whose leaderboard position should be returned even if outside `count`.","required":true,"schema":{"type":"string","format":"hex"},"example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"}],"responses":{"200":{"description":"Leaderboard","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetLeaderboardResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/order-history":{"get":{"tags":["Indexer REST-API"],"summary":"Get order history","description":"Non-fill order events for an account over a time range.","operationId":"getOrderHistory","parameters":[{"name":"account","in":"path","description":"Account address (hex-encoded, `0x...`).","required":true,"schema":{"type":"string","format":"hex"},"example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"},{"name":"startTime","in":"path","description":"Start timestamp in milliseconds (optional, defaults to 24h ago).","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":1710000000000},{"name":"endTime","in":"path","description":"End timestamp in milliseconds (optional, defaults to now).","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":1710086400000},{"name":"limit","in":"path","description":"Maximum number of order events to return (optional, defaults to 500, max 1000).","required":true,"schema":{"type":["integer","null"],"default":500,"minimum":0},"example":500}],"responses":{"200":{"description":"Order history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetOrderHistoryResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/portfolio":{"get":{"tags":["Indexer REST-API"],"summary":"Get portfolio","description":"Equity and PnL curves for an account over a time range.","operationId":"getPortfolio","parameters":[{"name":"account","in":"path","required":true,"schema":{"type":"string","format":"hex"},"example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"},{"name":"from","in":"path","description":"Start timestamp in milliseconds (inclusive). Use 0 for all available history.","required":true,"schema":{"$ref":"#/components/schemas/u64"},"example":0},{"name":"to","in":"path","description":"End timestamp in milliseconds (inclusive). Use 0 for the latest available snapshot.","required":true,"schema":{"$ref":"#/components/schemas/u64"},"example":1710086400000},{"name":"interval","in":"path","description":"Aggregation interval for the portfolio curves.","required":true,"schema":{"$ref":"#/components/schemas/CandleTimeframe"},"example":"1h"}],"responses":{"200":{"description":"Portfolio curves","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPortfolioResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/position-funding-events":{"get":{"tags":["Indexer REST-API"],"summary":"Get position funding events","description":"Paginated position funding payment events for an account.","operationId":"getPositionFundingEvents","parameters":[{"name":"account","in":"path","description":"Account address (hex-encoded, `0x...`).","required":true,"schema":{"type":"string","format":"hex"},"example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"},{"name":"pageNumber","in":"path","description":"Zero-based page number.\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":0},"example":0},{"name":"pageSize","in":"path","description":"Page size (number of items per page).\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":2000},"example":100}],"responses":{"200":{"description":"Position funding events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetPositionFundingEventsResponse"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/trades":{"get":{"tags":["Indexer REST-API"],"summary":"Get trades","description":"Fill events for an account and/or instrument. Use `startTime`/`endTime` with `limit`, or use `count` with optional `cursor` for latest-trades pagination. At least one of `account` or `instrument` is required.","operationId":"getTrades","parameters":[{"name":"account","in":"path","description":"Account address (hex-encoded, `0x...`). Required if `instrument` is not provided.","required":true,"schema":{"type":"string","format":"hex"},"example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"},{"name":"instrument","in":"path","description":"Instrument id (hex string, `0x...`). Required if `account` is not provided.","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/InstrumentId"}]},"example":"0x85d55cb42a3e6b50"},{"name":"startTime","in":"path","description":"Start timestamp in milliseconds (optional, defaults to 24h ago).","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":1710000000000},{"name":"endTime","in":"path","description":"End timestamp in milliseconds (optional, defaults to now).","required":true,"schema":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"example":1710086400000},{"name":"limit","in":"path","description":"Maximum number of trades to return (optional, defaults to 500, max 1000).","required":true,"schema":{"type":["integer","null"],"default":500,"minimum":0},"example":500},{"name":"count","in":"path","description":"Alternative to `startTime`/`endTime`: number of latest trades per page (max 100).","required":true,"schema":{"type":["integer","null"],"maximum":100,"minimum":0},"example":50},{"name":"cursor","in":"path","description":"Opaque cursor returned by the previous `count` mode response.","required":true,"schema":{"type":["string","null"]},"example":"eyJ0aW1lc3RhbXAiOjE3NzQzNjgxMDc1OTAsInJvdW5kIjoyOTA4MzQwMSwidHhJbmRleCI6MCwiZXZlbnRJbmRleCI6MCwiZXZlbnRJZCI6IjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAifQ"}],"responses":{"200":{"description":"Trades","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetTradesResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/vault-events":{"get":{"tags":["Indexer REST-API"],"summary":"Get vault events","description":"Paginated vault deposit and withdrawal events.","operationId":"getVaultEvents","parameters":[{"name":"vault","in":"path","description":"Optional vault address filter.","required":true,"schema":{"type":"string","format":"hex"},"example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"},{"name":"account","in":"path","description":"Optional account address filter.","required":true,"schema":{"type":"string","format":"hex"},"example":"0xd6963dda208f0f36acd13cce5bbc26720c8b612f"},{"name":"roundFrom","in":"path","description":"Optional start round (inclusive). If provided, `roundTo` should also be provided.","required":true,"schema":{"type":["string","null"]},"example":1000},{"name":"roundTo","in":"path","description":"Optional end round (inclusive). If provided, `roundFrom` should also be provided.","required":true,"schema":{"type":["string","null"]},"example":1100},{"name":"pageNumber","in":"path","description":"Zero-based page number.\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":0},"example":0},{"name":"pageSize","in":"path","description":"Page size (number of items per page).\nAccepts either a number or a numeric string.","required":true,"schema":{"oneOf":[{"$ref":"#/components/schemas/usize"}],"default":2000},"example":100}],"responses":{"200":{"description":"Vault events","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVaultEventsResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/vault-history":{"get":{"tags":["Indexer REST-API"],"summary":"Get vault history","description":"Vault return curve, NAV curve, TVL curve, and annualized APR for an account over a time range.","operationId":"getVaultHistory","parameters":[{"name":"address","in":"path","description":"Account address.","required":true,"schema":{"type":"string","format":"hex"},"example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"},{"name":"from","in":"path","description":"Start timestamp in milliseconds (inclusive). Use 0 for all available history.","required":true,"schema":{"$ref":"#/components/schemas/u64"},"example":0},{"name":"to","in":"path","description":"End timestamp in milliseconds (inclusive). Use 0 for the latest available snapshot.","required":true,"schema":{"$ref":"#/components/schemas/u64"},"example":1710086400000},{"name":"interval","in":"path","description":"Aggregation interval for the return and NAV curves.","required":true,"schema":{"$ref":"#/components/schemas/CandleTimeframe"},"example":"1d"}],"responses":{"200":{"description":"Vault history","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVaultHistoryResponse"}}}},"400":{"description":"Invalid query parameters","content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/vault-portfolio":{"get":{"tags":["Indexer REST-API"],"summary":"Get vault portfolio","description":"Current vault share positions and PnL for an account.","operationId":"getVaultPortfolio","parameters":[{"name":"account","in":"path","description":"Account address whose vault positions should be returned.","required":true,"schema":{"type":"string","format":"hex"},"example":"0xd6963dda208f0f36acd13cce5bbc26720c8b612f"},{"name":"vault","in":"path","description":"Optional vault address filter.","required":true,"schema":{"type":"string","format":"hex"},"example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"}],"responses":{"200":{"description":"Vault portfolio","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetVaultPortfolioResponse"}}}},"500":{"description":"Internal server error","content":{"text/plain":{"schema":{"type":"string"}}}}}}}},"components":{"schemas":{"AccountAddress":{"type":"string","format":"hex","description":"An Ethereum-style account address (20 bytes).","example":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"},"BridgeEventClientView":{"type":"object","required":["round","timestamp","accountAddress","externalAddress","externalTokenAddress","id","amount","eventType"],"properties":{"accountAddress":{"$ref":"#/components/schemas/AccountAddress"},"amount":{"type":"string"},"eventType":{"$ref":"#/components/schemas/BridgeEventType"},"externalAddress":{"type":"string"},"externalTokenAddress":{"type":"string"},"id":{"type":"integer","format":"int64","minimum":0},"round":{"type":"integer","format":"int64","minimum":0},"timestamp":{"$ref":"#/components/schemas/u64"}}},"BridgeEventType":{"type":"string","enum":["Deposit","Withdraw"]},"BridgeEventsSetClientView":{"type":"array","items":{"$ref":"#/components/schemas/BridgeEventClientView"}},"CandleResponseItem":{"type":"object","required":["slot","timestamp","open","high","low","close","volume"],"properties":{"close":{"type":"number","format":"float"},"high":{"type":"number","format":"float"},"low":{"type":"number","format":"float"},"open":{"type":"number","format":"float"},"slot":{"type":"integer","format":"int64","minimum":0},"timestamp":{"$ref":"#/components/schemas/u64"},"volume":{"type":"number","format":"float"}}},"CandleTimeframe":{"type":"string","description":"Candle timeframe/interval for aggregation","enum":["1m","5m","15m","30m","1h","4h","1d"],"example":"1h"},"FundingRateView":{"type":"object","required":["fundingRate","premiumIndex","timestamp","round"],"properties":{"fundingRate":{"type":"string"},"premiumIndex":{"type":"string"},"round":{"type":"integer","format":"int64","minimum":0},"timestamp":{"$ref":"#/components/schemas/u64"}}},"GetBridgeEventsResponse":{"type":"object","required":["events"],"properties":{"events":{"$ref":"#/components/schemas/BridgeEventsSetClientView","description":"Bridge events returned for the selected account or round range."}},"examples":[{"events":[{"accountAddress":"0xD6963Dda208f0f36acd13ccE5bbC26720c8b612f","amount":"5","eventType":"Deposit","externalAddress":"0xD6963Dda208f0f36acd13ccE5bbC26720c8b612f","externalTokenAddress":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","id":2,"round":4263425,"timestamp":1771860706130},{"accountAddress":"0x5ff593a3eeb56A7F9aB082A2009686a12d1f8894","amount":"53.64","eventType":"Deposit","externalAddress":"0x5ff593a3eeb56A7F9aB082A2009686a12d1f8894","externalTokenAddress":"0xaf88d065e77c8cC2239327C5EDb3A432268e5831","id":1,"round":10576897,"timestamp":1772497183113}]}]},"GetCandlesResponse":{"type":"object","required":["candles"],"properties":{"candles":{"type":"array","items":{"$ref":"#/components/schemas/CandleResponseItem"},"description":"OHLCV candles for the requested time range."}},"examples":[{"candles":[{"close":89.775,"high":89.849,"low":89.701,"open":89.701,"slot":29572677,"timestamp":1774360620000,"volume":0.5},{"close":89.646,"high":89.775,"low":89.646,"open":89.775,"slot":29572678,"timestamp":1774360680000,"volume":0.5}]}]},"GetFundingRateEventsResponse":{"type":"object","required":["events","pageNumber","pageSize"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/FundingRateView"},"description":"Funding rate events for the requested instrument."},"pageNumber":{"$ref":"#/components/schemas/usize","description":"Zero-based page number."},"pageSize":{"$ref":"#/components/schemas/usize","description":"Page size (max items per page)."}},"examples":[{"events":[{"fundingRate":"0.00001","premiumIndex":"0","round":29083401,"timestamp":1774364400000},{"fundingRate":"0.00001","premiumIndex":"0","round":29047719,"timestamp":1774360800000}],"pageNumber":0,"pageSize":100}]},"GetIndexedInstrumentsResponse":{"type":"object","required":["instruments"],"properties":{"instruments":{"$ref":"#/components/schemas/InstrumentsSetView","description":"Current and historical instruments from the indexer `instruments` table."}},"examples":[{"instruments":{"0x95988da831a730b5":{"expiry":null,"id":"0x95988da831a730b5","instrumentType":"PERP","isTrading":false,"lastMatchPrice":"0","listedAt":1771992000000,"priceScale":10,"quantityScale":10000,"settlementAsset":"USDC","strike":null,"ticker":"PERP_ETH_USDC","underlyingAsset":"ETH"}}}]},"GetInstrumentDetailsResponse":{"type":"object","required":["instruments"],"properties":{"instruments":{"type":"array","items":{"$ref":"#/components/schemas/InstrumentDetailsResponseItem"},"description":"Live 24h volume and price change for the requested instrument(s)."}},"examples":[{"instruments":[{"change24hr":"1.23","instrumentId":"0x85d55cb42a3e6b50","quoteVolume":"1121.2625","tradeCount":42,"volume24hr":"12.5"}]}]},"GetLeaderboardResponse":{"type":"object","required":["leaderboard"],"properties":{"accountPosition":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/LeaderboardPositionResponseItem","description":"Requested account's 1-based leaderboard position, if `account` was provided and ranked."}]},"leaderboard":{"type":"array","items":{"$ref":"#/components/schemas/LeaderboardResponseItem"},"description":"Users ranked by portfolio PnL (equity change net of deposits, withdrawals, and vault flows) and fill notional over the requested time range."}},"examples":[{"leaderboard":[{"pnl":"12.34","user":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b","volume":"1000.25"}]}]},"GetOrderHistoryResponse":{"type":"object","required":["orderHistory"],"properties":{"orderHistory":{"type":"array","items":{"$ref":"#/components/schemas/OrderHistoryResponseItem"},"description":"Non-fill order events for the requested account."}},"examples":[{"orderHistory":[{"account":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b","eventIndex":0,"eventType":"placed","feeAmount":"0","feeRate":"0","instrument":"0x85d55cb42a3e6b50","isAdl":false,"isLiquidation":false,"isPassive":true,"orderId":989078,"pnl":"0","price":"89.701","round":29083401,"settlementAsset":0,"size":"0.5","timestamp":1774368107590,"txIndex":0}]}]},"GetPortfolioResponse":{"type":"object","required":["equity","pnl","summary"],"properties":{"equity":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioCurvePoint"},"description":"Equity curve sampled from account snapshots."},"pnl":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioCurvePoint"},"description":"PnL curve derived from equity, net of bridge and vault cash flows."},"summary":{"$ref":"#/components/schemas/PortfolioSummary","description":"Aggregate portfolio metrics for the requested range."}},"examples":[{"equity":[{"timestamp":1774360800000,"value":"1000.00"}],"pnl":[{"timestamp":1774360800000,"value":"0"}],"summary":{"averageLoss":"-3.1","averageWin":"3.1","avgDailyPnl":"1.2%","longPnl":"4.20","losses":"10","maxDrawdownPct":"12.00%","pnl":"13.21","pnlVolatilityPct":"18.00%","pnlVolatilityUsd":"180.00","profitFactor":"1.2","returnPct":"2.00%","sharpeRatio":"1.2","shortPnl":"3.2","totalFunding":"1.20","totalTrades":7,"volume":"21.21","winRate":"1.4","wins":"14"}}]},"GetPositionFundingEventsResponse":{"type":"object","required":["pageNumber","pageSize"],"properties":{"events":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/PositionFundingEventsClientViewSet","description":"Position funding events (may be `null` on error)."}]},"pageNumber":{"$ref":"#/components/schemas/usize","description":"Zero-based page number."},"pageSize":{"$ref":"#/components/schemas/usize","description":"Page size (max items per page)."}},"examples":[{"events":[{"account":"0x6BC2179a284CB2A2857C379391E0158524de7cA0","fundingRate":"0.000066","instrumentId":"0xec37e578de46724d","instrumentMarkPrice":"175.40","pnl":"0","positionQuantity":"-0.37","round":29119089,"timestamp":1774368000000}],"pageNumber":0,"pageSize":100}]},"GetTradesResponse":{"type":"object","required":["trades"],"properties":{"count":{"type":["integer","null"],"description":"Number of trades requested per page when `count` pagination mode is used.","example":50,"minimum":0},"nextCursor":{"type":["string","null"],"description":"Cursor for the next page when `count` pagination mode is used.","example":"eyJ0aW1lc3RhbXAiOjE3NzQzNjgxMDc1OTAsInJvdW5kIjoyOTA4MzQwMSwidHhJbmRleCI6MCwiZXZlbnRJbmRleCI6MCwiZXZlbnRJZCI6IjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAifQ"},"trades":{"type":"array","items":{"$ref":"#/components/schemas/TradeResponseItem"},"description":"Fill events for the requested account and/or instrument."}},"examples":[{"trades":[{"account":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b","eventIndex":0,"feeAmount":"0","feeRate":"0","instrument":"0x85d55cb42a3e6b50","isAdl":false,"isLiquidation":false,"isPassive":true,"orderId":989078,"pnl":"0","price":"89.701","round":29083401,"settlementAsset":0,"size":"0.5","ticker":"PERP_ETH_USDC","timestamp":1774368107590,"txIndex":0}]}]},"GetVaultEventsResponse":{"type":"object","required":["events","pageNumber","pageSize"],"properties":{"events":{"type":"array","items":{"$ref":"#/components/schemas/VaultEventResponseItem"},"description":"Vault events returned for the selected filters."},"pageNumber":{"$ref":"#/components/schemas/usize","description":"Zero-based page number."},"pageSize":{"$ref":"#/components/schemas/usize","description":"Page size (max items per page)."}},"examples":[{"events":[{"account":"0xd6963dda208f0f36acd13cce5bbc26720c8b612f","amount":"5000","assetId":0,"eventIndex":0,"eventType":"deposit","round":29083401,"shares":"500000","timestamp":1774368107590,"txHash":"0x0000000000000000000000000000000000000000000000000000000000000000","txIndex":0,"vault":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b"}],"pageNumber":0,"pageSize":100}]},"GetVaultHistoryResponse":{"type":"object","description":"Response containing vault returns, NAV, TVL, annualized APR, and summary stats.","required":["returns","nav","tvl","apr","vaultStats"],"properties":{"apr":{"type":"string","description":"Annualized percentage return as a decimal string."},"nav":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioCurvePoint"},"description":"Per-share NAV curve normalized to 1.0 at the vault's first positive NAV."},"returns":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioCurvePoint"},"description":"Return curve derived from vault account equity snapshots."},"tvl":{"type":"array","items":{"$ref":"#/components/schemas/PortfolioCurvePoint"},"description":"TVL curve derived from vault account equity snapshots."},"vaultStats":{"$ref":"#/components/schemas/VaultStats","description":"Summary stats derived from the per-share NAV returns over the requested range."}},"examples":[{"apr":"0.438","nav":[{"timestamp":1774360800000,"value":"1.25"}],"returns":[{"timestamp":1774360800000,"value":"0.0012"}],"tvl":[{"timestamp":1774360800000,"value":"1250000.42"}],"vaultStats":{"averageReturns":"0.0012","maxDrawdown":"0.031","returnsVolatility":"0.0042","sharpeRatio":"1.2"}}]},"GetVaultPortfolioResponse":{"type":"object","required":["positions"],"properties":{"positions":{"type":"array","items":{"$ref":"#/components/schemas/VaultPortfolioPosition"},"description":"Current vault positions for the requested account."}},"examples":[{"positions":[{"deposits":"5000","pnl":"1000","shares":"500000","totalShares":"1000000","value":"6000","vault":"0xf19e16fe3cf25c630f55f66d6c6cbf64f84fc86b","vaultEquity":"12000","withdrawals":"0"}]}]},"InstrumentDetailsResponseItem":{"type":"object","required":["instrumentId","volume24hr","quoteVolume","tradeCount","change24hr"],"properties":{"change24hr":{"type":"string","description":"Quote price change over the 24h window (decimal string)."},"instrumentId":{"$ref":"#/components/schemas/InstrumentId"},"quoteVolume":{"type":"string"},"tradeCount":{"type":"integer","format":"int64","minimum":0},"volume24hr":{"type":"string"}}},"InstrumentId":{"type":"string","format":"decimal","description":"An instrument identifier (8-byte hash).","example":"42"},"InstrumentView":{"type":"object","required":["id","ticker","instrumentType","underlyingAsset","settlementAsset","isTrading","priceScale","quantityScale","lastMatchPrice"],"properties":{"expiry":{"type":["string","null"]},"id":{"type":"string"},"instrumentType":{"type":"string"},"isTrading":{"type":"boolean"},"lastMatchPrice":{"type":"string"},"listedAt":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/u64"}]},"maxLeverage":{"type":["string","null"]},"maxLeverageMargin":{"type":["string","null"]},"priceScale":{"type":"integer","format":"int32"},"quantityScale":{"type":"integer","format":"int32"},"settlementAsset":{"type":"string"},"strike":{"type":["string","null"]},"ticker":{"type":"string"},"underlyingAsset":{"type":"string"},"worstCasePriceMovePct":{"type":["string","null"]},"worstCasePriceMovePctMargin":{"type":["string","null"]}}},"InstrumentsSetView":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InstrumentView"},"propertyNames":{"type":"string","format":"decimal","description":"An instrument identifier (8-byte hash).","example":"42"}},"LeaderboardPositionResponseItem":{"type":"object","required":["position","user","pnl","volume"],"properties":{"pnl":{"type":"string"},"position":{"type":"integer","format":"int64","minimum":0},"user":{"$ref":"#/components/schemas/AccountAddress"},"volume":{"type":"string"}}},"LeaderboardResponseItem":{"type":"object","required":["user","pnl","volume"],"properties":{"pnl":{"type":"string"},"user":{"$ref":"#/components/schemas/AccountAddress"},"volume":{"type":"string"}}},"OrderHistoryResponseItem":{"type":"object","required":["timestamp","round","txIndex","eventIndex","account","instrument","orderId","eventType","price","size","settlementAsset","pnl","feeAmount","feeRate","isPassive","isLiquidation","isAdl"],"properties":{"account":{"$ref":"#/components/schemas/AccountAddress"},"eventIndex":{"type":"integer","format":"int32","minimum":0},"eventType":{"type":"string"},"feeAmount":{"type":"string"},"feeRate":{"type":"string"},"instrument":{"$ref":"#/components/schemas/InstrumentId"},"isAdl":{"type":"boolean"},"isLiquidation":{"type":"boolean"},"isPassive":{"type":"boolean"},"orderId":{"$ref":"#/components/schemas/u64"},"pnl":{"type":"string"},"price":{"type":"string"},"round":{"type":"integer","format":"int64","minimum":0},"settlementAsset":{"$ref":"#/components/schemas/usize"},"size":{"type":"string"},"timestamp":{"$ref":"#/components/schemas/u64"},"txIndex":{"type":"integer","format":"int32","minimum":0}}},"PortfolioCurvePoint":{"type":"object","required":["timestamp","value"],"properties":{"timestamp":{"$ref":"#/components/schemas/u64"},"value":{"type":"string"}}},"PortfolioSummary":{"type":"object","required":["pnl","totalFunding","volume","maxDrawdownPct","returnPct","avgDailyPnl","pnlVolatilityPct","pnlVolatilityUsd","sharpeRatio","totalTrades","profitFactor","winRate","wins","losses","averageWin","averageLoss","longPnl","shortPnl"],"properties":{"averageLoss":{"type":"string"},"averageWin":{"type":"string"},"avgDailyPnl":{"type":"string"},"longPnl":{"type":"string"},"losses":{"type":"string"},"maxDrawdownPct":{"type":"string"},"pnl":{"type":"string"},"pnlVolatilityPct":{"type":"string"},"pnlVolatilityUsd":{"type":"string"},"profitFactor":{"type":"string"},"returnPct":{"type":"string"},"sharpeRatio":{"type":"string"},"shortPnl":{"type":"string"},"totalFunding":{"type":"string"},"totalTrades":{"type":"integer","format":"int64","minimum":0},"volume":{"type":"string"},"winRate":{"type":"string"},"wins":{"type":"string"}}},"PositionFundingEventView":{"type":"object","required":["fundingRate","timestamp","round","instrumentId","pnl","account","positionQuantity","instrumentMarkPrice"],"properties":{"account":{"$ref":"#/components/schemas/AccountAddress"},"fundingRate":{"type":"string"},"instrumentId":{"$ref":"#/components/schemas/InstrumentId"},"instrumentMarkPrice":{"type":"string"},"pnl":{"type":"string"},"positionQuantity":{"type":"string"},"round":{"type":"integer","format":"int64","minimum":0},"timestamp":{"$ref":"#/components/schemas/u64"}}},"PositionFundingEventsClientViewSet":{"type":"array","items":{"$ref":"#/components/schemas/PositionFundingEventView"}},"TradeResponseItem":{"type":"object","required":["timestamp","round","txIndex","eventIndex","account","instrument","ticker","orderId","price","size","settlementAsset","pnl","feeAmount","feeRate","isPassive","isLiquidation","isAdl"],"properties":{"account":{"$ref":"#/components/schemas/AccountAddress"},"eventIndex":{"type":"integer","format":"int32","minimum":0},"feeAmount":{"type":"string"},"feeRate":{"type":"string"},"instrument":{"$ref":"#/components/schemas/InstrumentId"},"isAdl":{"type":"boolean"},"isLiquidation":{"type":"boolean"},"isPassive":{"type":"boolean"},"orderId":{"$ref":"#/components/schemas/u64"},"pnl":{"type":"string"},"price":{"type":"string"},"round":{"type":"integer","format":"int64","minimum":0},"settlementAsset":{"$ref":"#/components/schemas/usize"},"size":{"type":"string"},"ticker":{"type":"string","description":"Canonical instrument ticker from the indexed `instruments` table (empty if unknown)."},"timestamp":{"$ref":"#/components/schemas/u64"},"txIndex":{"type":"integer","format":"int32","minimum":0}}},"VaultEventResponseItem":{"type":"object","required":["timestamp","round","txIndex","eventIndex","vault","account","eventType","assetId","amount","shares","txHash"],"properties":{"account":{"type":"string","format":"hex","description":"Account associated with the event."},"amount":{"type":"string","description":"Absolute collateral amount in dollar units."},"assetId":{"$ref":"#/components/schemas/usize","description":"Asset associated with the event."},"eventIndex":{"type":"integer","format":"int32","description":"Event index within the round.","minimum":0},"eventType":{"type":"string","description":"Event type exposed to clients (`deposit` or `withdraw` for vault flows)."},"round":{"$ref":"#/components/schemas/u64","description":"Round in which the event occurred."},"shares":{"type":"string","description":"Signed share delta stored in the vault event row."},"timestamp":{"$ref":"#/components/schemas/u64","description":"Event timestamp in milliseconds since Unix epoch."},"txHash":{"type":"string","format":"hex","description":"Transaction hash as a hex string."},"txIndex":{"type":"integer","format":"int32","description":"Transaction index within the round.","minimum":0},"vault":{"type":"string","format":"hex","description":"Vault address."}}},"VaultPortfolioPosition":{"type":"object","required":["vault","shares","totalShares","vaultEquity","value","deposits","withdrawals","pnl"],"properties":{"deposits":{"type":"string","description":"Total deposits recorded for this account/vault."},"pnl":{"type":"string","description":"Current vault PnL: `value + withdrawals - deposits`."},"shares":{"type":"string","description":"Current account share balance in this vault."},"totalShares":{"type":"string","description":"Current total outstanding shares for this vault."},"value":{"type":"string","description":"Current value of the account's shares."},"vault":{"type":"string","format":"hex","description":"Vault address."},"vaultEquity":{"type":"string","description":"Latest indexed vault equity."},"withdrawals":{"type":"string","description":"Total withdrawals recorded for this account/vault."}}},"VaultStats":{"type":"object","required":["sharpeRatio","averageReturns","returnsVolatility","maxDrawdown"],"properties":{"averageReturns":{"type":"string"},"maxDrawdown":{"type":"string"},"returnsVolatility":{"type":"string"},"sharpeRatio":{"type":"string"}}},"u64":{"type":"integer","format":"int64","minimum":0},"usize":{"type":"integer","minimum":0}}},"tags":[{"name":"Indexer REST-API","description":"Read-only REST endpoints backed by the RocketChain indexer. All routes are served over HTTP GET."}]}