Add Binance SIM market adapter and exchange switch in settings.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,20 +2,22 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from ..config import Settings, get_settings
|
||||
from ..config import Settings
|
||||
from .protocol import ExchangeMarket
|
||||
|
||||
_exchange: ExchangeMarket | None = None
|
||||
|
||||
|
||||
def build_exchange(settings: Settings | None = None) -> ExchangeMarket:
|
||||
s = settings or get_settings()
|
||||
name = (s.exchange or "okx").strip().lower()
|
||||
from .runtime import load_runtime_settings, normalize_exchange_name
|
||||
|
||||
s = settings or load_runtime_settings()
|
||||
name = normalize_exchange_name(s.exchange)
|
||||
if name == "okx":
|
||||
from .okx.adapter import OkxExchange
|
||||
|
||||
return OkxExchange(s)
|
||||
if name in ("binance", "bn"):
|
||||
if name == "binance":
|
||||
from .binance.adapter import BinanceExchange
|
||||
|
||||
return BinanceExchange(s)
|
||||
|
||||
Reference in New Issue
Block a user