> For the complete documentation index, see [llms.txt](https://docs.v2.pod.network/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.v2.pod.network/guides-references/references/rest/models.md).

# Models

## The Address object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"}}}}
```

## The Bytes32 object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."}}}}
```

## The HexUint256 object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"}}}}
```

## The DecimalUint256 object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"DecimalUint256":{"type":"string","pattern":"^[0-9]+$","description":"Unsigned 256-bit integer, decimal string"}}}}
```

## The DecimalInt256 object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"}}}}
```

## The Timestamp object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"}}}}
```

## The TimestampString object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"TimestampString":{"type":"string","pattern":"^[0-9]+$","description":"Unix time in microseconds, as a decimal string"}}}}
```

## The CandleResolution object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"CandleResolution":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","1d","1w","1M"]}}}}
```

## The MarketType object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"MarketType":{"type":"string","enum":["spot","perpetual"]}}}}
```

## The OrderStatus object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"OrderStatus":{"type":"string","enum":["pending","active","filled","expired","canceled","margin_canceled","self_trade_canceled","post_only_refused","invalid"],"description":"- `pending`: submitted, not yet in the book\n- `active`: resting in the book\n- `filled`: completely filled\n- `expired`: TTL passed\n- `canceled`: canceled by the owner\n- `margin_canceled`: removed by the engine because the owner's margin was exhausted\n- `self_trade_canceled`: removed by the engine because it was about to fill against an order of the same owner\n- `post_only_refused`: a `post_only` order removed because it would have taken liquidity in the batch that admitted it\n- `invalid`: rejected at execution and never entered the book; see `invalid_reason`\n\nEverything except `pending` and `active` is terminal.\n"}}}}
```

## The OrderKind object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"OrderKind":{"type":"string","enum":["user_signed","liquidation","triggered","adl","adl_counterparty","backstop_transfer"],"description":"- `user_signed`: submitted by the account\n- `liquidation`: generated by the engine when the account fell below maintenance margin\n- `triggered`: the order a fired TP/SL trigger produced\n- `adl`: auto-deleveraging close of this account's position\n- `adl_counterparty`: this account's side covering an auto-deleveraging close\n- `backstop_transfer`: a backstop sweep of this account's position, shown as a terminal order\n"}}}}
```

## The OrderDirection object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"OrderDirection":{"type":"string","enum":["buy","sell","open_long","add_long","reduce_long","close_long","open_short","add_short","reduce_short","close_short","long_to_short","short_to_long","liquidation"],"description":"Spot orders use `buy`/`sell`. Perp orders use the position effect of their fills; `liquidation` when `kind` is `liquidation`."}}}}
```

## The TriggerType object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"TriggerType":{"type":"string","enum":["take_profit","stop_loss"]}}}}
```

## The TriggerGrouping object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"TriggerGrouping":{"type":"string","enum":["none","asset"],"description":"- `none`: standalone; removed only by cancel, TTL expiry or its own fire\n- `asset`: removed, with any resting order it produced, once the owner's position on the pair (perp) or base holding (spot) reaches zero\n"}}}}
```

## The MarketStatic object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"MarketStatic":{"type":"object","description":"Static market configuration. Numeric amounts are decimal strings.","properties":{"status":{"type":"string","enum":["pending","active","disabled","settled"],"description":"Lifecycle status."},"id":{"$ref":"#/components/schemas/Bytes32"},"name":{"type":"string","description":"`{base_symbol}/{quote_symbol}`"},"base_token_address":{"$ref":"#/components/schemas/Address"},"quote_token_address":{"$ref":"#/components/schemas/Address"},"base_token_symbol":{"type":"string"},"quote_token_symbol":{"type":"string"},"base_token_name":{"type":"string"},"quote_token_name":{"type":"string"},"market_type":{"type":"string","enum":["spot","perp"],"description":"Order rows spell this `perpetual`."},"auction_interval_us":{"type":"integer","format":"int64","description":"Batch interval, microseconds"},"maker_fee":{"type":"string","description":"Fee rate as a decimal fraction, six places (`\"0.000150\"` is 1.5 bps)."},"taker_fee":{"type":"string","description":"Fee rate as a decimal fraction, six places."},"tick_precision":{"$ref":"#/components/schemas/DecimalUint256"},"lot_size":{"$ref":"#/components/schemas/DecimalUint256"},"min_notional":{"type":"string","description":"Minimum quote notional per order, 1e18-scaled decimal string. `\"0\"` is no floor."},"max_leverage":{"type":"integer"},"initial_margin":{"type":"string","description":"Initial-margin rate, 1e18-scaled decimal string, unrounded (`max_leverage` is rounded)."},"funding_window_us":{"type":"integer","format":"int64","description":"Period `funding_rate` applies over, microseconds"},"live_at_us":{"type":"integer","format":"int64","description":"When a `pending` market goes live, microseconds. Omitted when not scheduled."},"disable_at_us":{"type":"integer","format":"int64","description":"Scheduled halt, microseconds. Omitted when none."},"settlement_price":{"type":"string","description":"Price open positions settle at, fixed when a perp market halts. 1e18-scaled decimal string. Omitted until then."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"DecimalUint256":{"type":"string","pattern":"^[0-9]+$","description":"Unsigned 256-bit integer, decimal string"}}}}
```

## The MarketStats object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"MarketStats":{"type":"object","description":"Live statistics for one market. Prices and amounts are 1e18-scaled decimal\nstrings. Optional fields are omitted until the data exists.\n","required":["orderbook_id","volume_24h"],"properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"last_clearing_price":{"type":"string","description":"Omitted until the market's first fill."},"volume_24h":{"type":"string","description":"Quote notional traded over 24 hours."},"high_24h":{"type":"string","description":"Omitted until the market has a closed candle."},"low_24h":{"type":"string","description":"Omitted until the market has a closed candle."},"price_change_24h":{"type":"integer","description":"24-hour price change in basis points."},"oracle_price":{"type":"string","description":"Perp only."},"internal":{"type":"boolean","description":"`true` when `oracle_price` is derived from the book because every oracle source was stale."},"mark_price":{"type":"string","description":"Perp only."},"funding_rate":{"type":"string","description":"Perp only. Signed."},"funding_index":{"type":"string","description":"Perp only. Signed, undivided funding accumulator."},"funding_settling_index":{"type":"string","description":"Perp only. The index positions settle against (`funding_settling_index × size − funding_basis` is a position's accrual). Absent until the market's first perp batch after the node started."},"funding_last_updated_us":{"type":"integer","format":"int64","description":"Perp only."},"open_interest":{"type":"string","description":"Perp only. USD notional."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."}}}}
```

## The Candle object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"Candle":{"type":"object","description":"One closed OHLCV bar. Prices and volumes are 1e18-scaled `0x` hex.","properties":{"timestamp":{"$ref":"#/components/schemas/Timestamp"},"open":{"$ref":"#/components/schemas/HexUint256"},"close":{"$ref":"#/components/schemas/HexUint256"},"high":{"$ref":"#/components/schemas/HexUint256"},"low":{"$ref":"#/components/schemas/HexUint256"},"volume":{"$ref":"#/components/schemas/HexUint256","description":"Base volume traded in the bucket."},"quote_volume":{"$ref":"#/components/schemas/HexUint256","description":"Quote notional traded in the bucket."}}},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"}}}}
```

## The OrderbookSnapshot object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"OrderbookSnapshot":{"type":"object","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"buys":{"type":"object","additionalProperties":{"type":"object","properties":{"volume":{"$ref":"#/components/schemas/HexUint256"}}},"description":"Buy levels keyed by price (decimal string), price-ascending; the best bid is the last key."},"sells":{"type":"object","additionalProperties":{"type":"object","properties":{"volume":{"$ref":"#/components/schemas/HexUint256"}}},"description":"Sell levels keyed by price (decimal string), price-ascending; the best ask is the first key."},"buys_count":{"type":"integer","description":"Buy levels in the full book."},"sells_count":{"type":"integer","description":"Sell levels in the full book."},"grouping_precision":{"$ref":"#/components/schemas/HexUint256"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"new_orders_count":{"type":"integer"},"clearing_price":{"$ref":"#/components/schemas/HexUint256","description":"The orderbook's current mark, carried forward on ticks without fills."},"oracle_price":{"type":"string","nullable":true,"description":"Perp only, `0x` hex. `null` for spot."},"funding_rate":{"type":"string","nullable":true,"description":"Perp only, signed decimal string. `null` for spot."},"funding_index":{"type":"string","nullable":true,"description":"Perp only, signed decimal string. `null` for spot."},"funding_last_updated":{"type":"integer","format":"int64","nullable":true,"description":"Perp only, microseconds. `null` for spot."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"}}}}
```

## The Solution object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"Solution":{"type":"object","description":"One orderbook's record for one tick. Unsigned values are 1e18-scaled `0x` hex,\nsigned values decimal strings. Perp-only fields are omitted on spot ticks and on\nrows recorded before the field existed.\n","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"timestamp":{"$ref":"#/components/schemas/Timestamp","description":"Batch deadline."},"clearing_price":{"$ref":"#/components/schemas/HexUint256","description":"Omitted for a market that has never traded."},"mark_price":{"$ref":"#/components/schemas/HexUint256","description":"`0x0` for spot."},"volume":{"$ref":"#/components/schemas/HexUint256"},"oracle_price":{"$ref":"#/components/schemas/HexUint256"},"funding_rate":{"$ref":"#/components/schemas/DecimalInt256"},"funding_index":{"$ref":"#/components/schemas/DecimalInt256"},"open_interest":{"$ref":"#/components/schemas/HexUint256"},"mark_best_bid":{"$ref":"#/components/schemas/HexUint256"},"mark_best_ask":{"$ref":"#/components/schemas/HexUint256"},"premium_ema":{"$ref":"#/components/schemas/DecimalInt256"},"book_median_ema":{"$ref":"#/components/schemas/HexUint256"},"impact_bid":{"$ref":"#/components/schemas/HexUint256"},"impact_ask":{"$ref":"#/components/schemas/HexUint256"}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"}}}}
```

## The PartialFill object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"PartialFill":{"type":"object","properties":{"base_amount":{"$ref":"#/components/schemas/HexUint256"},"quote_amount":{"$ref":"#/components/schemas/HexUint256"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"price":{"$ref":"#/components/schemas/HexUint256","description":"The batch's clearing price; the order's own price for ADL fills."}}},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"}}}}
```

## The Order object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"Order":{"type":"object","description":"An order with its fills. Unsigned amounts and prices are 1e18-scaled `0x` hex,\nsigned ones decimal strings. Perp-only fields are omitted on spot orders.\n","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"market_type":{"$ref":"#/components/schemas/MarketType"},"kind":{"$ref":"#/components/schemas/OrderKind"},"order_id":{"$ref":"#/components/schemas/Bytes32"},"tx_hash":{"$ref":"#/components/schemas/Bytes32","description":"Creating transaction. Zero for engine-generated orders."},"bidder":{"$ref":"#/components/schemas/Address"},"nonce":{"type":"integer","format":"int64"},"order_type":{"type":"string","enum":["limit","market"]},"status":{"$ref":"#/components/schemas/OrderStatus"},"side":{"type":"string","enum":["buy","sell"]},"price":{"$ref":"#/components/schemas/HexUint256"},"initial_size":{"$ref":"#/components/schemas/DecimalInt256","description":"Signed; positive buy/long, negative sell/short."},"filled_base_amount":{"$ref":"#/components/schemas/HexUint256"},"filled_quote_amount":{"$ref":"#/components/schemas/HexUint256"},"fee":{"$ref":"#/components/schemas/HexUint256"},"deadline":{"$ref":"#/components/schemas/TimestampString","description":"The batch the order targets, microseconds, as a string."},"end":{"$ref":"#/components/schemas/Timestamp","description":"TTL expiry, microseconds. Orders that never expire carry `18446744073709551615`, which exceeds a JavaScript safe integer."},"included_batch":{"$ref":"#/components/schemas/Timestamp","description":"Deadline of the batch that first included the order. `0` for engine-generated orders and older rows."},"invalid_reason":{"type":"string","description":"Why the engine rejected the order. Only when `status` is `invalid`."},"effective_price":{"$ref":"#/components/schemas/HexUint256","description":"`filled_quote / filled_base` so far."},"fills":{"type":"array","items":{"$ref":"#/components/schemas/PartialFill"},"description":"Always present, oldest first."},"reduce_only":{"type":"boolean","description":"Perp only."},"ioc":{"type":"boolean","description":"Perp only."},"post_only":{"type":"boolean","description":"Omitted when false."},"direction":{"$ref":"#/components/schemas/OrderDirection"},"realized_pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Perp only, present once a fill closed exposure. Price drift minus funding across the slices it closed."},"grouping":{"$ref":"#/components/schemas/TriggerGrouping","description":"Inherited from the parent trigger. Omitted when `none`."},"trigger_type":{"$ref":"#/components/schemas/TriggerType","description":"Set only on orders a fired trigger produced (`kind` `triggered`)."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"MarketType":{"type":"string","enum":["spot","perpetual"]},"OrderKind":{"type":"string","enum":["user_signed","liquidation","triggered","adl","adl_counterparty","backstop_transfer"],"description":"- `user_signed`: submitted by the account\n- `liquidation`: generated by the engine when the account fell below maintenance margin\n- `triggered`: the order a fired TP/SL trigger produced\n- `adl`: auto-deleveraging close of this account's position\n- `adl_counterparty`: this account's side covering an auto-deleveraging close\n- `backstop_transfer`: a backstop sweep of this account's position, shown as a terminal order\n"},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"OrderStatus":{"type":"string","enum":["pending","active","filled","expired","canceled","margin_canceled","self_trade_canceled","post_only_refused","invalid"],"description":"- `pending`: submitted, not yet in the book\n- `active`: resting in the book\n- `filled`: completely filled\n- `expired`: TTL passed\n- `canceled`: canceled by the owner\n- `margin_canceled`: removed by the engine because the owner's margin was exhausted\n- `self_trade_canceled`: removed by the engine because it was about to fill against an order of the same owner\n- `post_only_refused`: a `post_only` order removed because it would have taken liquidity in the batch that admitted it\n- `invalid`: rejected at execution and never entered the book; see `invalid_reason`\n\nEverything except `pending` and `active` is terminal.\n"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"},"TimestampString":{"type":"string","pattern":"^[0-9]+$","description":"Unix time in microseconds, as a decimal string"},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"},"PartialFill":{"type":"object","properties":{"base_amount":{"$ref":"#/components/schemas/HexUint256"},"quote_amount":{"$ref":"#/components/schemas/HexUint256"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"price":{"$ref":"#/components/schemas/HexUint256","description":"The batch's clearing price; the order's own price for ADL fills."}}},"OrderDirection":{"type":"string","enum":["buy","sell","open_long","add_long","reduce_long","close_long","open_short","add_short","reduce_short","close_short","long_to_short","short_to_long","liquidation"],"description":"Spot orders use `buy`/`sell`. Perp orders use the position effect of their fills; `liquidation` when `kind` is `liquidation`."},"TriggerGrouping":{"type":"string","enum":["none","asset"],"description":"- `none`: standalone; removed only by cancel, TTL expiry or its own fire\n- `asset`: removed, with any resting order it produced, once the owner's position on the pair (perp) or base holding (spot) reaches zero\n"},"TriggerType":{"type":"string","enum":["take_profit","stop_loss"]}}}}
```

## The Fill object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"Fill":{"type":"object","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"base_token":{"$ref":"#/components/schemas/Address"},"quote_token":{"$ref":"#/components/schemas/Address"},"order_id":{"$ref":"#/components/schemas/Bytes32"},"order_type":{"type":"string","enum":["limit","market"]},"initial_size":{"$ref":"#/components/schemas/DecimalInt256"},"fee":{"$ref":"#/components/schemas/HexUint256"},"base_amount":{"$ref":"#/components/schemas/HexUint256"},"quote_amount":{"$ref":"#/components/schemas/HexUint256"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"price":{"$ref":"#/components/schemas/HexUint256"}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"}}}}
```

## The PerpPosition object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"PerpPosition":{"type":"object","description":"One open perp position. 1e18-scaled; unsigned `0x` hex, signed decimal strings.","properties":{"kind":{"type":"string","enum":["perp"]},"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"base_symbol":{"type":"string"},"quote_symbol":{"type":"string"},"side":{"type":"string","enum":["long","short"]},"size":{"$ref":"#/components/schemas/DecimalInt256","description":"Positive long, negative short."},"notional":{"$ref":"#/components/schemas/HexUint256"},"entry_price":{"$ref":"#/components/schemas/HexUint256","description":"Rounded against the holder; `unrealized_pnl` is exact."},"mark_price":{"$ref":"#/components/schemas/HexUint256"},"margin":{"$ref":"#/components/schemas/HexUint256"},"leverage":{"$ref":"#/components/schemas/HexUint256"},"funding_accrued":{"$ref":"#/components/schemas/DecimalInt256","description":"Funding owed on the position, quote wei. Positive is owed by the holder."},"funding_basis":{"$ref":"#/components/schemas/DecimalInt256"},"cost_basis":{"$ref":"#/components/schemas/DecimalInt256"},"entry_funding":{"$ref":"#/components/schemas/DecimalInt256"},"liquidation_price":{"$ref":"#/components/schemas/HexUint256"},"unrealized_pnl":{"$ref":"#/components/schemas/DecimalInt256"},"realized_pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Always `\"0\"`; realized PnL is banked into cash and `total_realized_pnl`."},"stop_loss":{"type":"string","nullable":true,"description":"Always `null`."},"take_profit":{"type":"string","nullable":true,"description":"Always `null`."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"}}}}
```

## The SpotHolding object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"SpotHolding":{"type":"object","description":"One spot token holding. 1e18-scaled; unsigned `0x` hex, signed decimal strings.","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"base_symbol":{"type":"string"},"quote_symbol":{"type":"string"},"balance":{"$ref":"#/components/schemas/HexUint256","description":"`free_balance + locked_balance`."},"free_balance":{"$ref":"#/components/schemas/HexUint256"},"locked_balance":{"$ref":"#/components/schemas/HexUint256","description":"Locked in open sell orders."},"cost_basis":{"$ref":"#/components/schemas/HexUint256"},"mark_price":{"$ref":"#/components/schemas/HexUint256"},"unrealized_pnl":{"$ref":"#/components/schemas/DecimalInt256"},"realized_pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Portfolio-wide lifetime spot realized PnL."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"}}}}
```

## The PositionsResponse object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"PositionsResponse":{"type":"object","properties":{"positions":{"type":"array","items":{"$ref":"#/components/schemas/PerpPosition"}},"total_unrealized_pnl":{"$ref":"#/components/schemas/DecimalInt256"},"total_realized_pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Lifetime, spot and perp."},"perps_equity":{"$ref":"#/components/schemas/DecimalInt256","description":"Cash adjusted for unsettled funding, plus perp unrealized PnL."},"account_value":{"$ref":"#/components/schemas/DecimalInt256","description":"`perps_equity` plus the mark value of spot holdings and quote escrowed in resting spot buys."},"cash":{"$ref":"#/components/schemas/DecimalInt256"},"withdrawable_cash":{"$ref":"#/components/schemas/HexUint256","description":"What a withdrawal or transfer can take now: `max(0, equity − max(initial_margin, transfer_margin_ratio × notional))`, where `notional` is `Σ |size| × mark` and `transfer_margin_ratio` is a network parameter (10% by default). Equity counts unrealized PnL."},"net_deposits":{"$ref":"#/components/schemas/DecimalInt256","description":"Native collateral deposited minus withdrawn. Lifetime PnL is `account_value − net_deposits`."}}},"PerpPosition":{"type":"object","description":"One open perp position. 1e18-scaled; unsigned `0x` hex, signed decimal strings.","properties":{"kind":{"type":"string","enum":["perp"]},"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"base_symbol":{"type":"string"},"quote_symbol":{"type":"string"},"side":{"type":"string","enum":["long","short"]},"size":{"$ref":"#/components/schemas/DecimalInt256","description":"Positive long, negative short."},"notional":{"$ref":"#/components/schemas/HexUint256"},"entry_price":{"$ref":"#/components/schemas/HexUint256","description":"Rounded against the holder; `unrealized_pnl` is exact."},"mark_price":{"$ref":"#/components/schemas/HexUint256"},"margin":{"$ref":"#/components/schemas/HexUint256"},"leverage":{"$ref":"#/components/schemas/HexUint256"},"funding_accrued":{"$ref":"#/components/schemas/DecimalInt256","description":"Funding owed on the position, quote wei. Positive is owed by the holder."},"funding_basis":{"$ref":"#/components/schemas/DecimalInt256"},"cost_basis":{"$ref":"#/components/schemas/DecimalInt256"},"entry_funding":{"$ref":"#/components/schemas/DecimalInt256"},"liquidation_price":{"$ref":"#/components/schemas/HexUint256"},"unrealized_pnl":{"$ref":"#/components/schemas/DecimalInt256"},"realized_pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Always `\"0\"`; realized PnL is banked into cash and `total_realized_pnl`."},"stop_loss":{"type":"string","nullable":true,"description":"Always `null`."},"take_profit":{"type":"string","nullable":true,"description":"Always `null`."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"}}}}
```

## The BalancesResponse object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"BalancesResponse":{"type":"object","properties":{"balances":{"type":"array","items":{"$ref":"#/components/schemas/SpotHolding"}},"cash":{"$ref":"#/components/schemas/DecimalInt256"},"withdrawable_cash":{"$ref":"#/components/schemas/HexUint256"},"net_deposits":{"$ref":"#/components/schemas/DecimalInt256"}}},"SpotHolding":{"type":"object","description":"One spot token holding. 1e18-scaled; unsigned `0x` hex, signed decimal strings.","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"base_symbol":{"type":"string"},"quote_symbol":{"type":"string"},"balance":{"$ref":"#/components/schemas/HexUint256","description":"`free_balance + locked_balance`."},"free_balance":{"$ref":"#/components/schemas/HexUint256"},"locked_balance":{"$ref":"#/components/schemas/HexUint256","description":"Locked in open sell orders."},"cost_basis":{"$ref":"#/components/schemas/HexUint256"},"mark_price":{"$ref":"#/components/schemas/HexUint256"},"unrealized_pnl":{"$ref":"#/components/schemas/DecimalInt256"},"realized_pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Portfolio-wide lifetime spot realized PnL."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"}}}}
```

## The Trigger object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"Trigger":{"type":"object","description":"An armed TP/SL trigger.","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"order_id":{"$ref":"#/components/schemas/Bytes32"},"tx_hash":{"$ref":"#/components/schemas/Bytes32"},"bidder":{"$ref":"#/components/schemas/Address"},"nonce":{"type":"integer","format":"int64"},"size":{"$ref":"#/components/schemas/DecimalInt256","description":"Signed. `\"0\"` (only with `grouping` `asset`) sizes from the owner's exposure when the trigger fires."},"limit_price":{"$ref":"#/components/schemas/HexUint256"},"trigger_price":{"$ref":"#/components/schemas/HexUint256"},"trigger_type":{"$ref":"#/components/schemas/TriggerType"},"grouping":{"$ref":"#/components/schemas/TriggerGrouping"},"reduce_only":{"type":"boolean"},"ioc":{"type":"boolean"},"deadline":{"$ref":"#/components/schemas/TimestampString"},"end":{"type":"integer","description":"TTL expiry, microseconds, as a JSON number."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"TriggerType":{"type":"string","enum":["take_profit","stop_loss"]},"TriggerGrouping":{"type":"string","enum":["none","asset"],"description":"- `none`: standalone; removed only by cancel, TTL expiry or its own fire\n- `asset`: removed, with any resting order it produced, once the owner's position on the pair (perp) or base holding (spot) reaches zero\n"},"TimestampString":{"type":"string","pattern":"^[0-9]+$","description":"Unix time in microseconds, as a decimal string"}}}}
```

## The BackstopTransfer object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"BackstopTransfer":{"type":"object","description":"One backstop sweep. Amounts are 1e18-scaled decimal strings.","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32","description":"The swept position's market. Omitted on the cash-sweep row."},"size":{"type":"string","description":"Signed position size moved."},"cash":{"type":"string","description":"Signed."},"mark_price":{"type":"string"},"equity":{"type":"string","description":"Signed account equity when the sweep triggered."},"realized_pnl":{"type":"string","description":"Signed. `\"0\"` on the cash-sweep row and older rows."},"timestamp_us":{"$ref":"#/components/schemas/Timestamp"}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"}}}}
```

## The ActivityFrame object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityFrame":{"type":"object","description":"One account's activity: batch deadline (microseconds, as a decimal-string key) to that\nbatch's entries, in the order given on the route. The `pod_activity` websocket channel\nsends the same shape with one key per tick.\n","additionalProperties":{"type":"array","items":{"$ref":"#/components/schemas/ActivityEntry"}}},"ActivityEntry":{"description":"One activity entry, discriminated by `k`. Amounts and prices are 1e18-scaled decimal\nstrings. Optional fields are omitted rather than `null`; boolean flags are omitted when\nfalse. Ignore kinds and fields you do not recognise.\n","oneOf":[{"$ref":"#/components/schemas/ActivityOrder"},{"$ref":"#/components/schemas/ActivityFill"},{"$ref":"#/components/schemas/ActivityModify"},{"$ref":"#/components/schemas/ActivityTermination"},{"$ref":"#/components/schemas/ActivityBackstop"},{"$ref":"#/components/schemas/ActivityBridgeTransfer"},{"$ref":"#/components/schemas/ActivityTransfer"},{"$ref":"#/components/schemas/ActivityModifyReject"},{"$ref":"#/components/schemas/ActivityCancelReject"}],"discriminator":{"propertyName":"k","mapping":{"order":"#/components/schemas/ActivityOrder","fill":"#/components/schemas/ActivityFill","modify":"#/components/schemas/ActivityModify","termination":"#/components/schemas/ActivityTermination","backstop":"#/components/schemas/ActivityBackstop","bridge_transfer":"#/components/schemas/ActivityBridgeTransfer","transfer":"#/components/schemas/ActivityTransfer","modify_reject":"#/components/schemas/ActivityModifyReject","cancel_reject":"#/components/schemas/ActivityCancelReject"}}},"ActivityOrder":{"description":"The order as `/clob/orders/{account}` serves it, at the batch that admitted it, in its\ncurrent state. On the `pod_activity` channel it is the admission state instead:\n`active`, or `invalid` with `invalid_reason`, zero totals and `fills: []`. ADL closes\nappear as orders with `kind` `adl` or `adl_counterparty`; backstop sweeps appear only\nas `backstop` entries.\n","allOf":[{"type":"object","required":["k"],"properties":{"k":{"type":"string","enum":["order"]}}},{"$ref":"#/components/schemas/Order"}]},"Order":{"type":"object","description":"An order with its fills. Unsigned amounts and prices are 1e18-scaled `0x` hex,\nsigned ones decimal strings. Perp-only fields are omitted on spot orders.\n","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"market_type":{"$ref":"#/components/schemas/MarketType"},"kind":{"$ref":"#/components/schemas/OrderKind"},"order_id":{"$ref":"#/components/schemas/Bytes32"},"tx_hash":{"$ref":"#/components/schemas/Bytes32","description":"Creating transaction. Zero for engine-generated orders."},"bidder":{"$ref":"#/components/schemas/Address"},"nonce":{"type":"integer","format":"int64"},"order_type":{"type":"string","enum":["limit","market"]},"status":{"$ref":"#/components/schemas/OrderStatus"},"side":{"type":"string","enum":["buy","sell"]},"price":{"$ref":"#/components/schemas/HexUint256"},"initial_size":{"$ref":"#/components/schemas/DecimalInt256","description":"Signed; positive buy/long, negative sell/short."},"filled_base_amount":{"$ref":"#/components/schemas/HexUint256"},"filled_quote_amount":{"$ref":"#/components/schemas/HexUint256"},"fee":{"$ref":"#/components/schemas/HexUint256"},"deadline":{"$ref":"#/components/schemas/TimestampString","description":"The batch the order targets, microseconds, as a string."},"end":{"$ref":"#/components/schemas/Timestamp","description":"TTL expiry, microseconds. Orders that never expire carry `18446744073709551615`, which exceeds a JavaScript safe integer."},"included_batch":{"$ref":"#/components/schemas/Timestamp","description":"Deadline of the batch that first included the order. `0` for engine-generated orders and older rows."},"invalid_reason":{"type":"string","description":"Why the engine rejected the order. Only when `status` is `invalid`."},"effective_price":{"$ref":"#/components/schemas/HexUint256","description":"`filled_quote / filled_base` so far."},"fills":{"type":"array","items":{"$ref":"#/components/schemas/PartialFill"},"description":"Always present, oldest first."},"reduce_only":{"type":"boolean","description":"Perp only."},"ioc":{"type":"boolean","description":"Perp only."},"post_only":{"type":"boolean","description":"Omitted when false."},"direction":{"$ref":"#/components/schemas/OrderDirection"},"realized_pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Perp only, present once a fill closed exposure. Price drift minus funding across the slices it closed."},"grouping":{"$ref":"#/components/schemas/TriggerGrouping","description":"Inherited from the parent trigger. Omitted when `none`."},"trigger_type":{"$ref":"#/components/schemas/TriggerType","description":"Set only on orders a fired trigger produced (`kind` `triggered`)."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"MarketType":{"type":"string","enum":["spot","perpetual"]},"OrderKind":{"type":"string","enum":["user_signed","liquidation","triggered","adl","adl_counterparty","backstop_transfer"],"description":"- `user_signed`: submitted by the account\n- `liquidation`: generated by the engine when the account fell below maintenance margin\n- `triggered`: the order a fired TP/SL trigger produced\n- `adl`: auto-deleveraging close of this account's position\n- `adl_counterparty`: this account's side covering an auto-deleveraging close\n- `backstop_transfer`: a backstop sweep of this account's position, shown as a terminal order\n"},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"OrderStatus":{"type":"string","enum":["pending","active","filled","expired","canceled","margin_canceled","self_trade_canceled","post_only_refused","invalid"],"description":"- `pending`: submitted, not yet in the book\n- `active`: resting in the book\n- `filled`: completely filled\n- `expired`: TTL passed\n- `canceled`: canceled by the owner\n- `margin_canceled`: removed by the engine because the owner's margin was exhausted\n- `self_trade_canceled`: removed by the engine because it was about to fill against an order of the same owner\n- `post_only_refused`: a `post_only` order removed because it would have taken liquidity in the batch that admitted it\n- `invalid`: rejected at execution and never entered the book; see `invalid_reason`\n\nEverything except `pending` and `active` is terminal.\n"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"},"TimestampString":{"type":"string","pattern":"^[0-9]+$","description":"Unix time in microseconds, as a decimal string"},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"},"PartialFill":{"type":"object","properties":{"base_amount":{"$ref":"#/components/schemas/HexUint256"},"quote_amount":{"$ref":"#/components/schemas/HexUint256"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"price":{"$ref":"#/components/schemas/HexUint256","description":"The batch's clearing price; the order's own price for ADL fills."}}},"OrderDirection":{"type":"string","enum":["buy","sell","open_long","add_long","reduce_long","close_long","open_short","add_short","reduce_short","close_short","long_to_short","short_to_long","liquidation"],"description":"Spot orders use `buy`/`sell`. Perp orders use the position effect of their fills; `liquidation` when `kind` is `liquidation`."},"TriggerGrouping":{"type":"string","enum":["none","asset"],"description":"- `none`: standalone; removed only by cancel, TTL expiry or its own fire\n- `asset`: removed, with any resting order it produced, once the owner's position on the pair (perp) or base holding (spot) reaches zero\n"},"TriggerType":{"type":"string","enum":["take_profit","stop_loss"]},"ActivityFill":{"type":"object","description":"One fill of an order. `tb`, `tq`, `tf`, `f` and `st` are omitted on rows indexed before they\nwere recorded.\n","required":["k","id","book","b","q"],"properties":{"k":{"type":"string","enum":["fill"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"b":{"$ref":"#/components/schemas/DecimalUint256","description":"Base filled by this fill."},"q":{"$ref":"#/components/schemas/DecimalUint256","description":"Quote filled by this fill."},"tb":{"$ref":"#/components/schemas/DecimalUint256","description":"Order's total base filled after this fill."},"tq":{"$ref":"#/components/schemas/DecimalUint256","description":"Order's total quote filled after this fill."},"tf":{"$ref":"#/components/schemas/DecimalUint256","description":"Order's total fee after this fill."},"f":{"$ref":"#/components/schemas/DecimalUint256","description":"Fee charged by this fill."},"st":{"type":"string","enum":["filled","canceled","margin_canceled","self_trade_canceled","expired","post_only_refused"],"description":"Terminal status, present only on the fill that closed the order."},"pa":{"$ref":"#/components/schemas/DecimalInt256","description":"The position after this fill on a perp book. Omitted when no position moved."}}},"DecimalUint256":{"type":"string","pattern":"^[0-9]+$","description":"Unsigned 256-bit integer, decimal string"},"ActivityModify":{"type":"object","description":"A resting order's price and/or size changed in place. Sizes are unsigned.","required":["k","id","book","px","sz","old_px","old_sz"],"properties":{"k":{"type":"string","enum":["modify"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"px":{"$ref":"#/components/schemas/DecimalUint256"},"sz":{"$ref":"#/components/schemas/DecimalUint256"},"old_px":{"$ref":"#/components/schemas/DecimalUint256"},"old_sz":{"$ref":"#/components/schemas/DecimalUint256"}}},"ActivityTermination":{"type":"object","description":"An order left the book other than by filling.","required":["k","id","book","st"],"properties":{"k":{"type":"string","enum":["termination"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"st":{"type":"string","enum":["canceled","margin_canceled","self_trade_canceled","expired","post_only_refused"]}}},"ActivityBackstop":{"type":"object","description":"A perp position swept to the backstop (`book` set), or the terminal cash sweep (`book` omitted).","required":["k","sz","cash","mark","eq","pnl"],"properties":{"k":{"type":"string","enum":["backstop"]},"book":{"$ref":"#/components/schemas/Bytes32"},"sz":{"$ref":"#/components/schemas/DecimalInt256","description":"Position size moved."},"cash":{"$ref":"#/components/schemas/DecimalInt256"},"mark":{"$ref":"#/components/schemas/DecimalUint256","description":"Mark price at the sweep."},"eq":{"$ref":"#/components/schemas/DecimalInt256","description":"Account equity at the sweep."},"pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Realized PnL; `\"0\"` on the cash sweep."}}},"ActivityBridgeTransfer":{"type":"object","description":"A bridge deposit (positive `amt`) or withdrawal (negative). `err` set means it was\nrefused and nothing moved.\n","required":["k","tx","idx","tok","amt"],"properties":{"k":{"type":"string","enum":["bridge_transfer"]},"tx":{"$ref":"#/components/schemas/Bytes32","description":"The bridge transaction."},"idx":{"type":"integer","description":"Position among the tick's deposits; `0` for a withdrawal."},"tok":{"$ref":"#/components/schemas/Address"},"amt":{"$ref":"#/components/schemas/DecimalInt256"},"err":{"type":"string"}}},"ActivityTransfer":{"type":"object","description":"An account-to-account transfer, signed from the account's side: debit negative, credit\npositive. A self-transfer is two entries, the debit first. A refused transfer is reported\nto the sender only, with `err`.\n","required":["k","id","cp","tok","amt"],"properties":{"k":{"type":"string","enum":["transfer"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Transfer id."},"cp":{"$ref":"#/components/schemas/Address","description":"The other side of the transfer, the receiver when `amt` is negative and the sender otherwise; the account itself on a self-transfer."},"tok":{"$ref":"#/components/schemas/Address"},"amt":{"$ref":"#/components/schemas/DecimalInt256"},"err":{"type":"string"}}},"ActivityModifyReject":{"type":"object","description":"An amendment the engine refused; the order is untouched. `px` and `sz` are what was asked for, `sz` unsigned.","required":["k","id","book","px","sz","why"],"properties":{"k":{"type":"string","enum":["modify_reject"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"px":{"$ref":"#/components/schemas/DecimalUint256"},"sz":{"$ref":"#/components/schemas/DecimalUint256"},"why":{"type":"string","description":"The engine's reason."}}},"ActivityCancelReject":{"type":"object","description":"A cancel the engine refused; the order still rests.","required":["k","id","book","why"],"properties":{"k":{"type":"string","enum":["cancel_reject"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"why":{"type":"string","description":"The engine's reason."}}}}}}
```

## The ActivityEntry object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityEntry":{"description":"One activity entry, discriminated by `k`. Amounts and prices are 1e18-scaled decimal\nstrings. Optional fields are omitted rather than `null`; boolean flags are omitted when\nfalse. Ignore kinds and fields you do not recognise.\n","oneOf":[{"$ref":"#/components/schemas/ActivityOrder"},{"$ref":"#/components/schemas/ActivityFill"},{"$ref":"#/components/schemas/ActivityModify"},{"$ref":"#/components/schemas/ActivityTermination"},{"$ref":"#/components/schemas/ActivityBackstop"},{"$ref":"#/components/schemas/ActivityBridgeTransfer"},{"$ref":"#/components/schemas/ActivityTransfer"},{"$ref":"#/components/schemas/ActivityModifyReject"},{"$ref":"#/components/schemas/ActivityCancelReject"}],"discriminator":{"propertyName":"k","mapping":{"order":"#/components/schemas/ActivityOrder","fill":"#/components/schemas/ActivityFill","modify":"#/components/schemas/ActivityModify","termination":"#/components/schemas/ActivityTermination","backstop":"#/components/schemas/ActivityBackstop","bridge_transfer":"#/components/schemas/ActivityBridgeTransfer","transfer":"#/components/schemas/ActivityTransfer","modify_reject":"#/components/schemas/ActivityModifyReject","cancel_reject":"#/components/schemas/ActivityCancelReject"}}},"ActivityOrder":{"description":"The order as `/clob/orders/{account}` serves it, at the batch that admitted it, in its\ncurrent state. On the `pod_activity` channel it is the admission state instead:\n`active`, or `invalid` with `invalid_reason`, zero totals and `fills: []`. ADL closes\nappear as orders with `kind` `adl` or `adl_counterparty`; backstop sweeps appear only\nas `backstop` entries.\n","allOf":[{"type":"object","required":["k"],"properties":{"k":{"type":"string","enum":["order"]}}},{"$ref":"#/components/schemas/Order"}]},"Order":{"type":"object","description":"An order with its fills. Unsigned amounts and prices are 1e18-scaled `0x` hex,\nsigned ones decimal strings. Perp-only fields are omitted on spot orders.\n","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"market_type":{"$ref":"#/components/schemas/MarketType"},"kind":{"$ref":"#/components/schemas/OrderKind"},"order_id":{"$ref":"#/components/schemas/Bytes32"},"tx_hash":{"$ref":"#/components/schemas/Bytes32","description":"Creating transaction. Zero for engine-generated orders."},"bidder":{"$ref":"#/components/schemas/Address"},"nonce":{"type":"integer","format":"int64"},"order_type":{"type":"string","enum":["limit","market"]},"status":{"$ref":"#/components/schemas/OrderStatus"},"side":{"type":"string","enum":["buy","sell"]},"price":{"$ref":"#/components/schemas/HexUint256"},"initial_size":{"$ref":"#/components/schemas/DecimalInt256","description":"Signed; positive buy/long, negative sell/short."},"filled_base_amount":{"$ref":"#/components/schemas/HexUint256"},"filled_quote_amount":{"$ref":"#/components/schemas/HexUint256"},"fee":{"$ref":"#/components/schemas/HexUint256"},"deadline":{"$ref":"#/components/schemas/TimestampString","description":"The batch the order targets, microseconds, as a string."},"end":{"$ref":"#/components/schemas/Timestamp","description":"TTL expiry, microseconds. Orders that never expire carry `18446744073709551615`, which exceeds a JavaScript safe integer."},"included_batch":{"$ref":"#/components/schemas/Timestamp","description":"Deadline of the batch that first included the order. `0` for engine-generated orders and older rows."},"invalid_reason":{"type":"string","description":"Why the engine rejected the order. Only when `status` is `invalid`."},"effective_price":{"$ref":"#/components/schemas/HexUint256","description":"`filled_quote / filled_base` so far."},"fills":{"type":"array","items":{"$ref":"#/components/schemas/PartialFill"},"description":"Always present, oldest first."},"reduce_only":{"type":"boolean","description":"Perp only."},"ioc":{"type":"boolean","description":"Perp only."},"post_only":{"type":"boolean","description":"Omitted when false."},"direction":{"$ref":"#/components/schemas/OrderDirection"},"realized_pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Perp only, present once a fill closed exposure. Price drift minus funding across the slices it closed."},"grouping":{"$ref":"#/components/schemas/TriggerGrouping","description":"Inherited from the parent trigger. Omitted when `none`."},"trigger_type":{"$ref":"#/components/schemas/TriggerType","description":"Set only on orders a fired trigger produced (`kind` `triggered`)."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"MarketType":{"type":"string","enum":["spot","perpetual"]},"OrderKind":{"type":"string","enum":["user_signed","liquidation","triggered","adl","adl_counterparty","backstop_transfer"],"description":"- `user_signed`: submitted by the account\n- `liquidation`: generated by the engine when the account fell below maintenance margin\n- `triggered`: the order a fired TP/SL trigger produced\n- `adl`: auto-deleveraging close of this account's position\n- `adl_counterparty`: this account's side covering an auto-deleveraging close\n- `backstop_transfer`: a backstop sweep of this account's position, shown as a terminal order\n"},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"OrderStatus":{"type":"string","enum":["pending","active","filled","expired","canceled","margin_canceled","self_trade_canceled","post_only_refused","invalid"],"description":"- `pending`: submitted, not yet in the book\n- `active`: resting in the book\n- `filled`: completely filled\n- `expired`: TTL passed\n- `canceled`: canceled by the owner\n- `margin_canceled`: removed by the engine because the owner's margin was exhausted\n- `self_trade_canceled`: removed by the engine because it was about to fill against an order of the same owner\n- `post_only_refused`: a `post_only` order removed because it would have taken liquidity in the batch that admitted it\n- `invalid`: rejected at execution and never entered the book; see `invalid_reason`\n\nEverything except `pending` and `active` is terminal.\n"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"},"TimestampString":{"type":"string","pattern":"^[0-9]+$","description":"Unix time in microseconds, as a decimal string"},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"},"PartialFill":{"type":"object","properties":{"base_amount":{"$ref":"#/components/schemas/HexUint256"},"quote_amount":{"$ref":"#/components/schemas/HexUint256"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"price":{"$ref":"#/components/schemas/HexUint256","description":"The batch's clearing price; the order's own price for ADL fills."}}},"OrderDirection":{"type":"string","enum":["buy","sell","open_long","add_long","reduce_long","close_long","open_short","add_short","reduce_short","close_short","long_to_short","short_to_long","liquidation"],"description":"Spot orders use `buy`/`sell`. Perp orders use the position effect of their fills; `liquidation` when `kind` is `liquidation`."},"TriggerGrouping":{"type":"string","enum":["none","asset"],"description":"- `none`: standalone; removed only by cancel, TTL expiry or its own fire\n- `asset`: removed, with any resting order it produced, once the owner's position on the pair (perp) or base holding (spot) reaches zero\n"},"TriggerType":{"type":"string","enum":["take_profit","stop_loss"]},"ActivityFill":{"type":"object","description":"One fill of an order. `tb`, `tq`, `tf`, `f` and `st` are omitted on rows indexed before they\nwere recorded.\n","required":["k","id","book","b","q"],"properties":{"k":{"type":"string","enum":["fill"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"b":{"$ref":"#/components/schemas/DecimalUint256","description":"Base filled by this fill."},"q":{"$ref":"#/components/schemas/DecimalUint256","description":"Quote filled by this fill."},"tb":{"$ref":"#/components/schemas/DecimalUint256","description":"Order's total base filled after this fill."},"tq":{"$ref":"#/components/schemas/DecimalUint256","description":"Order's total quote filled after this fill."},"tf":{"$ref":"#/components/schemas/DecimalUint256","description":"Order's total fee after this fill."},"f":{"$ref":"#/components/schemas/DecimalUint256","description":"Fee charged by this fill."},"st":{"type":"string","enum":["filled","canceled","margin_canceled","self_trade_canceled","expired","post_only_refused"],"description":"Terminal status, present only on the fill that closed the order."},"pa":{"$ref":"#/components/schemas/DecimalInt256","description":"The position after this fill on a perp book. Omitted when no position moved."}}},"DecimalUint256":{"type":"string","pattern":"^[0-9]+$","description":"Unsigned 256-bit integer, decimal string"},"ActivityModify":{"type":"object","description":"A resting order's price and/or size changed in place. Sizes are unsigned.","required":["k","id","book","px","sz","old_px","old_sz"],"properties":{"k":{"type":"string","enum":["modify"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"px":{"$ref":"#/components/schemas/DecimalUint256"},"sz":{"$ref":"#/components/schemas/DecimalUint256"},"old_px":{"$ref":"#/components/schemas/DecimalUint256"},"old_sz":{"$ref":"#/components/schemas/DecimalUint256"}}},"ActivityTermination":{"type":"object","description":"An order left the book other than by filling.","required":["k","id","book","st"],"properties":{"k":{"type":"string","enum":["termination"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"st":{"type":"string","enum":["canceled","margin_canceled","self_trade_canceled","expired","post_only_refused"]}}},"ActivityBackstop":{"type":"object","description":"A perp position swept to the backstop (`book` set), or the terminal cash sweep (`book` omitted).","required":["k","sz","cash","mark","eq","pnl"],"properties":{"k":{"type":"string","enum":["backstop"]},"book":{"$ref":"#/components/schemas/Bytes32"},"sz":{"$ref":"#/components/schemas/DecimalInt256","description":"Position size moved."},"cash":{"$ref":"#/components/schemas/DecimalInt256"},"mark":{"$ref":"#/components/schemas/DecimalUint256","description":"Mark price at the sweep."},"eq":{"$ref":"#/components/schemas/DecimalInt256","description":"Account equity at the sweep."},"pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Realized PnL; `\"0\"` on the cash sweep."}}},"ActivityBridgeTransfer":{"type":"object","description":"A bridge deposit (positive `amt`) or withdrawal (negative). `err` set means it was\nrefused and nothing moved.\n","required":["k","tx","idx","tok","amt"],"properties":{"k":{"type":"string","enum":["bridge_transfer"]},"tx":{"$ref":"#/components/schemas/Bytes32","description":"The bridge transaction."},"idx":{"type":"integer","description":"Position among the tick's deposits; `0` for a withdrawal."},"tok":{"$ref":"#/components/schemas/Address"},"amt":{"$ref":"#/components/schemas/DecimalInt256"},"err":{"type":"string"}}},"ActivityTransfer":{"type":"object","description":"An account-to-account transfer, signed from the account's side: debit negative, credit\npositive. A self-transfer is two entries, the debit first. A refused transfer is reported\nto the sender only, with `err`.\n","required":["k","id","cp","tok","amt"],"properties":{"k":{"type":"string","enum":["transfer"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Transfer id."},"cp":{"$ref":"#/components/schemas/Address","description":"The other side of the transfer, the receiver when `amt` is negative and the sender otherwise; the account itself on a self-transfer."},"tok":{"$ref":"#/components/schemas/Address"},"amt":{"$ref":"#/components/schemas/DecimalInt256"},"err":{"type":"string"}}},"ActivityModifyReject":{"type":"object","description":"An amendment the engine refused; the order is untouched. `px` and `sz` are what was asked for, `sz` unsigned.","required":["k","id","book","px","sz","why"],"properties":{"k":{"type":"string","enum":["modify_reject"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"px":{"$ref":"#/components/schemas/DecimalUint256"},"sz":{"$ref":"#/components/schemas/DecimalUint256"},"why":{"type":"string","description":"The engine's reason."}}},"ActivityCancelReject":{"type":"object","description":"A cancel the engine refused; the order still rests.","required":["k","id","book","why"],"properties":{"k":{"type":"string","enum":["cancel_reject"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"why":{"type":"string","description":"The engine's reason."}}}}}}
```

## The ActivityOrder object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityOrder":{"description":"The order as `/clob/orders/{account}` serves it, at the batch that admitted it, in its\ncurrent state. On the `pod_activity` channel it is the admission state instead:\n`active`, or `invalid` with `invalid_reason`, zero totals and `fills: []`. ADL closes\nappear as orders with `kind` `adl` or `adl_counterparty`; backstop sweeps appear only\nas `backstop` entries.\n","allOf":[{"type":"object","required":["k"],"properties":{"k":{"type":"string","enum":["order"]}}},{"$ref":"#/components/schemas/Order"}]},"Order":{"type":"object","description":"An order with its fills. Unsigned amounts and prices are 1e18-scaled `0x` hex,\nsigned ones decimal strings. Perp-only fields are omitted on spot orders.\n","properties":{"orderbook_id":{"$ref":"#/components/schemas/Bytes32"},"market_type":{"$ref":"#/components/schemas/MarketType"},"kind":{"$ref":"#/components/schemas/OrderKind"},"order_id":{"$ref":"#/components/schemas/Bytes32"},"tx_hash":{"$ref":"#/components/schemas/Bytes32","description":"Creating transaction. Zero for engine-generated orders."},"bidder":{"$ref":"#/components/schemas/Address"},"nonce":{"type":"integer","format":"int64"},"order_type":{"type":"string","enum":["limit","market"]},"status":{"$ref":"#/components/schemas/OrderStatus"},"side":{"type":"string","enum":["buy","sell"]},"price":{"$ref":"#/components/schemas/HexUint256"},"initial_size":{"$ref":"#/components/schemas/DecimalInt256","description":"Signed; positive buy/long, negative sell/short."},"filled_base_amount":{"$ref":"#/components/schemas/HexUint256"},"filled_quote_amount":{"$ref":"#/components/schemas/HexUint256"},"fee":{"$ref":"#/components/schemas/HexUint256"},"deadline":{"$ref":"#/components/schemas/TimestampString","description":"The batch the order targets, microseconds, as a string."},"end":{"$ref":"#/components/schemas/Timestamp","description":"TTL expiry, microseconds. Orders that never expire carry `18446744073709551615`, which exceeds a JavaScript safe integer."},"included_batch":{"$ref":"#/components/schemas/Timestamp","description":"Deadline of the batch that first included the order. `0` for engine-generated orders and older rows."},"invalid_reason":{"type":"string","description":"Why the engine rejected the order. Only when `status` is `invalid`."},"effective_price":{"$ref":"#/components/schemas/HexUint256","description":"`filled_quote / filled_base` so far."},"fills":{"type":"array","items":{"$ref":"#/components/schemas/PartialFill"},"description":"Always present, oldest first."},"reduce_only":{"type":"boolean","description":"Perp only."},"ioc":{"type":"boolean","description":"Perp only."},"post_only":{"type":"boolean","description":"Omitted when false."},"direction":{"$ref":"#/components/schemas/OrderDirection"},"realized_pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Perp only, present once a fill closed exposure. Price drift minus funding across the slices it closed."},"grouping":{"$ref":"#/components/schemas/TriggerGrouping","description":"Inherited from the parent trigger. Omitted when `none`."},"trigger_type":{"$ref":"#/components/schemas/TriggerType","description":"Set only on orders a fired trigger produced (`kind` `triggered`)."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"MarketType":{"type":"string","enum":["spot","perpetual"]},"OrderKind":{"type":"string","enum":["user_signed","liquidation","triggered","adl","adl_counterparty","backstop_transfer"],"description":"- `user_signed`: submitted by the account\n- `liquidation`: generated by the engine when the account fell below maintenance margin\n- `triggered`: the order a fired TP/SL trigger produced\n- `adl`: auto-deleveraging close of this account's position\n- `adl_counterparty`: this account's side covering an auto-deleveraging close\n- `backstop_transfer`: a backstop sweep of this account's position, shown as a terminal order\n"},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"OrderStatus":{"type":"string","enum":["pending","active","filled","expired","canceled","margin_canceled","self_trade_canceled","post_only_refused","invalid"],"description":"- `pending`: submitted, not yet in the book\n- `active`: resting in the book\n- `filled`: completely filled\n- `expired`: TTL passed\n- `canceled`: canceled by the owner\n- `margin_canceled`: removed by the engine because the owner's margin was exhausted\n- `self_trade_canceled`: removed by the engine because it was about to fill against an order of the same owner\n- `post_only_refused`: a `post_only` order removed because it would have taken liquidity in the batch that admitted it\n- `invalid`: rejected at execution and never entered the book; see `invalid_reason`\n\nEverything except `pending` and `active` is terminal.\n"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"},"TimestampString":{"type":"string","pattern":"^[0-9]+$","description":"Unix time in microseconds, as a decimal string"},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"},"PartialFill":{"type":"object","properties":{"base_amount":{"$ref":"#/components/schemas/HexUint256"},"quote_amount":{"$ref":"#/components/schemas/HexUint256"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"price":{"$ref":"#/components/schemas/HexUint256","description":"The batch's clearing price; the order's own price for ADL fills."}}},"OrderDirection":{"type":"string","enum":["buy","sell","open_long","add_long","reduce_long","close_long","open_short","add_short","reduce_short","close_short","long_to_short","short_to_long","liquidation"],"description":"Spot orders use `buy`/`sell`. Perp orders use the position effect of their fills; `liquidation` when `kind` is `liquidation`."},"TriggerGrouping":{"type":"string","enum":["none","asset"],"description":"- `none`: standalone; removed only by cancel, TTL expiry or its own fire\n- `asset`: removed, with any resting order it produced, once the owner's position on the pair (perp) or base holding (spot) reaches zero\n"},"TriggerType":{"type":"string","enum":["take_profit","stop_loss"]}}}}
```

## The ActivityFill object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityFill":{"type":"object","description":"One fill of an order. `tb`, `tq`, `tf`, `f` and `st` are omitted on rows indexed before they\nwere recorded.\n","required":["k","id","book","b","q"],"properties":{"k":{"type":"string","enum":["fill"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"b":{"$ref":"#/components/schemas/DecimalUint256","description":"Base filled by this fill."},"q":{"$ref":"#/components/schemas/DecimalUint256","description":"Quote filled by this fill."},"tb":{"$ref":"#/components/schemas/DecimalUint256","description":"Order's total base filled after this fill."},"tq":{"$ref":"#/components/schemas/DecimalUint256","description":"Order's total quote filled after this fill."},"tf":{"$ref":"#/components/schemas/DecimalUint256","description":"Order's total fee after this fill."},"f":{"$ref":"#/components/schemas/DecimalUint256","description":"Fee charged by this fill."},"st":{"type":"string","enum":["filled","canceled","margin_canceled","self_trade_canceled","expired","post_only_refused"],"description":"Terminal status, present only on the fill that closed the order."},"pa":{"$ref":"#/components/schemas/DecimalInt256","description":"The position after this fill on a perp book. Omitted when no position moved."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"DecimalUint256":{"type":"string","pattern":"^[0-9]+$","description":"Unsigned 256-bit integer, decimal string"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"}}}}
```

## The ActivityModify object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityModify":{"type":"object","description":"A resting order's price and/or size changed in place. Sizes are unsigned.","required":["k","id","book","px","sz","old_px","old_sz"],"properties":{"k":{"type":"string","enum":["modify"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"px":{"$ref":"#/components/schemas/DecimalUint256"},"sz":{"$ref":"#/components/schemas/DecimalUint256"},"old_px":{"$ref":"#/components/schemas/DecimalUint256"},"old_sz":{"$ref":"#/components/schemas/DecimalUint256"}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"DecimalUint256":{"type":"string","pattern":"^[0-9]+$","description":"Unsigned 256-bit integer, decimal string"}}}}
```

## The ActivityTermination object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityTermination":{"type":"object","description":"An order left the book other than by filling.","required":["k","id","book","st"],"properties":{"k":{"type":"string","enum":["termination"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"st":{"type":"string","enum":["canceled","margin_canceled","self_trade_canceled","expired","post_only_refused"]}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."}}}}
```

## The ActivityBackstop object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityBackstop":{"type":"object","description":"A perp position swept to the backstop (`book` set), or the terminal cash sweep (`book` omitted).","required":["k","sz","cash","mark","eq","pnl"],"properties":{"k":{"type":"string","enum":["backstop"]},"book":{"$ref":"#/components/schemas/Bytes32"},"sz":{"$ref":"#/components/schemas/DecimalInt256","description":"Position size moved."},"cash":{"$ref":"#/components/schemas/DecimalInt256"},"mark":{"$ref":"#/components/schemas/DecimalUint256","description":"Mark price at the sweep."},"eq":{"$ref":"#/components/schemas/DecimalInt256","description":"Account equity at the sweep."},"pnl":{"$ref":"#/components/schemas/DecimalInt256","description":"Realized PnL; `\"0\"` on the cash sweep."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"},"DecimalUint256":{"type":"string","pattern":"^[0-9]+$","description":"Unsigned 256-bit integer, decimal string"}}}}
```

## The ActivityBridgeTransfer object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityBridgeTransfer":{"type":"object","description":"A bridge deposit (positive `amt`) or withdrawal (negative). `err` set means it was\nrefused and nothing moved.\n","required":["k","tx","idx","tok","amt"],"properties":{"k":{"type":"string","enum":["bridge_transfer"]},"tx":{"$ref":"#/components/schemas/Bytes32","description":"The bridge transaction."},"idx":{"type":"integer","description":"Position among the tick's deposits; `0` for a withdrawal."},"tok":{"$ref":"#/components/schemas/Address"},"amt":{"$ref":"#/components/schemas/DecimalInt256"},"err":{"type":"string"}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"}}}}
```

## The ActivityTransfer object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityTransfer":{"type":"object","description":"An account-to-account transfer, signed from the account's side: debit negative, credit\npositive. A self-transfer is two entries, the debit first. A refused transfer is reported\nto the sender only, with `err`.\n","required":["k","id","cp","tok","amt"],"properties":{"k":{"type":"string","enum":["transfer"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Transfer id."},"cp":{"$ref":"#/components/schemas/Address","description":"The other side of the transfer, the receiver when `amt` is negative and the sender otherwise; the account itself on a self-transfer."},"tok":{"$ref":"#/components/schemas/Address"},"amt":{"$ref":"#/components/schemas/DecimalInt256"},"err":{"type":"string"}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"DecimalInt256":{"type":"string","pattern":"^-?[0-9]+$","description":"Signed 256-bit integer, decimal string"}}}}
```

## The ActivityModifyReject object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityModifyReject":{"type":"object","description":"An amendment the engine refused; the order is untouched. `px` and `sz` are what was asked for, `sz` unsigned.","required":["k","id","book","px","sz","why"],"properties":{"k":{"type":"string","enum":["modify_reject"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"px":{"$ref":"#/components/schemas/DecimalUint256"},"sz":{"$ref":"#/components/schemas/DecimalUint256"},"why":{"type":"string","description":"The engine's reason."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"DecimalUint256":{"type":"string","pattern":"^[0-9]+$","description":"Unsigned 256-bit integer, decimal string"}}}}
```

## The ActivityCancelReject object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ActivityCancelReject":{"type":"object","description":"A cancel the engine refused; the order still rests.","required":["k","id","book","why"],"properties":{"k":{"type":"string","enum":["cancel_reject"]},"id":{"$ref":"#/components/schemas/Bytes32","description":"Order id."},"book":{"$ref":"#/components/schemas/Bytes32"},"why":{"type":"string","description":"The engine's reason."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."}}}}
```

## The ExplorerTransaction object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"ExplorerTransaction":{"type":"object","description":"Receipt fields merged with Ethereum JSON transaction fields (receipt wins on\noverlap; the receipt's `transactionHash` is dropped for the transaction's `hash`),\nplus `attestations`, `committee_epoch` and `decoded`. Block fields are absent or\n`null` while the transaction is served from the recent cache.\n","additionalProperties":true,"properties":{"hash":{"$ref":"#/components/schemas/Bytes32"},"from":{"$ref":"#/components/schemas/Address"},"to":{"$ref":"#/components/schemas/Address"},"nonce":{"type":"string","description":"`0x` hex"},"input":{"type":"string","description":"`0x` hex calldata"},"status":{"type":"string","description":"`0x1` success, `0x0` failure"},"blockNumber":{"type":"string","nullable":true},"blockHash":{"type":"string","nullable":true},"transactionIndex":{"type":"string","nullable":true},"logs":{"type":"array","items":{"type":"object"}},"attestations":{"type":"array","items":{"type":"object","properties":{"validator_address":{"$ref":"#/components/schemas/Address"},"sequence_number":{"type":"integer","format":"int64"},"batch_index":{"type":"integer"},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"signature":{"type":"string"}}}},"committee_epoch":{"type":"integer","format":"int64"},"decoded":{"$ref":"#/components/schemas/DecodedCalldata"}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"Timestamp":{"type":"integer","format":"int64","description":"Unix time in microseconds, as a JSON number"},"DecodedCalldata":{"type":"object","description":"Calldata decoded against Pod's precompiles. For an unrecognized target or\nselector, `contract` is `null` and only `selector` and `raw` are set.\n","properties":{"contract":{"type":"string","nullable":true},"address":{"$ref":"#/components/schemas/Address"},"symbol":{"type":"string"},"function":{"type":"string"},"args":{"type":"object","additionalProperties":true},"order_id":{"$ref":"#/components/schemas/Bytes32","description":"Resting order id the call creates (`submitOrder`, `submitTrigger`)."},"sequence":{"type":"integer","description":"Position inside the parent `submitBatch`."},"intents":{"type":"array","description":"Decoded sub-intents of a `submitBatch`.","items":{"type":"object"}},"selector":{"type":"string","description":"4-byte selector, `0x` hex."},"raw":{"type":"string","description":"Raw calldata, `0x` hex."}}}}}}
```

## The DecodedCalldata object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"DecodedCalldata":{"type":"object","description":"Calldata decoded against Pod's precompiles. For an unrecognized target or\nselector, `contract` is `null` and only `selector` and `raw` are set.\n","properties":{"contract":{"type":"string","nullable":true},"address":{"$ref":"#/components/schemas/Address"},"symbol":{"type":"string"},"function":{"type":"string"},"args":{"type":"object","additionalProperties":true},"order_id":{"$ref":"#/components/schemas/Bytes32","description":"Resting order id the call creates (`submitOrder`, `submitTrigger`)."},"sequence":{"type":"integer","description":"Position inside the parent `submitBatch`."},"intents":{"type":"array","description":"Decoded sub-intents of a `submitBatch`.","items":{"type":"object"}},"selector":{"type":"string","description":"4-byte selector, `0x` hex."},"raw":{"type":"string","description":"Raw calldata, `0x` hex."}}},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."}}}}
```

## The BridgeConfig object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"BridgeConfig":{"type":"object","properties":{"claim_chain_id":{"type":"integer","format":"int64","description":"The one chain withdrawals are claimable on. `0` when no bridge is configured."},"source_contract":{"$ref":"#/components/schemas/Address","description":"Bridge contract on that chain. Zero address when no bridge is configured."},"version":{"type":"integer","format":"int64","description":"Bridge version; feeds the claim-hash domain separator."},"tokens":{"type":"array","description":"Every bridged token, ordered by `pod_token`. The only source of the Pod-token to bridged-chain-token mapping. Empty when no bridge is configured.","items":{"type":"object","properties":{"pod_token":{"$ref":"#/components/schemas/Address"},"l1_token":{"$ref":"#/components/schemas/Address"},"decimals":{"type":"integer","description":"Decimals on the bridged chain. A withdrawal amount must be a multiple of `10^(18 - decimals)` wei."},"min":{"$ref":"#/components/schemas/HexUint256","description":"Minimum withdrawal, bridged-chain decimals."},"max":{"$ref":"#/components/schemas/HexUint256","description":"Maximum withdrawal, bridged-chain decimals."}}}}}},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"}}}}
```

## The Withdrawal object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"Withdrawal":{"type":"object","description":"One withdrawal outcome, as `pod_withdrawals` delivers it.","required":["tx_hash","withdrawer","to","token","amount","timestamp_us"],"properties":{"tx_hash":{"$ref":"#/components/schemas/Bytes32","description":"The withdraw transaction's hash, the withdrawal's id."},"withdrawer":{"$ref":"#/components/schemas/Address","description":"The debited account; the master for a delegated withdrawal."},"to":{"$ref":"#/components/schemas/Address","description":"Recipient on the bridged chain."},"token":{"$ref":"#/components/schemas/Address","description":"Pod-side token."},"amount":{"$ref":"#/components/schemas/HexUint256","description":"Pod's 18 decimals, as signed. `claim` takes `proof.amount`."},"error":{"type":"string","enum":["insufficient_balance","not_included"],"description":"Why the withdrawal was refused. Omitted otherwise."},"timestamp_us":{"type":"integer","format":"int64","description":"The tick's batch deadline, microseconds. Also the `since` cursor."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"}}}}
```

## The WithdrawalDetail object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"WithdrawalDetail":{"type":"object","required":["withdrawal","status"],"properties":{"withdrawal":{"$ref":"#/components/schemas/Withdrawal"},"status":{"type":"string","enum":["claimable","pending","refused"],"description":"May gain values. Treat an unfamiliar one as `pending`."},"proof":{"$ref":"#/components/schemas/BridgeClaimProof"}}},"Withdrawal":{"type":"object","description":"One withdrawal outcome, as `pod_withdrawals` delivers it.","required":["tx_hash","withdrawer","to","token","amount","timestamp_us"],"properties":{"tx_hash":{"$ref":"#/components/schemas/Bytes32","description":"The withdraw transaction's hash, the withdrawal's id."},"withdrawer":{"$ref":"#/components/schemas/Address","description":"The debited account; the master for a delegated withdrawal."},"to":{"$ref":"#/components/schemas/Address","description":"Recipient on the bridged chain."},"token":{"$ref":"#/components/schemas/Address","description":"Pod-side token."},"amount":{"$ref":"#/components/schemas/HexUint256","description":"Pod's 18 decimals, as signed. `claim` takes `proof.amount`."},"error":{"type":"string","enum":["insufficient_balance","not_included"],"description":"Why the withdrawal was refused. Omitted otherwise."},"timestamp_us":{"type":"integer","format":"int64","description":"The tick's batch deadline, microseconds. Also the `since` cursor."}}},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"BridgeClaimProof":{"type":"object","description":"Present exactly when `status` is `claimable`. Everything `claim(token, amount, to,\nproof, auxTxSuffix)` needs, except `token`: map the Pod-side `token` here to\n`l1_token` from `/bridge/config`.\n","required":["proof","committee_epoch","aux_tx_suffix"],"properties":{"proof":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255},"description":"Certificate (`0x00` then one 65-byte signature per signer, by ascending signer address) or, for a withdrawal from before a bridge version bump, a Merkle proof."},"committee_epoch":{"type":"integer","format":"int64","description":"Currently always `0`."},"aux_tx_suffix":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255},"description":"The withdrawal's id (its tx hash) as bytes."},"token":{"$ref":"#/components/schemas/Address","description":"Pod-side token. Omitted on legacy rows."},"amount":{"$ref":"#/components/schemas/HexUint256","description":"In the token's bridged-chain decimals; pass straight to `claim`. Omitted on legacy rows."},"to":{"$ref":"#/components/schemas/Address","description":"Recipient on the bridged chain. Omitted on legacy rows."},"claim_hash":{"$ref":"#/components/schemas/Bytes32","description":"The key `Bridge.processedRequests` uses; check it to see whether the claim already landed."}}}}}}
```

## The BridgeClaimProof object

```json
{"openapi":"3.0.0","info":{"title":"REST API","version":"1.0.0"},"components":{"schemas":{"BridgeClaimProof":{"type":"object","description":"Present exactly when `status` is `claimable`. Everything `claim(token, amount, to,\nproof, auxTxSuffix)` needs, except `token`: map the Pod-side `token` here to\n`l1_token` from `/bridge/config`.\n","required":["proof","committee_epoch","aux_tx_suffix"],"properties":{"proof":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255},"description":"Certificate (`0x00` then one 65-byte signature per signer, by ascending signer address) or, for a withdrawal from before a bridge version bump, a Merkle proof."},"committee_epoch":{"type":"integer","format":"int64","description":"Currently always `0`."},"aux_tx_suffix":{"type":"array","items":{"type":"integer","minimum":0,"maximum":255},"description":"The withdrawal's id (its tx hash) as bytes."},"token":{"$ref":"#/components/schemas/Address","description":"Pod-side token. Omitted on legacy rows."},"amount":{"$ref":"#/components/schemas/HexUint256","description":"In the token's bridged-chain decimals; pass straight to `claim`. Omitted on legacy rows."},"to":{"$ref":"#/components/schemas/Address","description":"Recipient on the bridged chain. Omitted on legacy rows."},"claim_hash":{"$ref":"#/components/schemas/Bytes32","description":"The key `Bridge.processedRequests` uses; check it to see whether the claim already landed."}}},"Address":{"type":"string","pattern":"^0x[a-fA-F0-9]{40}$","description":"20-byte address, `0x` hex"},"HexUint256":{"type":"string","pattern":"^0x[a-fA-F0-9]+$","description":"Unsigned 256-bit integer, `0x` hex"},"Bytes32":{"type":"string","pattern":"^0x[a-fA-F0-9]{64}$","description":"32-byte value, `0x` hex. Orderbook ids, order ids and hashes."}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.v2.pod.network/guides-references/references/rest/models.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
