docs: REST API reference and JSON-RPC parity with the node - #313
Merged
Merged
Conversation
- New REST reference (doc/api-reference/rest/), published as a second GitBook spec (pod-rest): every /v1/clob, explorer and bridge route, including /v1/clob/activity from the account activity feed. - JSON-RPC reference brought in line with the node: method params, response fields and encodings, limits, subscription semantics, newHeads, pod_activity, ob_getSolutions; pod_getBridgeClaimProof removed in favour of the REST by-id route. - Guides, the JSON-RPC README, the errors page and the SDK README fixed where they disagreed with the node. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tches
- /clob/activity entries use the field names the merged node sends: ts,
book, mark, pnl, tx, id; the cursor is "{ts}:{ordinal}:{key_hex}".
- withdrawable_cash is max(0, equity - max(initial margin,
transfer_margin_ratio x notional)), in margin.md and both specs.
- The market-data guide replays the whole forming candle from the bucket
start (seeding from 1h bars past the replay buffer), and states which
routes use hex and which decimal strings.
- pod_getVoteBatches takes an optional validator_index, served by any
node that holds that validator's batches.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Tone down the PR's added text: less emphasis and rationale, each fact stated once. - The publish workflow uploads both specs in one loop; the REST README drops the paging table each route already documents. - From checking against the node: eth_estimateGas cases, the pod_sendRawTransaction wait and its code 3 error, getAccountDiagnostics current_vote, orders_v2 cancel `st`, settlement_price presence, SolutionResponse.funding_index, getVoteBatches result shape, the forming candle (since = bucket start - 1us) in the REST reference, the orderbook price-key encoding, and the pod_markets snapshot scope. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
majesticwizardcat
force-pushed
the
docs/api-parity
branch
from
October 5, 2026 13:06
e20b9c0 to
f0c03ba
Compare
majesticwizardcat
marked this pull request as ready for review
October 5, 2026 14:00
poszu
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the API docs in line with the node, treating the node code as the source of truth, and adds a reference for the REST API, which was previously undocumented apart from the bridge routes.
REST reference (new)
doc/api-reference/rest/openapi.yamlandrest/README.md, published as a second GitBook spec,pod-rest, next topod-docs./v1/clob/status,/markets,/markets/stats,/candles/{orderbook},/orderbook/{orderbook},/solutions/v1/clob/orders/{account},/fills/{account},/positions/{account},/balances/{account},/triggers/{account},/backstop-transfers/{account},/activity/{account}/v1/tx/{hash},/v1/transactions/v1/bridge/config,/withdrawals,/withdrawals/{account},/withdrawals/by-id/{tx_hash}, with the full claim-proof response and whatpendingmeansEach route documents its parameters, defaults, caps, errors and
Cache-Control. The README covers the/v1prefix on the RPC port, which routes need the indexer, caching, number encodings, and seeding from REST before subscribing.JSON-RPC reference
The highest-impact fixes:
eth_getBalance: plain CLOB cash, not the withdrawable balance.eth_estimateGas: a table lookup, not a fixed 21000.eth_getTransactionCount: honours thependingtag.pod_getVoteBatches: the params are now correct; the old example failed.ob_getOrderbook: bids are ascending, and the example is flipped.ob_getCandles: the window is half-open, andlimitis capped.Orderand triggers: the field encodings are corrected.ob_getPositions: a perp position'srealized_pnlis always 0.pod_orders_v2: the status and reject-code lists now match the node.Also:
ob_getSolutions,newHeadsandpod_activity.pod_getBridgeClaimProof, which no longer exists.Guides and other pages
read-market-data.md: rewritten around REST plus subscriptions.recover-locked-account.md: readsTargetTxas{hash, nonce}.json-rpc-errors.md: adds the missing error codes and the up-frontsince too oldrejection.restUrlis the RPC host plus/v1.Before merging
/v1/clob/activity,pod_activity, ADL frames onpod_orders_v2, cash-sweep backstop rows and the extrapod_positionspushes are documented against nodemain.pod-restspec has to be accepted in the GitBook organization. The publish workflow now uploads both specs.Left out on purpose
POST /v1/raw-txs: its binary frame format would need describing first.eth_syncing,eth_gasPrice,eth_maxFeePerGas,eth_maxPriorityFeePerGas,eth_getCode,eth_feeHistory,net_versionandweb3_clientVersion, which return fixed or placeholder answers.pod_getAccountRepair,pod_pushAccountRepair,pod_getBridgeClaimSignatures,pod_subscribeVotes, and admin and dev methods.ob_*deprecation, left for a later pass.accountValue, which belong with SDK PRs feat(ts-sdk): account activity resource #310 and feat(ts-sdk): account value on the PnL history #311.Known gap
pod_orders(v1)newandinvalidevents serialize the engine's order type, notOrderResponse. Their real shape differs from the documented one:endis a string and several fields are absent. This is not fixed here.Verification
redocly lint: the REST spec has 0 errors. The JSON-RPC spec adds no new errors (44 before and after, all pre-existing).price_change_24his in basis points, the guide'spod_orderbooksincenow uses the solution-time watermark,pod_activitywas missing from the stale-sincelist, and the README no longer documents unmerged SDK methods.🤖 Generated with Claude Code