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

@@ -41,14 +41,6 @@ class FakeSpotClient:
return {"symbols": [{"symbol": "BTCUSDT", "status": "TRADING"}, {"symbol": "ETHUSDT", "status": "TRADING"}, {"symbol": "DOGEUSDT", "status": "BREAK"}]}
class FakeFuturesClient:
def balance(self):
return [{"asset": "USDT", "balance": "250.0", "availableBalance": "200.0"}]
def position_risk(self, symbol=None):
return [{"symbol": "BTCUSDT", "positionAmt": "0.02", "notional": "1200", "entryPrice": "59000", "markPrice": "60000", "unRealizedProfit": "20"}]
class AccountMarketServicesTestCase(unittest.TestCase):
def test_account_overview_and_dust_filter(self):
config = {
@@ -57,13 +49,9 @@ class AccountMarketServicesTestCase(unittest.TestCase):
}
payload = account_service.get_overview(
config,
include_spot=True,
include_futures=True,
spot_client=FakeSpotClient(),
futures_client=FakeFuturesClient(),
)
self.assertEqual(payload["overview"]["spot_equity_usdt"], 720.1)
self.assertEqual(payload["overview"]["futures_equity_usdt"], 250.0)
self.assertEqual(payload["overview"]["total_equity_usdt"], 720.1)
symbols = {item["symbol"] for item in payload["positions"]}
self.assertNotIn("DOGEUSDT", symbols)
self.assertIn("BTCUSDT", symbols)