# Market Data

Prices, market-level trades, depth, candles, etc.

## Get spot market summaries

> Statistics and throttled market data for all spot markets. Recalculated every 0.5s

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/spotMarkets/summary":{"get":{"summary":"Get spot market summaries","description":"Statistics and throttled market data for all spot markets. Recalculated every 0.5s","operationId":"getSpotMarketsSummary","tags":["Market Data"],"responses":{"200":{"description":"List of spot market summaries","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SpotMarketSummary"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"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+)?$"},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## Get spot market summary

> Statistics and throttled market data for a specific spot market. Recalculated every 0.5s

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/spotMarket/{symbol}/summary":{"get":{"summary":"Get spot market summary","description":"Statistics and throttled market data for a specific spot market. Recalculated every 0.5s","operationId":"getSpotMarketSummary","tags":["Market Data"],"parameters":[{"$ref":"#/components/parameters/SymbolParam"}],"responses":{"200":{"description":"Spot market summary data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotMarketSummary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"parameters":{"SymbolParam":{"name":"symbol","in":"path","required":true,"description":"Trading symbol (e.g., BTCRUSDPERP)","schema":{"$ref":"#/components/schemas/Symbol"}}},"schemas":{"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"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},"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+)?$"},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## Get market summaries

> Statistics and throttled market data for all markets. Recalculated every 0.5s

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/markets/summary":{"get":{"summary":"Get market summaries","description":"Statistics and throttled market data for all markets. Recalculated every 0.5s","operationId":"getMarketsSummary","tags":["Market Data"],"responses":{"200":{"description":"List of market summaries","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MarketSummary"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"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+)?$"},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## Get market summary

> Statistics and throttled data for a specific market. Recalculated every 0.5s

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/market/{symbol}/summary":{"get":{"summary":"Get market summary","description":"Statistics and throttled data for a specific market. Recalculated every 0.5s","operationId":"getMarketSummary","tags":["Market Data"],"parameters":[{"$ref":"#/components/parameters/SymbolParam"}],"responses":{"200":{"description":"Market summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarketSummary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"parameters":{"SymbolParam":{"name":"symbol","in":"path","required":true,"description":"Trading symbol (e.g., BTCRUSDPERP)","schema":{"$ref":"#/components/schemas/Symbol"}}},"schemas":{"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"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},"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+)?$"},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## GET /prices

> Get all prices

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/prices":{"get":{"summary":"Get all prices","operationId":"getPrices","tags":["Market Data"],"responses":{"200":{"description":"List of prices","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Price"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"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},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## GET /prices/{symbol}

> Get price by symbol

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/prices/{symbol}":{"get":{"summary":"Get price by symbol","operationId":"getPrice","tags":["Market Data"],"parameters":[{"$ref":"#/components/parameters/SymbolParam"}],"responses":{"200":{"description":"Price information","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"parameters":{"SymbolParam":{"name":"symbol","in":"path","required":true,"description":"Trading symbol (e.g., BTCRUSDPERP)","schema":{"$ref":"#/components/schemas/Symbol"}}},"schemas":{"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"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},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"UnsignedInteger":{"title":"UnsignedInteger","$id":"#UnsignedInteger","type":"integer","minimum":0},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## Get perp executions for market

> Returns up to 100 perp executions for a given market.

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/market/{symbol}/perpExecutions":{"get":{"summary":"Get perp executions for market","description":"Returns up to 100 perp executions for a given market.","operationId":"getMarketPerpExecutions","tags":["Market Data"],"parameters":[{"$ref":"#/components/parameters/SymbolParam"},{"$ref":"#/components/parameters/StartTimeParam"},{"$ref":"#/components/parameters/EndTimeParam"}],"responses":{"200":{"description":"List of perp executions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PerpExecutionList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"parameters":{"SymbolParam":{"name":"symbol","in":"path","required":true,"description":"Trading symbol (e.g., BTCRUSDPERP)","schema":{"$ref":"#/components/schemas/Symbol"}},"StartTimeParam":{"name":"startTime","in":"query","required":false,"description":"Return results at or after this timestamp, in milliseconds (for pagination)","schema":{"$ref":"#/components/schemas/UnsignedInteger"}},"EndTimeParam":{"name":"endTime","in":"query","required":false,"description":"Return results at or before this timestamp, in milliseconds (for pagination)","schema":{"$ref":"#/components/schemas/UnsignedInteger"}}},"schemas":{"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},"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},"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},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## Get market depth snapshot

> Returns an L2 order book snapshot with aggregated price levels for the specified market.

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/market/{symbol}/depth":{"get":{"summary":"Get market depth snapshot","description":"Returns an L2 order book snapshot with aggregated price levels for the specified market.","operationId":"getMarketDepth","tags":["Market Data"],"parameters":[{"$ref":"#/components/parameters/SymbolParam"}],"responses":{"200":{"description":"Depth snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Depth"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"parameters":{"SymbolParam":{"name":"symbol","in":"path","required":true,"description":"Trading symbol (e.g., BTCRUSDPERP)","schema":{"$ref":"#/components/schemas/Symbol"}}},"schemas":{"Symbol":{"title":"Symbol","$id":"#Symbol","type":"string","pattern":"^[A-Za-z0-9]+$","description":"Trading symbol (e.g., BTCRUSDPERP, WETHRUSD)"},"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},"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},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## Get spot executions for market

> Returns up to 100 spot executions for a given market.

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/market/{symbol}/spotExecutions":{"get":{"summary":"Get spot executions for market","description":"Returns up to 100 spot executions for a given market.","operationId":"getMarketSpotExecutions","tags":["Market Data"],"parameters":[{"$ref":"#/components/parameters/SymbolParam"},{"$ref":"#/components/parameters/StartTimeParam"},{"$ref":"#/components/parameters/EndTimeParam"}],"responses":{"200":{"description":"List of spot executions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotExecutionList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"parameters":{"SymbolParam":{"name":"symbol","in":"path","required":true,"description":"Trading symbol (e.g., BTCRUSDPERP)","schema":{"$ref":"#/components/schemas/Symbol"}},"StartTimeParam":{"name":"startTime","in":"query","required":false,"description":"Return results at or after this timestamp, in milliseconds (for pagination)","schema":{"$ref":"#/components/schemas/UnsignedInteger"}},"EndTimeParam":{"name":"endTime","in":"query","required":false,"description":"Return results at or before this timestamp, in milliseconds (for pagination)","schema":{"$ref":"#/components/schemas/UnsignedInteger"}}},"schemas":{"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},"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},"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},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## Get spot execution busts for market

> Returns up to 100 spot execution busts (failed spot fills) for a given market.

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/market/{symbol}/spotExecutionBusts":{"get":{"summary":"Get spot execution busts for market","description":"Returns up to 100 spot execution busts (failed spot fills) for a given market.","operationId":"getMarketSpotExecutionBusts","tags":["Market Data"],"parameters":[{"$ref":"#/components/parameters/SymbolParam"},{"$ref":"#/components/parameters/StartTimeParam"},{"$ref":"#/components/parameters/EndTimeParam"}],"responses":{"200":{"description":"List of spot execution busts","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SpotExecutionBustList"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"parameters":{"SymbolParam":{"name":"symbol","in":"path","required":true,"description":"Trading symbol (e.g., BTCRUSDPERP)","schema":{"$ref":"#/components/schemas/Symbol"}},"StartTimeParam":{"name":"startTime","in":"query","required":false,"description":"Return results at or after this timestamp, in milliseconds (for pagination)","schema":{"$ref":"#/components/schemas/UnsignedInteger"}},"EndTimeParam":{"name":"endTime","in":"query","required":false,"description":"Return results at or before this timestamp, in milliseconds (for pagination)","schema":{"$ref":"#/components/schemas/UnsignedInteger"}}},"schemas":{"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},"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},"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},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```

## Get historical candles

> Returns up to 200 candles for a given market, sorted by time in descending order, and ending at the specified end time.

```json
{"openapi":"3.0.3","info":{"title":"Reya DEX Trading API v2","version":"2.1.11"},"tags":[{"name":"Market Data","description":"Prices, market-level trades, depth, candles, etc."}],"servers":[{"url":"https://api.reya.xyz/v2","description":"Production server"},{"url":"https://api-test.reya.xyz/v2","description":"Testnet server"}],"paths":{"/candleHistory/{symbol}/{resolution}":{"get":{"summary":"Get historical candles","description":"Returns up to 200 candles for a given market, sorted by time in descending order, and ending at the specified end time.","operationId":"getCandles","tags":["Market Data"],"parameters":[{"$ref":"#/components/parameters/SymbolParam"},{"$ref":"#/components/parameters/ResolutionParam"},{"$ref":"#/components/parameters/EndTimeParam"}],"responses":{"200":{"description":"Historical candle data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CandleHistoryData"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"500":{"$ref":"#/components/responses/InternalServerError"}}}}},"components":{"parameters":{"SymbolParam":{"name":"symbol","in":"path","required":true,"description":"Trading symbol (e.g., BTCRUSDPERP)","schema":{"$ref":"#/components/schemas/Symbol"}},"ResolutionParam":{"name":"resolution","in":"path","required":true,"description":"Candle resolution","schema":{"type":"string","enum":["1m","5m","15m","30m","1h","4h","1d"]}},"EndTimeParam":{"name":"endTime","in":"query","required":false,"description":"Return results at or before this timestamp, in milliseconds (for pagination)","schema":{"$ref":"#/components/schemas/UnsignedInteger"}}},"schemas":{"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},"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},"SignedDecimal":{"title":"SignedDecimal","$id":"#Decimal","type":"string","pattern":"^-?\\d+(\\.\\d+)?([eE][+-]?\\d+)?$"},"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"},"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"}},"responses":{"BadRequest":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"InternalServerError":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServerError"}}}}}}}
```


---

# 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/developers/readme/market-data.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.
