Skip to main content

Overview

The MarketFetcher handles market discovery, individual market lookups, user-order lookup, and orderbook retrieval. It also caches venue contract addresses used by the order-signing flow.

Setup

Fetching active markets

Use get_active_markets() to retrieve a paginated list of active markets:

Sort options

The API also accepts trending, which crate 1.1.0 does not expose. There is no liquidity sort; the server rejects it with HTTP 400.

Fetching a single market

Use get_market() to retrieve full details for a specific market:
market.tokens and market.venue are optional in the Rust models, so unwrap them only after checking they are present.

Fetching the orderbook

Use get_order_book() to retrieve bids and asks for a market:
Level size and min_size are in raw 6-decimal units (1 share = 1,000,000); min_size is a decimal string. price is not scaled.

Fetching user orders

Use get_user_orders() to retrieve your orders on a market. This requires authentication:
Crate 1.1.0 types UserOrder as the signed-order shape, but the endpoint returns matching-engine rows (ownerId, marketId as text, decimal-string price and remainingSize), so any non-empty response fails with LimitlessError::Decode. On 1.1.0, read the endpoint raw with client.http.get_raw(&format!("/markets/{slug}/user-orders"), RequestOptions::default()).await? and parse raw.body yourself.
You can also call it from a fetched Market instance:

Venue caching

Every call to get_market() caches the market venue (exchange and adapter addresses). The OrderClient reads from this cache when resolving the correct EIP-712 verifying contract.
1

Fetch the market

Calling get_market() retrieves and caches the venue:
2

Check the cache

Access the cached venue directly:
3

Place an order

The OrderClient will use the cached venue for signing:
Calling get_market() before create_order() is still the recommended pattern. The Rust SDK will fetch venue data on demand if the cache is empty, but prefetching avoids an extra API roundtrip.