The Bjarkan SOR SDK provides access to real-time market data across multiple exchanges. This includes both orderbook data and trade data. You can choose between aggregated orderbook data across all exchanges or separate data for each exchange and symbol. Live market data is crucial for making informed trading decisions and is used by the smart order router for order execution.
The callback will receive individual orderbook updates for each exchange-symbol combination:
Copy
{ "timestamp": 1740504899057, # Local timestamp (milliseconds) "exchange_timestamp": 1740504899014, # Exchange timestamp "symbol": "BTC/USDT", # Symbol for this update "bids": [ # All bids from a single exchange [87609.2, 0.01276021, "coinbase"], [87609.19, 0.02126701, "coinbase"], [87609.15, 0.00812456, "coinbase"], # ... more bid entries from coinbase only ], "asks": [ # All asks from the same exchange [87609.21, 0.03542187, "coinbase"], [87609.25, 0.12589354, "coinbase"], [87609.28, 0.00256913, "coinbase"], # ... more ask entries from coinbase only ]}
With this configuration:
Each update contains data for a single exchange and a single symbol
A separate update will arrive for each exchange-symbol combination
Updates are triggered independently whenever an exchange’s orderbook changes
One update might be for “BTC/USDT” on Coinbase, the next might be for “ETH/USDT” on HTX
When you configure fees_bps in your configuration, the SDK will adjust the orderbook prices to account for exchange fees. This provides several advantages:
True Arbitrage Detection: Identify genuine arbitrage opportunities by seeing prices with fees included.
Accurate Price Comparison: Compare prices across exchanges fairly by accounting for fee differences.
Realistic Execution: Better understand what your actual execution price will be after fees.
For example, with a fee of 0.1% (10 bps):
A bid price of 50,000 would be adjusted to 49,950 (50,000 / 1.001)
An ask price of 50,000 would be adjusted to 50,050 (50,000 * 1.001)
When using callbacks, the data you receive will already have these fee adjustments applied if you’ve configured fees_bps.
Memory Management: For long-running applications, implement data retention policies
Timestamp Awareness: Pay attention to both local and exchange timestamps for accurate sequencing
Using these techniques, you can build sophisticated trading systems that utilize real-time market data for analysis, signal generation, and order execution.