# Models

## The RequestError object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"RequestError":{"title":"RequestError","$id":"#RequestError","type":"object","required":["error","message"],"properties":{"error":{"$ref":"#/components/schemas/RequestErrorCode"},"message":{"type":"string","description":"Human-readable error message"}},"additionalProperties":true},"RequestErrorCode":{"title":"RequestErrorCode","$id":"#RequestErrorCode","type":"string","enum":["SYMBOL_NOT_FOUND","NO_ACCOUNTS_FOUND","NO_PRICES_FOUND_FOR_SYMBOL","INPUT_VALIDATION_ERROR","CREATE_ORDER_OTHER_ERROR","CANCEL_ORDER_OTHER_ERROR","ORDER_DEADLINE_PASSED_ERROR","ORDER_DEADLINE_TOO_HIGH_ERROR","INVALID_NONCE_ERROR","UNAVAILABLE_MATCHING_ENGINE_ERROR","UNAUTHORIZED_SIGNATURE_ERROR","NUMERIC_OVERFLOW_ERROR"],"description":"Standardized error codes for API responses"}}}}
```

## The ServerError object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"ServerError":{"title":"ServerError","$id":"#ServerError","type":"object","required":["error","message"],"properties":{"error":{"$ref":"#/components/schemas/ServerErrorCode"},"message":{"type":"string","description":"Human-readable error message"}},"additionalProperties":true},"ServerErrorCode":{"title":"ServerErrorCode","$id":"#ServerErrorCode","type":"string","enum":["INTERNAL_SERVER_ERROR"],"description":"Standardized error codes for API responses"}}}}
```

## The MarketDefinition object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"MarketDefinition":{"title":"MarketDefinition","$id":"#MarketDefinition","type":"object","required":["symbol","marketId","minOrderQty","qtyStepSize","tickSize","liquidationMarginParameter","initialMarginParameter","maxLeverage","oiCap"],"properties":{"symbol":{"$ref":"#/components/schemas/Symbol"},"marketId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Numerical identifier for each market, only needed to generate signatures"},"minOrderQty":{"$ref":"#/components/schemas/UnsignedDecimal"},"qtyStepSize":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Minimum size increment"},"tickSize":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Minimum price increment"},"liquidationMarginParameter":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Minimum percentage of notional that needs to be covered to avoid liquidation procedures for a given market; below this value, your account is subject to liquidation procedures. When cross margining, all requirements across markets are covered by the same balance, and all positions are subject to liquidations."},"initialMarginParameter":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Minimum percentage of notional that needs to be covered post trade; if the account does not satisfy this requirement, trades will not get executed."},"maxLeverage":{"$ref":"#/components/schemas/UnsignedInteger","description":"Maximum leverage allowed"},"oiCap":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Maximum one-sided open interest in units for a given market."}},"additionalProperties":true},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The SpotMarketDefinition object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"SpotMarketDefinition":{"title":"SpotMarketDefinition","$id":"#SpotMarketDefinition","type":"object","required":["symbol","marketId","baseAsset","quoteAsset","minOrderQty","qtyStepSize","tickSize"],"properties":{"symbol":{"$ref":"#/components/schemas/Symbol"},"marketId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Numerical identifier for each spot market"},"baseAsset":{"type":"string","description":"Base asset symbol"},"quoteAsset":{"type":"string","description":"Quote asset symbol"},"minOrderQty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Minimum order quantity (base asset)"},"qtyStepSize":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Minimum size increment (base asset)"},"tickSize":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Minimum price increment"}},"additionalProperties":true},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The AssetDefinition object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"AssetDefinition":{"title":"AssetDefinition","$id":"#AssetDefinition","type":"object","required":["asset","priceHaircut","liquidationDiscount","status","decimals","displayDecimals"],"properties":{"asset":{"$ref":"#/components/schemas/Asset"},"spotMarketSymbol":{"$ref":"#/components/schemas/Symbol"},"priceHaircut":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Notional discount to the value of a collateral when used to satisfy the margin requirements; it does not imply any token conversion, but is rather an accounting adjustment."},"liquidationDiscount":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Discount in the token price when liquidating collateral."},"status":{"type":"string","enum":["ENABLED","WITHDRAWAL_ONLY"],"description":"Status of asset (ENABLED = deposits and withdrawals allowed, WITHDRAWAL_ONLY = only withdrawals allowed)"},"decimals":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of decimal places for record keeping amounts of this asset (e.g. 18 for ETH, 6 for RUSD)"},"displayDecimals":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of decimal places shown for display purposes in frontends"}},"additionalProperties":true},"Asset":{"title":"Asset","$id":"#Asset","type":"string","pattern":"^[A-Za-z0-9]+$"},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0}}}}
```

## The FeeTierParameters object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"FeeTierParameters":{"title":"FeeTierParameters","$id":"#FeeTierParameters","type":"object","required":["tierId","takerFee","makerFee","volume14d","tierType"],"properties":{"tierId":{"$ref":"#/components/schemas/UnsignedInteger"},"takerFee":{"$ref":"#/components/schemas/SignedDecimal","description":"Taker fee rate (fee will be qty * takerFee)"},"makerFee":{"$ref":"#/components/schemas/SignedDecimal","description":"Maker fee rate (fee will be qty * makerFee)"},"volume14d":{"$ref":"#/components/schemas/UnsignedDecimal","description":"14-day volume level required this fee tier to be applied to a wallet"},"tierType":{"$ref":"#/components/schemas/TierType"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"TierType":{"title":"TierType","$id":"#TierType","type":"string","enum":["REGULAR","VIP"],"description":"Fee tier type (REGULAR = Standard tier, VIP = VIP tier)"}}}}
```

## The GlobalFeeParameters object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"GlobalFeeParameters":{"title":"GlobalFeeParameters","$id":"#GlobalFeeParameters","type":"object","required":["ogDiscount","refereeDiscount","referrerRebate","affiliateReferrerRebate"],"properties":{"ogDiscount":{"$ref":"#/components/schemas/UnsignedDecimal","description":"OG user discount"},"refereeDiscount":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Referee discount"},"referrerRebate":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Referrer rebate"},"affiliateReferrerRebate":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Affiliate referrer rebate"}},"additionalProperties":true},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The LiquidityParameters object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"LiquidityParameters":{"title":"LiquidityParameters","$id":"#LiquidityParameters","type":"object","required":["symbol","depth","velocityMultiplier"],"properties":{"symbol":{"$ref":"#/components/schemas/Symbol"},"depth":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Parameter determining the liquidity distribution along the AMM pricing curve, in particular expanding or contracting the max exposure parameter that would otherwise be determined by the capital available."},"velocityMultiplier":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Parameter determining the sensitivity of the dynamic funding rate to the size of the imbalances; higher multiplier means that the funding rate will diverge faster, all else being equal."}},"additionalProperties":true},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The WalletConfiguration object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"WalletConfiguration":{"title":"WalletConfiguration","$id":"#WalletConfiguration","type":"object","required":["feeTierId","ogStatus","affiliateStatus","refereeStatus"],"properties":{"feeTierId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Fee tier identifier"},"ogStatus":{"type":"boolean","description":"OG status"},"affiliateStatus":{"type":"boolean","description":"Affiliate status"},"refereeStatus":{"type":"boolean","description":"Referee status"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0}}}}
```

## The MarketSummary object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"MarketSummary":{"title":"MarketSummary","$id":"#MarketSummary","type":"object","required":["symbol","updatedAt","longOiQty","shortOiQty","oiQty","fundingRate","longFundingValue","shortFundingValue","fundingRateVelocity","volume24h"],"properties":{"symbol":{"$ref":"#/components/schemas/Symbol"},"updatedAt":{"$ref":"#/components/schemas/UnsignedInteger","description":"Time when the market summary was last calculated (milliseconds)"},"longOiQty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Long open interest in lots"},"shortOiQty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Short open interest in lots"},"oiQty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Total open interest quantity"},"fundingRate":{"$ref":"#/components/schemas/SignedDecimal","description":"Current hourly funding rate"},"longFundingValue":{"$ref":"#/components/schemas/SignedDecimal","description":"Current reference value of funding accrued by one unit of exposure; there is one funding value per market and per direction, with short v long funding values differing possibly due to Auto-Deleveraging (ADL)"},"shortFundingValue":{"$ref":"#/components/schemas/SignedDecimal","description":"Current reference value of funding accrued by one unit of exposure; there is one funding value per market and per direction, with short v long funding values differing possibly due to Auto-Deleveraging (ADL)"},"fundingRateVelocity":{"$ref":"#/components/schemas/SignedDecimal","description":"Funding rate velocity"},"volume24h":{"$ref":"#/components/schemas/UnsignedDecimal"},"pxChange24h":{"$ref":"#/components/schemas/SignedDecimal"},"throttledOraclePrice":{"$ref":"#/components/schemas/SignedDecimal","description":"Last oracle price, at the moment of the last market summary update"},"throttledPoolPrice":{"$ref":"#/components/schemas/SignedDecimal","description":"Last pool price, at the moment of the last market summary update"},"pricesUpdatedAt":{"$ref":"#/components/schemas/UnsignedInteger","description":"Timestamp of the last price update (milliseconds)"}},"additionalProperties":true},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The SpotMarketSummary object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"SpotMarketSummary":{"title":"SpotMarketSummary","$id":"#SpotMarketSummary","type":"object","required":["symbol","updatedAt","volume24h"],"properties":{"symbol":{"$ref":"#/components/schemas/Symbol"},"updatedAt":{"$ref":"#/components/schemas/UnsignedInteger","description":"Time when the spot market summary was last calculated (milliseconds)"},"volume24h":{"$ref":"#/components/schemas/UnsignedDecimal","description":"24-hour trading volume in USD"},"pxChange24h":{"$ref":"#/components/schemas/SignedDecimal","description":"Absolute 24-hour price change"},"oraclePrice":{"$ref":"#/components/schemas/SignedDecimal","description":"Current oracle price"}},"additionalProperties":true},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The Position object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Position":{"title":"Position","$id":"#Position","type":"object","required":["exchangeId","symbol","accountId","qty","side","avgEntryPrice","avgEntryFundingValue","lastTradeSequenceNumber"],"properties":{"exchangeId":{"$ref":"#/components/schemas/UnsignedInteger"},"symbol":{"$ref":"#/components/schemas/Symbol"},"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal"},"side":{"$ref":"#/components/schemas/Side"},"avgEntryPrice":{"$ref":"#/components/schemas/SignedDecimal"},"avgEntryFundingValue":{"$ref":"#/components/schemas/SignedDecimal","description":"Average of funding values at the entry times of currently open exposure, which serves as a baseline from which to compute the accrued funding in the position: units x (fundingValue - avgEntryFundingValue)"},"lastTradeSequenceNumber":{"$ref":"#/components/schemas/UnsignedInteger","description":"Sequence number of last execution taken into account for the position."}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"Side":{"title":"Side","$id":"#Side","type":"string","enum":["B","A"],"description":"Order side (B = Buy/Bid, A = Ask/Sell)"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The Order object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Order":{"title":"Order","$id":"#Order","type":"object","required":["exchangeId","symbol","accountId","orderId","side","limitPx","orderType","status","createdAt","lastUpdateAt"],"properties":{"exchangeId":{"$ref":"#/components/schemas/UnsignedInteger"},"symbol":{"$ref":"#/components/schemas/Symbol"},"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"orderId":{"type":"string"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal"},"execQty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Executed quantity in the current order update."},"cumQty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Total Executed quantity accross all fills where the order is involved."},"side":{"$ref":"#/components/schemas/Side"},"limitPx":{"$ref":"#/components/schemas/SignedDecimal"},"orderType":{"$ref":"#/components/schemas/OrderType"},"triggerPx":{"$ref":"#/components/schemas/SignedDecimal","description":"Price at which TP/SL orders will be triggered, should not be set for other order types."},"timeInForce":{"$ref":"#/components/schemas/TimeInForce","description":"Order time in force, exclusively used for LIMIT orders"},"reduceOnly":{"type":"boolean","description":"Whether this is a reduce-only order, exclusively used for LIMIT IOC orders."},"status":{"$ref":"#/components/schemas/OrderStatus"},"createdAt":{"$ref":"#/components/schemas/UnsignedInteger","description":"Creation timestamp (milliseconds)"},"lastUpdateAt":{"$ref":"#/components/schemas/UnsignedInteger","description":"Last update timestamp (milliseconds)"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"Side":{"title":"Side","$id":"#Side","type":"string","enum":["B","A"],"description":"Order side (B = Buy/Bid, A = Ask/Sell)"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"OrderType":{"title":"OrderType","$id":"#OrderType","type":"string","enum":["LIMIT","TP","SL"],"description":"Order type, (LIMIT = Limit, TP = Take Profit, SL = Stop Loss)"},"TimeInForce":{"title":"TimeInForce","$id":"#TimeInForce","type":"string","enum":["IOC","GTC"],"description":"Order time in force (IOC = Immediate or Cancel, GTC = Good Till Cancel)"},"OrderStatus":{"title":"OrderStatus","$id":"#OrderStatus","type":"string","enum":["OPEN","FILLED","CANCELLED","REJECTED"],"description":"Order status"}}}}
```

## The Account object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Account":{"title":"Account","$id":"#Account","type":"object","required":["accountId","name","type"],"properties":{"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"name":{"type":"string"},"type":{"$ref":"#/components/schemas/AccountType"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"AccountType":{"title":"AccountType","$id":"#AccountType","type":"string","enum":["MAINPERP","SUBPERP","SPOT"],"description":"SPOT = account that can only trade spot, MAINPERP = main perp account, SUBPERP = sub perp account"}}}}
```

## The AccountBalance object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"AccountBalance":{"title":"AccountBalance","$id":"#AccountBalance","type":"object","required":["accountId","asset","realBalance","balanceDEPRECATED"],"properties":{"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"asset":{"$ref":"#/components/schemas/Asset"},"realBalance":{"$ref":"#/components/schemas/SignedDecimal","description":"Sum of account net deposits (transfers, deposits and withdrawals) and realized pnl from closed positions. Realized pnl only applies to RUSD given it is the only settlement asset"},"balanceDEPRECATED":{"$ref":"#/components/schemas/SignedDecimal","description":"Sum of account net deposits (transfers, deposits and withdrawals). This field is deprecated and will be removed in a future release"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Asset":{"title":"Asset","$id":"#Asset","type":"string","pattern":"^[A-Za-z0-9]+$"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The PerpExecutionList object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"PerpExecutionList":{"title":"PerpExecutionList","$id":"#PerpExecutionList","type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PerpExecution"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"additionalProperties":true},"PerpExecution":{"title":"PerpExecution","$id":"#PerpExecution","type":"object","required":["exchangeId","symbol","accountId","qty","side","fee","price","type","timestamp","sequenceNumber"],"properties":{"exchangeId":{"$ref":"#/components/schemas/UnsignedInteger"},"symbol":{"$ref":"#/components/schemas/Symbol"},"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal"},"side":{"$ref":"#/components/schemas/Side"},"price":{"$ref":"#/components/schemas/SignedDecimal"},"fee":{"$ref":"#/components/schemas/SignedDecimal","description":"Total execution fee in rUSD"},"openingFee":{"$ref":"#/components/schemas/SignedDecimal","description":"Opening fee portion of the total fee in rUSD. Absent for position-extending executions."},"type":{"$ref":"#/components/schemas/ExecutionType"},"timestamp":{"$ref":"#/components/schemas/UnsignedInteger","description":"Execution timestamp (milliseconds)"},"sequenceNumber":{"$ref":"#/components/schemas/UnsignedInteger","description":"Execution sequence number, increases by 1 for every perp execution in reya chain"},"realizedPnl":{"$ref":"#/components/schemas/SignedDecimal","description":"Realized PnL from this execution in rUSD (priceVariationPnl + fundingPnl). Absent for position-extending executions."},"priceVariationPnl":{"$ref":"#/components/schemas/SignedDecimal","description":"PnL component from price movement in rUSD. Absent for position-extending executions."},"fundingPnl":{"$ref":"#/components/schemas/SignedDecimal","description":"PnL component from funding payments in rUSD. Absent for position-extending executions."}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"Side":{"title":"Side","$id":"#Side","type":"string","enum":["B","A"],"description":"Order side (B = Buy/Bid, A = Ask/Sell)"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"ExecutionType":{"title":"ExecutionType","$id":"#ExecutionType","type":"string","enum":["ORDER_MATCH","LIQUIDATION","ADL"],"description":"Type of execution"},"PaginationMeta":{"title":"PaginationMeta","$id":"#PaginationMeta","type":"object","required":["limit","count"],"properties":{"limit":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of items requested"},"count":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of items returned"},"endTime":{"$ref":"#/components/schemas/UnsignedInteger","description":"Timestamp of last result, in milliseconds"},"startTime":{"$ref":"#/components/schemas/UnsignedInteger","description":"Timestamp of first result, in milliseconds"}},"additionalProperties":true}}}}
```

## The SpotExecutionList object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"SpotExecutionList":{"title":"SpotExecutionList","$id":"#SpotExecutionList","type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SpotExecution"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"additionalProperties":true},"SpotExecution":{"title":"SpotExecution","$id":"#SpotExecution","type":"object","required":["symbol","accountId","makerAccountId","qty","side","fee","price","type","timestamp","sequenceNumber"],"properties":{"exchangeId":{"$ref":"#/components/schemas/UnsignedInteger"},"symbol":{"$ref":"#/components/schemas/Symbol"},"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"makerAccountId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Maker account ID (counterparty)"},"orderId":{"type":"string","description":"Order ID for the taker"},"makerOrderId":{"type":"string","description":"Order ID for the maker"},"side":{"$ref":"#/components/schemas/Side"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal"},"price":{"$ref":"#/components/schemas/SignedDecimal"},"fee":{"$ref":"#/components/schemas/SignedDecimal"},"type":{"$ref":"#/components/schemas/ExecutionType"},"timestamp":{"$ref":"#/components/schemas/UnsignedInteger","description":"Execution timestamp (milliseconds)"},"sequenceNumber":{"$ref":"#/components/schemas/UnsignedInteger","description":"Execution sequence number, increases by 1 for every spot execution in reya chain"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"Side":{"title":"Side","$id":"#Side","type":"string","enum":["B","A"],"description":"Order side (B = Buy/Bid, A = Ask/Sell)"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"ExecutionType":{"title":"ExecutionType","$id":"#ExecutionType","type":"string","enum":["ORDER_MATCH","LIQUIDATION","ADL"],"description":"Type of execution"},"PaginationMeta":{"title":"PaginationMeta","$id":"#PaginationMeta","type":"object","required":["limit","count"],"properties":{"limit":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of items requested"},"count":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of items returned"},"endTime":{"$ref":"#/components/schemas/UnsignedInteger","description":"Timestamp of last result, in milliseconds"},"startTime":{"$ref":"#/components/schemas/UnsignedInteger","description":"Timestamp of first result, in milliseconds"}},"additionalProperties":true}}}}
```

## The SpotExecutionBustList object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"SpotExecutionBustList":{"title":"SpotExecutionBustList","$id":"#SpotExecutionBustList","type":"object","required":["data","meta"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SpotExecutionBust"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"additionalProperties":true},"SpotExecutionBust":{"title":"SpotExecutionBust","$id":"#SpotExecutionBust","type":"object","required":["symbol","accountId","exchangeId","makerAccountId","orderId","makerOrderId","qty","side","price","reason","timestamp"],"properties":{"symbol":{"$ref":"#/components/schemas/Symbol"},"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"exchangeId":{"$ref":"#/components/schemas/UnsignedInteger"},"makerAccountId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Maker account ID (counterparty)"},"orderId":{"type":"string","description":"Order ID for the taker"},"makerOrderId":{"type":"string","description":"Order ID for the maker"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Failed base quantity"},"side":{"$ref":"#/components/schemas/Side"},"price":{"$ref":"#/components/schemas/SignedDecimal"},"reason":{"type":"string","description":"Hex-encoded revert reason bytes"},"timestamp":{"$ref":"#/components/schemas/UnsignedInteger","description":"Block timestamp (milliseconds)"}},"additionalProperties":true},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"Side":{"title":"Side","$id":"#Side","type":"string","enum":["B","A"],"description":"Order side (B = Buy/Bid, A = Ask/Sell)"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"PaginationMeta":{"title":"PaginationMeta","$id":"#PaginationMeta","type":"object","required":["limit","count"],"properties":{"limit":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of items requested"},"count":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of items returned"},"endTime":{"$ref":"#/components/schemas/UnsignedInteger","description":"Timestamp of last result, in milliseconds"},"startTime":{"$ref":"#/components/schemas/UnsignedInteger","description":"Timestamp of first result, in milliseconds"}},"additionalProperties":true}}}}
```

## The Price object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Price":{"title":"Price","$id":"#Price","type":"object","required":["symbol","updatedAt","oraclePrice"],"properties":{"symbol":{"$ref":"#/components/schemas/Symbol"},"oraclePrice":{"$ref":"#/components/schemas/SignedDecimal","description":"Price given by the Stork feeds, used both as the peg price for prices on Reya, as well as Mark Prices. The Stork price feed is usually the perp prices across three major CEXs"},"poolPrice":{"$ref":"#/components/schemas/SignedDecimal","description":"The price currently quoted by the AMM for zero volume, from which trades are priced (equivalent to mid price in an order book); a trade of any size will be move this price up or down depending on the direction."},"updatedAt":{"$ref":"#/components/schemas/UnsignedInteger","description":"Last update timestamp (milliseconds)"}},"additionalProperties":true},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0}}}}
```

## The CandleHistoryData object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"CandleHistoryData":{"title":"CandleHistoryData","$id":"#CandleHistoryData","type":"object","required":["t","o","h","l","c"],"properties":{"t":{"type":"array","items":{"$ref":"#/components/schemas/UnsignedInteger"},"description":"Array of timestamps (seconds)"},"o":{"type":"array","items":{"$ref":"#/components/schemas/SignedDecimal"},"description":"Array of opening prices"},"h":{"type":"array","items":{"$ref":"#/components/schemas/SignedDecimal"},"description":"Array of high prices"},"l":{"type":"array","items":{"$ref":"#/components/schemas/SignedDecimal"},"description":"Array of low prices"},"c":{"type":"array","items":{"$ref":"#/components/schemas/SignedDecimal"},"description":"Array of closing prices"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The CreateOrderRequest object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"CreateOrderRequest":{"title":"CreateOrderRequest","$id":"#CreateOrderRequest","type":"object","required":["exchangeId","accountId","isBuy","limitPx","orderType","signature","nonce","signerWallet"],"properties":{"exchangeId":{"$ref":"#/components/schemas/UnsignedInteger"},"symbol":{"$ref":"#/components/schemas/Symbol"},"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"isBuy":{"type":"boolean","description":"Whether this is a buy order"},"limitPx":{"$ref":"#/components/schemas/SignedDecimal"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal"},"orderType":{"$ref":"#/components/schemas/OrderType"},"timeInForce":{"$ref":"#/components/schemas/TimeInForce","description":"Order time in force, exclusively used for LIMIT orders"},"triggerPx":{"$ref":"#/components/schemas/SignedDecimal","description":"Trigger price, only for TP/SL orders"},"reduceOnly":{"type":"boolean","description":"Whether this is a reduce-only order, exclusively used for LIMIT IOC orders."},"signature":{"type":"string","description":"See signatures and nonces section for more details on how to generate."},"nonce":{"type":"string","description":"Order nonce, see signatures and nonces section for more details."},"signerWallet":{"$ref":"#/components/schemas/Address"},"expiresAfter":{"$ref":"#/components/schemas/UnsignedInteger","description":"Expiration timestamp (exclusively for PERP IOC orders and all SPOT orders). In seconds since epoch. The order will only be filled before this timestamp."},"clientOrderId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Client-provided order ID for tracking and correlation. Optional field that allows clients to assign their own unique identifier to orders."}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"OrderType":{"title":"OrderType","$id":"#OrderType","type":"string","enum":["LIMIT","TP","SL"],"description":"Order type, (LIMIT = Limit, TP = Take Profit, SL = Stop Loss)"},"TimeInForce":{"title":"TimeInForce","$id":"#TimeInForce","type":"string","enum":["IOC","GTC"],"description":"Order time in force (IOC = Immediate or Cancel, GTC = Good Till Cancel)"},"Address":{"title":"Address","$id":"#Address","type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}}}}
```

## The CreateOrderResponse object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"CreateOrderResponse":{"title":"CreateOrderResponse","$id":"#CreateOrderResponse","type":"object","required":["status"],"properties":{"status":{"$ref":"#/components/schemas/OrderStatus"},"execQty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Executed quantity in the current order update."},"cumQty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Total Executed quantity accross all fills where the order is involved."},"orderId":{"type":"string","description":"Created order ID (currently generated for all order types except IOC)"},"clientOrderId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Client-provided order ID echoed back from the request"}},"additionalProperties":true},"OrderStatus":{"title":"OrderStatus","$id":"#OrderStatus","type":"string","enum":["OPEN","FILLED","CANCELLED","REJECTED"],"description":"Order status"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0}}}}
```

## The CancelOrderRequest object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"CancelOrderRequest":{"title":"CancelOrderRequest","$id":"#CancelOrderRequest","type":"object","required":["signature"],"properties":{"orderId":{"type":"string","description":"Internal matching engine order ID to cancel. Provide either orderId OR clientOrderId, not both. For spot markets, this is the order ID returned in the CreateOrderResponse."},"clientOrderId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Client-provided order ID for tracking and correlation. Provide either orderId OR clientOrderId, not both. This is the same clientOrderId provided in CreateOrderRequest."},"accountId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Account ID that owns the order. Required for spot markets."},"symbol":{"$ref":"#/components/schemas/Symbol","description":"Market symbol for the order.Required for spot market orders. If not provided, assumes perp market for backwards compatibility."},"signature":{"type":"string","description":"See signatures section for more details on how to generate."},"nonce":{"type":"string","description":"See signatures and nonces section for more details. Compulsory for spot orders."},"expiresAfter":{"$ref":"#/components/schemas/UnsignedInteger","description":"Expiration timestamp (exclusively for SPOT orders). In seconds since epoch."}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"}}}}
```

## The CancelOrderResponse object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"CancelOrderResponse":{"title":"CancelOrderResponse","$id":"#CancelOrderResponse","type":"object","required":["status","orderId"],"properties":{"status":{"$ref":"#/components/schemas/OrderStatus"},"orderId":{"type":"string","description":"Cancelled order ID"},"clientOrderId":{"type":"integer","description":"Client-provided order ID echoed back from the request"}},"additionalProperties":true},"OrderStatus":{"title":"OrderStatus","$id":"#OrderStatus","type":"string","enum":["OPEN","FILLED","CANCELLED","REJECTED"],"description":"Order status"}}}}
```

## The MassCancelRequest object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"MassCancelRequest":{"title":"MassCancelRequest","$id":"#MassCancelRequest","type":"object","required":["signature","nonce","accountId","expiresAfter"],"properties":{"accountId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Account ID to cancel orders for."},"symbol":{"$ref":"#/components/schemas/Symbol","description":"Symbol to cancel orders for. If not specified, cancels orders for all symbols."},"signature":{"type":"string","description":"See signatures and nonces section for more details on how to generate."},"nonce":{"type":"string","description":"See signatures and nonces section for more details."},"expiresAfter":{"$ref":"#/components/schemas/UnsignedInteger","description":"Expiration timestamp. In seconds since epoch."}},"additionalProperties":true,"description":"Request to cancel all orders matching the specified filters"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"}}}}
```

## The MassCancelResponse object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"MassCancelResponse":{"title":"MassCancelResponse","$id":"#MassCancelResponse","type":"object","required":["cancelledCount"],"properties":{"cancelledCount":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of orders that were cancelled"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0}}}}
```

## The Depth object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Depth":{"title":"Depth","$id":"#Depth","type":"object","required":["symbol","type","bids","asks","updatedAt"],"properties":{"symbol":{"$ref":"#/components/schemas/Symbol"},"type":{"$ref":"#/components/schemas/DepthType"},"bids":{"type":"array","description":"Bid side levels aggregated by price, sorted descending by price","items":{"$ref":"#/components/schemas/Level"}},"asks":{"type":"array","description":"Ask side levels aggregated by price, sorted ascending by price","items":{"$ref":"#/components/schemas/Level"}},"updatedAt":{"$ref":"#/components/schemas/UnsignedInteger","description":"Snapshot generation timestamp (milliseconds)"}},"additionalProperties":true},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"DepthType":{"title":"DepthType","$id":"#DepthType","type":"string","enum":["SNAPSHOT","UPDATE"],"description":"Depth message type (SNAPSHOT = full book, UPDATE = single level change)"},"Level":{"title":"Level","$id":"#Level","type":"object","required":["px","qty"],"properties":{"px":{"$ref":"#/components/schemas/SignedDecimal","description":"Price level"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Aggregated quantity at this price level"}},"additionalProperties":true},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0}}}}
```

## The ServerErrorCode object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"ServerErrorCode":{"title":"ServerErrorCode","$id":"#ServerErrorCode","type":"string","enum":["INTERNAL_SERVER_ERROR"],"description":"Standardized error codes for API responses"}}}}
```

## The Symbol object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"}}}}
```

## The UnsignedInteger object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0}}}}
```

## The UnsignedDecimal object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The RequestErrorCode object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"RequestErrorCode":{"title":"RequestErrorCode","$id":"#RequestErrorCode","type":"string","enum":["SYMBOL_NOT_FOUND","NO_ACCOUNTS_FOUND","NO_PRICES_FOUND_FOR_SYMBOL","INPUT_VALIDATION_ERROR","CREATE_ORDER_OTHER_ERROR","CANCEL_ORDER_OTHER_ERROR","ORDER_DEADLINE_PASSED_ERROR","ORDER_DEADLINE_TOO_HIGH_ERROR","INVALID_NONCE_ERROR","UNAVAILABLE_MATCHING_ENGINE_ERROR","UNAUTHORIZED_SIGNATURE_ERROR","NUMERIC_OVERFLOW_ERROR"],"description":"Standardized error codes for API responses"}}}}
```

## The SignedDecimal object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The Asset object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Asset":{"title":"Asset","$id":"#Asset","type":"string","pattern":"^[A-Za-z0-9]+$"}}}}
```

## The TierType object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"TierType":{"title":"TierType","$id":"#TierType","type":"string","enum":["REGULAR","VIP"],"description":"Fee tier type (REGULAR = Standard tier, VIP = VIP tier)"}}}}
```

## The Side object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Side":{"title":"Side","$id":"#Side","type":"string","enum":["B","A"],"description":"Order side (B = Buy/Bid, A = Ask/Sell)"}}}}
```

## The ExecutionType object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"ExecutionType":{"title":"ExecutionType","$id":"#ExecutionType","type":"string","enum":["ORDER_MATCH","LIQUIDATION","ADL"],"description":"Type of execution"}}}}
```

## The PerpExecution object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"PerpExecution":{"title":"PerpExecution","$id":"#PerpExecution","type":"object","required":["exchangeId","symbol","accountId","qty","side","fee","price","type","timestamp","sequenceNumber"],"properties":{"exchangeId":{"$ref":"#/components/schemas/UnsignedInteger"},"symbol":{"$ref":"#/components/schemas/Symbol"},"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal"},"side":{"$ref":"#/components/schemas/Side"},"price":{"$ref":"#/components/schemas/SignedDecimal"},"fee":{"$ref":"#/components/schemas/SignedDecimal","description":"Total execution fee in rUSD"},"openingFee":{"$ref":"#/components/schemas/SignedDecimal","description":"Opening fee portion of the total fee in rUSD. Absent for position-extending executions."},"type":{"$ref":"#/components/schemas/ExecutionType"},"timestamp":{"$ref":"#/components/schemas/UnsignedInteger","description":"Execution timestamp (milliseconds)"},"sequenceNumber":{"$ref":"#/components/schemas/UnsignedInteger","description":"Execution sequence number, increases by 1 for every perp execution in reya chain"},"realizedPnl":{"$ref":"#/components/schemas/SignedDecimal","description":"Realized PnL from this execution in rUSD (priceVariationPnl + fundingPnl). Absent for position-extending executions."},"priceVariationPnl":{"$ref":"#/components/schemas/SignedDecimal","description":"PnL component from price movement in rUSD. Absent for position-extending executions."},"fundingPnl":{"$ref":"#/components/schemas/SignedDecimal","description":"PnL component from funding payments in rUSD. Absent for position-extending executions."}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"Side":{"title":"Side","$id":"#Side","type":"string","enum":["B","A"],"description":"Order side (B = Buy/Bid, A = Ask/Sell)"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"ExecutionType":{"title":"ExecutionType","$id":"#ExecutionType","type":"string","enum":["ORDER_MATCH","LIQUIDATION","ADL"],"description":"Type of execution"}}}}
```

## The PaginationMeta object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"PaginationMeta":{"title":"PaginationMeta","$id":"#PaginationMeta","type":"object","required":["limit","count"],"properties":{"limit":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of items requested"},"count":{"$ref":"#/components/schemas/UnsignedInteger","description":"Number of items returned"},"endTime":{"$ref":"#/components/schemas/UnsignedInteger","description":"Timestamp of last result, in milliseconds"},"startTime":{"$ref":"#/components/schemas/UnsignedInteger","description":"Timestamp of first result, in milliseconds"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0}}}}
```

## The DepthType object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"DepthType":{"title":"DepthType","$id":"#DepthType","type":"string","enum":["SNAPSHOT","UPDATE"],"description":"Depth message type (SNAPSHOT = full book, UPDATE = single level change)"}}}}
```

## The Level object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Level":{"title":"Level","$id":"#Level","type":"object","required":["px","qty"],"properties":{"px":{"$ref":"#/components/schemas/SignedDecimal","description":"Price level"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Aggregated quantity at this price level"}},"additionalProperties":true},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The SpotExecution object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"SpotExecution":{"title":"SpotExecution","$id":"#SpotExecution","type":"object","required":["symbol","accountId","makerAccountId","qty","side","fee","price","type","timestamp","sequenceNumber"],"properties":{"exchangeId":{"$ref":"#/components/schemas/UnsignedInteger"},"symbol":{"$ref":"#/components/schemas/Symbol"},"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"makerAccountId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Maker account ID (counterparty)"},"orderId":{"type":"string","description":"Order ID for the taker"},"makerOrderId":{"type":"string","description":"Order ID for the maker"},"side":{"$ref":"#/components/schemas/Side"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal"},"price":{"$ref":"#/components/schemas/SignedDecimal"},"fee":{"$ref":"#/components/schemas/SignedDecimal"},"type":{"$ref":"#/components/schemas/ExecutionType"},"timestamp":{"$ref":"#/components/schemas/UnsignedInteger","description":"Execution timestamp (milliseconds)"},"sequenceNumber":{"$ref":"#/components/schemas/UnsignedInteger","description":"Execution sequence number, increases by 1 for every spot execution in reya chain"}},"additionalProperties":true},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"Side":{"title":"Side","$id":"#Side","type":"string","enum":["B","A"],"description":"Order side (B = Buy/Bid, A = Ask/Sell)"},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"ExecutionType":{"title":"ExecutionType","$id":"#ExecutionType","type":"string","enum":["ORDER_MATCH","LIQUIDATION","ADL"],"description":"Type of execution"}}}}
```

## The SpotExecutionBust object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"SpotExecutionBust":{"title":"SpotExecutionBust","$id":"#SpotExecutionBust","type":"object","required":["symbol","accountId","exchangeId","makerAccountId","orderId","makerOrderId","qty","side","price","reason","timestamp"],"properties":{"symbol":{"$ref":"#/components/schemas/Symbol"},"accountId":{"$ref":"#/components/schemas/UnsignedInteger"},"exchangeId":{"$ref":"#/components/schemas/UnsignedInteger"},"makerAccountId":{"$ref":"#/components/schemas/UnsignedInteger","description":"Maker account ID (counterparty)"},"orderId":{"type":"string","description":"Order ID for the taker"},"makerOrderId":{"type":"string","description":"Order ID for the maker"},"qty":{"$ref":"#/components/schemas/UnsignedDecimal","description":"Failed base quantity"},"side":{"$ref":"#/components/schemas/Side"},"price":{"$ref":"#/components/schemas/SignedDecimal"},"reason":{"type":"string","description":"Hex-encoded revert reason bytes"},"timestamp":{"$ref":"#/components/schemas/UnsignedInteger","description":"Block timestamp (milliseconds)"}},"additionalProperties":true},"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"UnsignedDecimal":{"title":"UnsignedDecimal","$id":"#UnsignedDecimal","type":"string","pattern":"^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"Side":{"title":"Side","$id":"#Side","type":"string","enum":["B","A"],"description":"Order side (B = Buy/Bid, A = Ask/Sell)"},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"}}}}
```

## The Address object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"Address":{"title":"Address","$id":"#Address","type":"string","pattern":"^0x[a-fA-F0-9]{40}$"}}}}
```

## The AccountType object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"AccountType":{"title":"AccountType","$id":"#AccountType","type":"string","enum":["MAINPERP","SUBPERP","SPOT"],"description":"SPOT = account that can only trade spot, MAINPERP = main perp account, SUBPERP = sub perp account"}}}}
```

## The OrderType object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"OrderType":{"title":"OrderType","$id":"#OrderType","type":"string","enum":["LIMIT","TP","SL"],"description":"Order type, (LIMIT = Limit, TP = Take Profit, SL = Stop Loss)"}}}}
```

## The TimeInForce object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"TimeInForce":{"title":"TimeInForce","$id":"#TimeInForce","type":"string","enum":["IOC","GTC"],"description":"Order time in force (IOC = Immediate or Cancel, GTC = Good Till Cancel)"}}}}
```

## The OrderStatus object

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"components":{"schemas":{"OrderStatus":{"title":"OrderStatus","$id":"#OrderStatus","type":"string","enum":["OPEN","FILLED","CANCELLED","REJECTED"],"description":"Order status"}}}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.reya.xyz/technical-docs/reya-dex-rest-api-v2/models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
