refactor: remove all futures-related capabilities

Delete USDT-M futures support since the user's Binance API key does not
support futures trading. This simplifies the CLI to spot-only:

- Remove futures client wrapper (um_futures_client.py)
- Remove futures trade commands and close position logic
- Simplify account service to spot-only (no market_type field)
- Remove futures references from opportunity service
- Update README and tests to reflect spot-only architecture
- Bump version to 2.0.7

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-16 20:10:15 +08:00
parent 680bd3d33c
commit 0f862957b0
11 changed files with 112 additions and 549 deletions

View File

@@ -17,18 +17,6 @@ class FakeSpotClient:
return {"symbol": kwargs["symbol"], "status": "FILLED", "orderId": 1}
class FakeFuturesClient:
def __init__(self):
self.calls = []
def new_order(self, **kwargs):
self.calls.append(kwargs)
return {"symbol": kwargs["symbol"], "status": "FILLED", "orderId": 2}
def position_risk(self, symbol=None):
return [{"symbol": "BTCUSDT", "positionAmt": "-0.02", "notional": "-1200"}]
class TradeServiceTestCase(unittest.TestCase):
def test_spot_market_buy_dry_run_does_not_call_client(self):
events = []
@@ -66,18 +54,6 @@ class TradeServiceTestCase(unittest.TestCase):
self.assertEqual(payload["trade"]["status"], "FILLED")
self.assertEqual(client.calls[0]["timeInForce"], "GTC")
def test_futures_close_uses_opposite_side(self):
with patch.object(trade_service, "audit_event", return_value=None):
client = FakeFuturesClient()
payload = trade_service.close_futures_position(
{"trading": {"dry_run_default": False}},
symbol="BTCUSDT",
dry_run=False,
futures_client=client,
)
self.assertEqual(payload["trade"]["side"], "BUY")
self.assertEqual(client.calls[0]["reduceOnly"], "true")
def test_spot_market_buy_requires_quote(self):
with patch.object(trade_service, "audit_event", return_value=None):
with self.assertRaisesRegex(RuntimeError, "requires --quote"):