система авторизации
This commit is contained in:
1 parent
85425483c0
commit
f6f1ae20c2
21 files changed
+581
-110
No files matched your search
@@ -27,6 +27,7 @@ after each real trade they are replaced by what the exchanges actually charged,
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
import os
|
||||
from persistence import atomic_write_json
|
||||
import queue
|
||||
import threading
|
||||
@@ -39,7 +40,7 @@ import arb
|
||||
import minorder
|
||||
|
||||
ROOT = Path(__file__).resolve().parent
|
||||
DATA_DIR = ROOT / "web_sim_data"
|
||||
DATA_DIR = Path(os.environ.get("CRYPTO_SCAM_DATA_DIR", ROOT / "web_sim_data")).resolve()
|
||||
POLL_S = 3.0
|
||||
USUAL_WINDOW_S = 1800.0
|
||||
KEEP_TRADES = 500
|
||||
@@ -154,7 +155,7 @@ class CrossSettings:
|
||||
cooldown_s: float = 300.0
|
||||
min_turnover: float = 200000.0 # 24h turnover of each leg, $
|
||||
use_bybit: bool = True # an exchange switched off is neither searched nor traded
|
||||
use_binance: bool = True
|
||||
use_binance: bool = False
|
||||
use_mexc: bool = True
|
||||
use_htx: bool = True
|
||||
use_gate: bool = True
|
||||
@@ -527,6 +528,7 @@ class CrossEngine:
|
||||
for k, v in (d.get("settings") or {}).items():
|
||||
if k in known:
|
||||
setattr(self.settings, k, type(getattr(self.settings, k))(v))
|
||||
self.settings.use_binance = False
|
||||
import basis
|
||||
self.settings.max_gap_pct = min(self.settings.max_gap_pct, basis.HARD_MAX_GAP_PCT)
|
||||
for ex, f in (d.get("fees") or {}).items():
|
||||
@@ -804,7 +806,7 @@ class CrossEngine:
|
||||
|
||||
def exchanges(self) -> set[str]:
|
||||
s = self.settings
|
||||
return {name for name, on in (("Bybit", s.use_bybit), ("Binance", s.use_binance), ("MEXC", s.use_mexc),
|
||||
return {name for name, on in (("Bybit", s.use_bybit), ("MEXC", s.use_mexc),
|
||||
("HTX", s.use_htx), ("Gate", s.use_gate)) if on}
|
||||
|
||||
def has_keys(self, exchange: str) -> bool:
|
||||
|
||||
Reference in new issue
Block a user