GlobalExchangeOptions lets you set common settings once and have them apply to every exchange client. Any option you set globally can still be overridden per exchange by passing an exchange-specific options delegate.
Setting options in code
Pass anAction<GlobalExchangeOptions> delegate to AddCryptoClients:
Setting options via appsettings.json
Pass a configuration section toAddCryptoClients to load settings from appsettings.json:
CryptoClients object. Exchange-specific overrides are nested under the exchange name. The following example shows a full configuration file:
Per-exchange overrides
Each exchange has a dedicated options parameter onAddCryptoClients. Exchange-specific options always take precedence over global options.
asterOptions, binanceOptions, bingxOptions, bitfinexOptions, bitgetOptions, bitMartOptions, bitMEXOptions, bitstampOptions, bloFinOptions, bybitOptions, coinbaseOptions, coinExOptions, coinWOptions, coinGeckoOptions, cryptoComOptions, deepCoinOptions, gateIoOptions, htxOptions, hyperLiquidOptions, krakenOptions, kucoinOptions, mexcOptions, okxOptions, polymarketOptions, toobitOptions, upbitOptions, whiteBitOptions, xtOptions.
Global options reference
When
true, the CallResult and DataEvent objects include the raw JSON
received from the exchange in the OriginalData property. Useful for
debugging. Defaults to false.HTTP proxy settings applied to all REST and WebSocket connections. Set
Host,
Port, and optionally Login and Password.Maximum time a single REST request is allowed to take before it is cancelled.
Applies to both REST and WebSocket request/response operations.
Enables or disables client-side rate limiting. When enabled, the client tracks
request counts and delays outgoing requests to stay within exchange limits.
Defaults to
true.What happens when a rate limit is reached.
Wait queues the request until the
limit window resets. Fail returns an error immediately.Enables client-side caching for REST GET requests. Repeated identical requests
within the cache window return the cached result without a network call.
Defaults to
false.API credentials for one or more exchanges. Set typed credential objects per
exchange. See API credentials for details.
Per-exchange environment name to use (e.g.
"testnet", "live"). Keys are
exchange names such as "Binance" or "Bybit". See
Environments for details.Reconnect strategy for WebSocket connections. Common values are
FixedDelay
and ExponentialBackoff.Time to wait between WebSocket reconnect attempts. Used when
ReconnectPolicy is FixedDelay.