Skip to content

Complete JSON-RPC types and enums against backend#216

Merged
shresthagrawal merged 1 commit into
mainfrom
fix/api-doc
Jun 2, 2026
Merged

Complete JSON-RPC types and enums against backend#216
shresthagrawal merged 1 commit into
mainfrom
fix/api-doc

Conversation

@shresthagrawal

Copy link
Copy Markdown
Contributor

Cross-checked the ob_/eth_/pod_ schemas in the JSON-RPC OpenAPI spec against the pod backend (node/src/rpc, trading crate) and verified response shapes live on staging.

Enum/correctness fixes:

  • OrderKind: was [user_signed, liquidation, adl, backstop_transfer]; actual enum is [user_signed, liquidation, triggered]
  • Side: lowercase [buy, sell] (was capitalized)
  • FillResponse: returns order_id, not tx_hash
  • Market.auction_interval is a number, not a string
  • Market: add mark_price (perp-only, was missing)
  • Order/TriggerOrderResponse deadline,end are numeric Timestamps
  • OrderbookSnapshot: response field is orderbook_id (clob_id is an input alias only); TickSnapshot.volume and grouping_precision are hex
  • ob_getOrders next_cursor wire format is "{ts}:{nonce}:{order_id_hex}"

Add missing enums: TriggerType, TriggerGrouping.

Complete types: Order.grouping/trigger_type; PositionsResponse perps_equity/account_value/cash/withdrawable_cash; OrderbookSnapshot perp oracle/funding fields; OrdersQuery.with_fills.

Document four undocumented endpoints: ob_getTriggers, ob_getRankedPositions, ob_getOraclePrices, ob_getFundingRates.

Make request params render as structured objects: give each ob_ params array items referencing the query schemas (Address/Bytes32 + OrdersQuery/CandlesQuery/FillsQuery/TriggersQuery); add TriggersQuery.

Cross-checked the ob_/eth_/pod_ schemas in the JSON-RPC OpenAPI spec
against the pod backend (node/src/rpc, trading crate) and verified
response shapes live on staging.

Enum/correctness fixes:
- OrderKind: was [user_signed, liquidation, adl, backstop_transfer];
  actual enum is [user_signed, liquidation, triggered]
- Side: lowercase [buy, sell] (was capitalized)
- FillResponse: returns order_id, not tx_hash
- Market.auction_interval is a number, not a string
- Market: add mark_price (perp-only, was missing)
- Order/TriggerOrderResponse deadline,end are numeric Timestamps
- OrderbookSnapshot: response field is orderbook_id (clob_id is an
  input alias only); TickSnapshot.volume and grouping_precision are hex
- ob_getOrders next_cursor wire format is "{ts}:{nonce}:{order_id_hex}"

Add missing enums: TriggerType, TriggerGrouping.

Complete types: Order.grouping/trigger_type; PositionsResponse
perps_equity/account_value/cash/withdrawable_cash; OrderbookSnapshot
perp oracle/funding fields; OrdersQuery.with_fills.

Document four undocumented endpoints: ob_getTriggers,
ob_getRankedPositions, ob_getOraclePrices, ob_getFundingRates.

Make request params render as structured objects: give each ob_
params array `items` referencing the query schemas (Address/Bytes32 +
OrdersQuery/CandlesQuery/FillsQuery/TriggersQuery); add TriggersQuery.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@shresthagrawal shresthagrawal merged commit 824ca20 into main Jun 2, 2026
13 checks passed
@shresthagrawal shresthagrawal deleted the fix/api-doc branch June 2, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants