> For the complete documentation index, see [llms.txt](https://lambdaplex-labs.gitbook.io/lambdaplex/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lambdaplex-labs.gitbook.io/lambdaplex/for-developers/api/order-books.md).

# Order Books

Market depths, trades, and prices

## Recent trades

> Returns recent public trades for a symbol, compatible with Binance's recent-trades response shape.\
> Trade IDs match the IDs published on the public \`\<symbol>@trade\` WebSocket stream.\
> \
> Data Source: Database.\
> \
> \
> \*\*Weight:\*\* 25\
> \
> This database-backed route also consumes one request from the shared\
> public-market-data pre-authentication IP bucket: \*\*5 requests/second\*\*\
> with a \*\*20 request burst\*\*. \`GET /api/v1/trades\` and \`GET /api/v1/avgPrice\` use the same bucket,\
> so alternating between them does not create additional database-read capacity.<br>

```json
{"openapi":"3.1.0","info":{"title":"Lambdaplex API","version":"1.0"},"tags":[{"name":"Order books","description":"Market depths, trades, and prices"}],"servers":[{"url":"https://api.lambdaplex.io","description":"Generated server url"}],"security":[],"paths":{"/api/v1/trades":{"get":{"tags":["Order books"],"summary":"Recent trades","description":"Returns recent public trades for a symbol, compatible with Binance's recent-trades response shape.\nTrade IDs match the IDs published on the public `<symbol>@trade` WebSocket stream.\n\nData Source: Database.\n\n\n**Weight:** 25\n\nThis database-backed route also consumes one request from the shared\npublic-market-data pre-authentication IP bucket: **5 requests/second**\nwith a **20 request burst**. `GET /api/v1/trades` and `GET /api/v1/avgPrice` use the same bucket,\nso alternating between them does not create additional database-read capacity.\n","operationId":"getRecentTrades","parameters":[{"name":"symbol","in":"query","description":"Trading pair symbol","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Number of trades to return. Default: 500; Max: 1000. Values above 1000 are clamped to 1000.","required":false,"schema":{"type":"integer","default":500,"maximum":1000,"minimum":1}}],"responses":{"200":{"description":"Recent trades, ordered from oldest to newest","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RecentTrade"}}}}},"400":{"description":"Limit is less than 1 or a required parameter is missing","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"404":{"description":"Symbol is invalid or unavailable to public market data","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Internal server error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"503":{"description":"Market metadata projections are temporarily unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}},"components":{"schemas":{"RecentTrade":{"type":"object","description":"A public trade from the market's recent trade tape","properties":{"id":{"type":"integer","format":"int64","description":"Durable trade cursor ID"},"price":{"type":"string","description":"Execution price"},"qty":{"type":"string","description":"Executed base-asset quantity"},"quoteQty":{"type":"string","description":"Executed quote-asset quantity"},"time":{"type":"integer","format":"int64","description":"Execution time in milliseconds since the Unix epoch"},"isBuyerMaker":{"type":"boolean","description":"Whether the buyer was the maker"},"isBestMatch":{"type":"boolean","description":"Whether the trade was the best price match"}},"required":["id","isBestMatch","isBuyerMaker","price","qty","quoteQty","time"]},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"},"properties":{"type":"object","additionalProperties":{}}}},"RateLimitError":{"type":"object","description":"Error response returned when a request is rate limited (HTTP 429)","properties":{"code":{"type":"string","description":"Error code indicating rate limiting"},"status":{"type":"integer","format":"int32","description":"HTTP status code"},"scope":{"type":"string","description":"Scope of the rate limit: 'rest' for HTTP endpoints, 'ws' for WebSocket handshake","enum":["rest","ws"]},"bucket":{"type":"string","description":"Bucket that triggered the limit (e.g. 'rest_weight', 'orders', 'ws_handshake')"},"keyType":{"type":"string","description":"Key type that was rate limited: 'ip' or 'api'","enum":["ip","api"]},"retryAfterSec":{"type":"number","format":"double","description":"Seconds until enough tokens are available to retry this request"}},"required":["bucket","code","keyType","retryAfterSec","scope","status"]}},"responses":{"RateLimited":{"description":"Too Many Requests - Rate limit exceeded.","headers":{"X-PLEX-USED-WEIGHT-API":{"description":"Current used weight for your API key this minute (if authenticated)","schema":{}},"Retry-After":{"description":"Number of seconds to wait before retrying","schema":{}},"X-PLEX-ORDER-COUNT":{"description":"Current order count for your API key (for order endpoints)","schema":{}},"X-PLEX-USED-WEIGHT-IP":{"description":"Current used weight for your IP this minute","schema":{}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}},"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}}}}}}}
```

## Latest price for a symbol or symbols

> Returns the latest price for a single symbol or multiple symbols.\
> \
> \*\*Weight:\*\*\
> \
> \| Parameter | Symbols Provided | Weight |\
> \|-----------|------------------|--------|\
> \| \`symbol\` | 1 | 2 |\
> \| \`symbol\` omitted | all | 4 |<br>

```json
{"openapi":"3.1.0","info":{"title":"Lambdaplex API","version":"1.0"},"tags":[{"name":"Order books","description":"Market depths, trades, and prices"}],"servers":[{"url":"https://api.lambdaplex.io","description":"Generated server url"}],"security":[],"paths":{"/api/v1/ticker/price":{"get":{"tags":["Order books"],"summary":"Latest price for a symbol or symbols","description":"Returns the latest price for a single symbol or multiple symbols.\n\n**Weight:**\n\n| Parameter | Symbols Provided | Weight |\n|-----------|------------------|--------|\n| `symbol` | 1 | 2 |\n| `symbol` omitted | all | 4 |\n","operationId":"getTickers","parameters":[{"name":"symbol","in":"query","description":"A single symbol","required":false,"schema":{"type":"string"}},{"name":"symbols","in":"query","description":"Comma-separated symbols","required":false,"style":"form","explode":false,"schema":{"type":"array","items":{"type":"string"}}}],"responses":{"200":{"description":"Single ticker if `symbol` is provided; otherwise array of tickers","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Ticker"},{"type":"array","items":{"$ref":"#/components/schemas/Ticker"}}]}}}},"400":{"description":"Cannot request both `symbol` and `symbols`","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"One or more symbols are invalid","content":{"application/json":{"schema":{"type":"object"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"503":{"description":"Service Unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}},"components":{"schemas":{"Ticker":{"type":"object","properties":{"symbol":{"type":"string"},"price":{"type":"number"}}},"RateLimitError":{"type":"object","description":"Error response returned when a request is rate limited (HTTP 429)","properties":{"code":{"type":"string","description":"Error code indicating rate limiting"},"status":{"type":"integer","format":"int32","description":"HTTP status code"},"scope":{"type":"string","description":"Scope of the rate limit: 'rest' for HTTP endpoints, 'ws' for WebSocket handshake","enum":["rest","ws"]},"bucket":{"type":"string","description":"Bucket that triggered the limit (e.g. 'rest_weight', 'orders', 'ws_handshake')"},"keyType":{"type":"string","description":"Key type that was rate limited: 'ip' or 'api'","enum":["ip","api"]},"retryAfterSec":{"type":"number","format":"double","description":"Seconds until enough tokens are available to retry this request"}},"required":["bucket","code","keyType","retryAfterSec","scope","status"]},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"},"properties":{"type":"object","additionalProperties":{}}}}},"responses":{"RateLimited":{"description":"Too Many Requests - Rate limit exceeded.","headers":{"X-PLEX-USED-WEIGHT-API":{"description":"Current used weight for your API key this minute (if authenticated)","schema":{}},"Retry-After":{"description":"Number of seconds to wait before retrying","schema":{}},"X-PLEX-ORDER-COUNT":{"description":"Current order count for your API key (for order endpoints)","schema":{}},"X-PLEX-USED-WEIGHT-IP":{"description":"Current used weight for your IP this minute","schema":{}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}},"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}}}}}}}
```

## Point-in-time limit-order percent-price admission state

> Evaluates the same policy path used by placement and returns its reference, side-specific bounds, fail behavior, exact market identity, and book evidence. Placement re-evaluates against then-current state; this response is not an admission token. A valid symbol returns 200 when the percent-price check is enforced, explicitly bypassed, or blocked. Every response path is non-cacheable.\
> \
> \*\*Weight:\*\* 2\
> \
> This correctness-critical read also has a dedicated per-IP bucket:\
> \*\*5 requests/second\*\* with a \*\*20 request burst\*\*. HTTP 429 means\
> the caller must back off.<br>

```json
{"openapi":"3.1.0","info":{"title":"Lambdaplex API","version":"1.0"},"tags":[{"name":"Order books","description":"Market depths, trades, and prices"}],"servers":[{"url":"https://api.lambdaplex.io","description":"Generated server url"}],"security":[],"paths":{"/api/v1/ticker/limitPriceAdmissionState":{"get":{"tags":["Order books"],"summary":"Point-in-time limit-order percent-price admission state","description":"Evaluates the same policy path used by placement and returns its reference, side-specific bounds, fail behavior, exact market identity, and book evidence. Placement re-evaluates against then-current state; this response is not an admission token. A valid symbol returns 200 when the percent-price check is enforced, explicitly bypassed, or blocked. Every response path is non-cacheable.\n\n**Weight:** 2\n\nThis correctness-critical read also has a dedicated per-IP bucket:\n**5 requests/second** with a **20 request burst**. HTTP 429 means\nthe caller must back off.\n","operationId":"getLimitPriceAdmissionState","parameters":[{"name":"symbol","in":"query","description":"Canonical trading pair symbol","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current effective limit-price admission state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LimitPriceAdmissionState"}}}},"404":{"description":"Symbol is invalid","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Admission evaluation failed unexpectedly","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"503":{"description":"A required admission dependency is temporarily unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}},"components":{"schemas":{"LimitPriceAdmissionState":{"type":"object","allOf":[{"oneOf":[{"type":"object","properties":{"playMoneyOverride":{"type":"boolean","const":true},"effectiveReferenceMode":{"type":"string","const":"BOOK_ONLY"},"failMode":{"type":"string","const":"OPEN"}}},{"type":"object","properties":{"playMoneyOverride":{"type":"boolean","const":false}}}]}],"description":"A point-in-time evaluation through the same percent-price policy path used by placement; placement re-evaluates then-current state","oneOf":[{"type":"object","properties":{"enforcement":{"type":"string","const":"ENFORCED"},"reason":{"type":"null"},"reference":{"$ref":"#/components/schemas/LimitPriceAdmissionReference"},"bidBounds":{"$ref":"#/components/schemas/LimitPriceAdmissionBounds"},"askBounds":{"$ref":"#/components/schemas/LimitPriceAdmissionBounds"}}},{"type":"object","properties":{"enforcement":{"type":"string","const":"BYPASSED_FAIL_OPEN"},"failMode":{"type":"string","const":"OPEN"},"reason":{"type":"string","minLength":1},"reference":{"type":"null"},"bidBounds":{"type":"null"},"askBounds":{"type":"null"}}},{"type":"object","properties":{"enforcement":{"type":"string","const":"BLOCKED_FAIL_CLOSED"},"failMode":{"type":"string","const":"CLOSED"},"reason":{"type":"string","minLength":1},"reference":{"type":"null"},"bidBounds":{"type":"null"},"askBounds":{"type":"null"}}}],"properties":{"schemaVersion":{"type":"integer","format":"int32","description":"Response schema version","minimum":1},"policyVersion":{"type":"string","description":"Admission policy algorithm version","minLength":1},"symbol":{"type":"string","description":"Canonical trading pair symbol","minLength":1},"marketId":{"type":"integer","format":"int64","description":"Exact public market ID evaluated","minimum":1},"enforcement":{"type":"string","description":"Effective percent-price enforcement outcome","enum":["ENFORCED","BYPASSED_FAIL_OPEN","BLOCKED_FAIL_CLOSED"]},"configuredPolicyMode":{"type":"string","description":"Configured reference-selection priority","enum":["EXTERNAL_PRIMARY","BOOK_PRIMARY"]},"effectiveReferenceMode":{"type":"string","description":"Reference-selection mode actually evaluated after market-type overrides","enum":["EXTERNAL_PRIMARY","BOOK_PRIMARY","BOOK_ONLY"]},"configuredFailMode":{"type":"string","description":"Configured behavior when no reference is selected","enum":["OPEN","CLOSED"]},"failMode":{"type":"string","description":"Effective behavior when no reference is selected","enum":["OPEN","CLOSED"]},"playMoneyOverride":{"type":"boolean","description":"Whether play-money semantics overrode configured reference/fail behavior"},"reason":{"type":["string","null"],"description":"Why no reference was selected, or null when enforcement is active"},"evaluatedAt":{"type":"string","format":"date-time","description":"Server time at which this point-in-time policy evaluation ran; not market-data time"},"reference":{"anyOf":[{"$ref":"#/components/schemas/LimitPriceAdmissionReference"},{"type":"null"}],"description":"Selected reference, or null when no percent-price bounds apply"},"bidBounds":{"anyOf":[{"$ref":"#/components/schemas/LimitPriceAdmissionBounds"},{"type":"null"}],"description":"Inclusive buy-side percent-price bounds, or null when no reference was selected"},"askBounds":{"anyOf":[{"$ref":"#/components/schemas/LimitPriceAdmissionBounds"},{"type":"null"}],"description":"Inclusive sell-side percent-price bounds, or null when no reference was selected"},"book":{"$ref":"#/components/schemas/LimitPriceAdmissionBook","description":"Local book evidence evaluated by admission"}},"required":["askBounds","bidBounds","book","configuredFailMode","configuredPolicyMode","effectiveReferenceMode","enforcement","evaluatedAt","failMode","marketId","playMoneyOverride","policyVersion","reason","reference","schemaVersion","symbol"]},"LimitPriceAdmissionReference":{"type":"object","description":"The reference selected for limit-order percent-price admission","properties":{"price":{"type":"number","description":"Selected admission reference price","exclusiveMinimum":0},"source":{"type":"string","description":"Selected reference source","enum":["external_usd","book_mid"]},"observedAt":{"type":["string","null"],"format":"date-time","description":"Oldest source observation contributing to the reference; may be null when source-time evidence is unavailable"}},"required":["observedAt","price","source"]},"LimitPriceAdmissionBounds":{"type":"object","description":"Inclusive limit-order price bounds for one order side","properties":{"minPrice":{"type":"number","description":"Inclusive minimum admitted limit price","exclusiveMinimum":0},"maxPrice":{"type":"number","description":"Inclusive maximum admitted limit price","exclusiveMinimum":0}},"required":["maxPrice","minPrice"]},"LimitPriceAdmissionBook":{"type":"object","description":"Local order-book evidence evaluated by the limit-price admission policy","oneOf":[{"type":"object","properties":{"eligible":{"type":"boolean","const":true},"reason":{"type":"null"},"bestBid":{"type":"number","exclusiveMinimum":0},"bestAsk":{"type":"number","exclusiveMinimum":0},"midpoint":{"type":"number","exclusiveMinimum":0},"spreadBps":{"type":"number","minimum":0},"bidNotionalQuote":{"type":"number","exclusiveMinimum":0},"askNotionalQuote":{"type":"number","exclusiveMinimum":0}}},{"type":"object","properties":{"eligible":{"type":"boolean","const":false},"reason":{"type":"string","minLength":1}}}],"properties":{"eligible":{"type":"boolean","description":"Whether the local book is eligible to supply the admission reference"},"reason":{"type":["string","null"],"description":"Book ineligibility reason, or null when the book is eligible"},"bestBid":{"type":["number","null"],"description":"Best bid price, when available","exclusiveMinimum":0},"bestAsk":{"type":["number","null"],"description":"Best ask price, when available","exclusiveMinimum":0},"midpoint":{"type":["number","null"],"description":"Exact arithmetic top-of-book midpoint, when computable","exclusiveMinimum":0},"spreadBps":{"type":["number","null"],"description":"Top-of-book spread in basis points, when computable","minimum":0},"bidNotionalQuote":{"type":["number","null"],"description":"Best-bid notional measured in quote-token units","exclusiveMinimum":0},"askNotionalQuote":{"type":["number","null"],"description":"Best-ask notional measured in quote-token units","exclusiveMinimum":0},"ready":{"type":"boolean","const":true,"description":"A successful admission response always contains an authoritative book materialization"},"eventId":{"type":"integer","format":"int64","description":"Last book aggregate event ID represented by the snapshot; zero is valid for a loaded empty book","minimum":0},"snapshotGeneratedAt":{"type":["string","null"],"format":"date-time","description":"Local time when this snapshot object was generated; not market-data source time"},"lastBookEventAt":{"type":["string","null"],"format":"date-time","description":"Creation time of the last represented book event, or null when unavailable after cold reconstruction"}},"required":["askNotionalQuote","bestAsk","bestBid","bidNotionalQuote","eligible","eventId","lastBookEventAt","midpoint","ready","reason","snapshotGeneratedAt","spreadBps"]},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"},"properties":{"type":"object","additionalProperties":{}}}},"RateLimitError":{"type":"object","description":"Error response returned when a request is rate limited (HTTP 429)","properties":{"code":{"type":"string","description":"Error code indicating rate limiting"},"status":{"type":"integer","format":"int32","description":"HTTP status code"},"scope":{"type":"string","description":"Scope of the rate limit: 'rest' for HTTP endpoints, 'ws' for WebSocket handshake","enum":["rest","ws"]},"bucket":{"type":"string","description":"Bucket that triggered the limit (e.g. 'rest_weight', 'orders', 'ws_handshake')"},"keyType":{"type":"string","description":"Key type that was rate limited: 'ip' or 'api'","enum":["ip","api"]},"retryAfterSec":{"type":"number","format":"double","description":"Seconds until enough tokens are available to retry this request"}},"required":["bucket","code","keyType","retryAfterSec","scope","status"]}},"responses":{"RateLimited":{"description":"Too Many Requests - Rate limit exceeded.","headers":{"X-PLEX-USED-WEIGHT-API":{"description":"Current used weight for your API key this minute (if authenticated)","schema":{}},"Retry-After":{"description":"Number of seconds to wait before retrying","schema":{}},"X-PLEX-ORDER-COUNT":{"description":"Current order count for your API key (for order endpoints)","schema":{}},"X-PLEX-USED-WEIGHT-IP":{"description":"Current used weight for your IP this minute","schema":{}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}},"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}}}}}}}
```

## Order book (depth)

> Returns the current order book (bids & asks) as arrays of \[PRICE, QTY] \*\*strings\*\*.\
> \
> Data Source: Memory.\
> \
> \
> \*\*Weight:\*\* Adjusted based on the \`limit\` parameter:\
> \
> \| Limit | Weight |\
> \|-------|--------|\
> \| 1-100 | 5 |\
> \| 101-500 | 25 |\
> \| 501-1000 | 50 |\
> \| 1001-5000 | 250 |<br>

```json
{"openapi":"3.1.0","info":{"title":"Lambdaplex API","version":"1.0"},"tags":[{"name":"Order books","description":"Market depths, trades, and prices"}],"servers":[{"url":"https://api.lambdaplex.io","description":"Generated server url"}],"security":[],"paths":{"/api/v1/depth":{"get":{"tags":["Order books"],"summary":"Order book (depth)","description":"Returns the current order book (bids & asks) as arrays of [PRICE, QTY] **strings**.\n\nData Source: Memory.\n\n\n**Weight:** Adjusted based on the `limit` parameter:\n\n| Limit | Weight |\n|-------|--------|\n| 1-100 | 5 |\n| 101-500 | 25 |\n| 501-1000 | 50 |\n| 1001-5000 | 250 |\n","operationId":"getDepth","parameters":[{"name":"symbol","in":"query","description":"Trading pair symbol (e.g. `PLEX-HBAR`).","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","description":"Number of price levels to return. Default: 100; Max: 5000. If `limit` > 5000, only 5000 entries are returned.","required":false,"schema":{"type":"integer","default":100,"maximum":5000,"minimum":1}}],"responses":{"200":{"description":"Order book snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Depth"}}}},"400":{"description":"Invalid symbol or limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Depth"}}}},"404":{"description":"Symbol not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Depth"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Depth"}}}},"503":{"description":"Service Unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}},"components":{"schemas":{"Depth":{"type":"object","properties":{"lastUpdateId":{"type":"integer","format":"int64"},"bids":{"type":"array","items":{"type":"array","items":{"type":"number"}}},"asks":{"type":"array","items":{"type":"array","items":{"type":"number"}}}}},"RateLimitError":{"type":"object","description":"Error response returned when a request is rate limited (HTTP 429)","properties":{"code":{"type":"string","description":"Error code indicating rate limiting"},"status":{"type":"integer","format":"int32","description":"HTTP status code"},"scope":{"type":"string","description":"Scope of the rate limit: 'rest' for HTTP endpoints, 'ws' for WebSocket handshake","enum":["rest","ws"]},"bucket":{"type":"string","description":"Bucket that triggered the limit (e.g. 'rest_weight', 'orders', 'ws_handshake')"},"keyType":{"type":"string","description":"Key type that was rate limited: 'ip' or 'api'","enum":["ip","api"]},"retryAfterSec":{"type":"number","format":"double","description":"Seconds until enough tokens are available to retry this request"}},"required":["bucket","code","keyType","retryAfterSec","scope","status"]},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"},"properties":{"type":"object","additionalProperties":{}}}}},"responses":{"RateLimited":{"description":"Too Many Requests - Rate limit exceeded.","headers":{"X-PLEX-USED-WEIGHT-API":{"description":"Current used weight for your API key this minute (if authenticated)","schema":{}},"Retry-After":{"description":"Number of seconds to wait before retrying","schema":{}},"X-PLEX-ORDER-COUNT":{"description":"Current order count for your API key (for order endpoints)","schema":{}},"X-PLEX-USED-WEIGHT-IP":{"description":"Current used weight for your IP this minute","schema":{}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}},"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}}}}}}}
```

## Current average price

> Returns the five-minute quantity-weighted average price for a symbol in Binance-compatible form.\
> If the five-minute window contains no trades, the most recent trade price and time are carried forward.\
> A valid market that has never traded returns price \`0\` and close time \`0\`.\
> \
> Data Source: Database.\
> \
> \
> \*\*Weight:\*\* 2\
> \
> This database-backed route also consumes one request from the shared\
> public-market-data pre-authentication IP bucket: \*\*5 requests/second\*\*\
> with a \*\*20 request burst\*\*. \`GET /api/v1/trades\` and \`GET /api/v1/avgPrice\` use the same bucket,\
> so alternating between them does not create additional database-read capacity.<br>

```json
{"openapi":"3.1.0","info":{"title":"Lambdaplex API","version":"1.0"},"tags":[{"name":"Order books","description":"Market depths, trades, and prices"}],"servers":[{"url":"https://api.lambdaplex.io","description":"Generated server url"}],"security":[],"paths":{"/api/v1/avgPrice":{"get":{"tags":["Order books"],"summary":"Current average price","description":"Returns the five-minute quantity-weighted average price for a symbol in Binance-compatible form.\nIf the five-minute window contains no trades, the most recent trade price and time are carried forward.\nA valid market that has never traded returns price `0` and close time `0`.\n\nData Source: Database.\n\n\n**Weight:** 2\n\nThis database-backed route also consumes one request from the shared\npublic-market-data pre-authentication IP bucket: **5 requests/second**\nwith a **20 request burst**. `GET /api/v1/trades` and `GET /api/v1/avgPrice` use the same bucket,\nso alternating between them does not create additional database-read capacity.\n","operationId":"getAveragePrice","parameters":[{"name":"symbol","in":"query","description":"Trading pair symbol","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Current five-minute average price","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AveragePrice"}}}},"400":{"description":"Required `symbol` query parameter is missing or malformed","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"404":{"description":"Symbol is invalid or unavailable to public market data","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"429":{"$ref":"#/components/responses/RateLimited"},"500":{"description":"Internal server error","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}},"503":{"description":"Market metadata projections are temporarily unavailable","content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetail"}}}}}}}},"components":{"schemas":{"AveragePrice":{"type":"object","description":"Volume-weighted average price over the current fixed window","properties":{"mins":{"type":"integer","format":"int32","description":"Window size in minutes"},"price":{"type":"string","description":"Volume-weighted average price"},"closeTime":{"type":"integer","format":"int64","description":"Time of the most recent trade represented by the price, in milliseconds since the Unix epoch"}},"required":["closeTime","mins","price"]},"ProblemDetail":{"type":"object","properties":{"type":{"type":"string","format":"uri"},"title":{"type":"string"},"status":{"type":"integer","format":"int32"},"detail":{"type":"string"},"instance":{"type":"string","format":"uri"},"properties":{"type":"object","additionalProperties":{}}}},"RateLimitError":{"type":"object","description":"Error response returned when a request is rate limited (HTTP 429)","properties":{"code":{"type":"string","description":"Error code indicating rate limiting"},"status":{"type":"integer","format":"int32","description":"HTTP status code"},"scope":{"type":"string","description":"Scope of the rate limit: 'rest' for HTTP endpoints, 'ws' for WebSocket handshake","enum":["rest","ws"]},"bucket":{"type":"string","description":"Bucket that triggered the limit (e.g. 'rest_weight', 'orders', 'ws_handshake')"},"keyType":{"type":"string","description":"Key type that was rate limited: 'ip' or 'api'","enum":["ip","api"]},"retryAfterSec":{"type":"number","format":"double","description":"Seconds until enough tokens are available to retry this request"}},"required":["bucket","code","keyType","retryAfterSec","scope","status"]}},"responses":{"RateLimited":{"description":"Too Many Requests - Rate limit exceeded.","headers":{"X-PLEX-USED-WEIGHT-API":{"description":"Current used weight for your API key this minute (if authenticated)","schema":{}},"Retry-After":{"description":"Number of seconds to wait before retrying","schema":{}},"X-PLEX-ORDER-COUNT":{"description":"Current order count for your API key (for order endpoints)","schema":{}},"X-PLEX-USED-WEIGHT-IP":{"description":"Current used weight for your IP this minute","schema":{}}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}},"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitError"}}}}}}}
```
