loadMarkets
Load and cache all markets from an exchange into a stable snapshot, enabling drift-free local pagination and iteration.
Instructions
Load and cache all markets from the exchange into this.markets and this.marketsBySlug. Subsequent calls return the cached result without hitting the API again. This is the correct way to paginate or iterate over markets without drift. Because fetchMarkets() always hits the API, repeated calls with different offset values may return inconsistent results if the exchange reorders or adds markets between requests. Use loadMarkets() once to get a stable snapshot, then paginate over Object.values(exchange.markets) locally.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| exchange | Yes | The prediction market exchange to target. | |
| reload | No | ||
| credentials | No | Venue credentials (privateKey, apiKey, etc.). Only needed for authenticated operations like trading. | |
| verbose | No | Return full uncompacted response. Default false returns a compact, agent-friendly summary. |