Skip to main content

load_instruments

Function load_instruments 

Source
pub async fn load_instruments(
    client: &BetfairHttpClient,
    filter: &NavigationFilter,
    currency: Currency,
    min_notional: Option<Money>,
) -> Result<Vec<InstrumentAny>>
Expand description

Loads instruments from the Betfair Navigation and Betting APIs.

  1. Fetches the navigation tree via send_navigation
  2. Flattens and filters to matching market IDs
  3. Batches market IDs (max 50 per request)
  4. Calls listMarketCatalogue for each batch
  5. Parses results into [InstrumentAny] via parse_market_catalogue

ยงErrors

Returns an error if any API request fails or instrument parsing fails.