{"record":{"id":"6ae1b7c6c096a4f8","repo":"HKUDS/Vibe-Trading","slug":"binance-usd-m-shadow-account-supports-the-usdt-ass","errorCode":null,"errorMessage":"Binance USD-M Shadow Account supports the USDT asset only","messagePattern":"Binance USD-M Shadow Account supports the USDT asset only","errorType":"exception","errorClass":"UsdMObservationError","httpStatus":null,"severity":"error","filePath":"agent/src/trading/connectors/binance/usdm.py","lineNumber":251,"sourceCode":"    balance_fields = (\n        \"walletBalance\",\n        \"marginBalance\",\n        \"availableBalance\",\n        \"initialMargin\",\n        \"positionInitialMargin\",\n        \"openOrderInitialMargin\",\n        \"maintMargin\",\n        \"unrealizedProfit\",\n    )\n    for asset in assets:\n        symbol = str(asset.get(\"asset\") or \"\").upper()\n        balances = tuple(_number(asset.get(field), field) for field in balance_fields)\n        if symbol == \"USDT\":\n            if usdt_asset is not None:\n                raise UsdMObservationError(\"Binance USD-M assets must include exactly one USDT row\")\n            usdt_asset = asset\n        elif any(value != 0 for value in balances):\n            raise UsdMObservationError(\"Binance USD-M Shadow Account supports the USDT asset only\")\n    if usdt_asset is None:\n        raise UsdMObservationError(\"Binance USD-M assets must include USDT\")\n    return usdt_asset\n\n\ndef _require_coherent_totals(\n    account: Mapping[str, float],\n    positions: list[dict[str, Any]],\n    close_enough: CloseEnough,\n) -> None:\n    comparisons = (\n        (\n            account[\"total_unrealized_pnl\"],\n            sum(row[\"unrealized_pnl\"] for row in positions),\n        ),\n        (\n            account[\"total_initial_margin\"],\n            sum(row[\"initial_margin\"] for row in positions),","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/trading/connectors/binance/usdm.py#L233-L269","documentation":"A non-USDT asset row in the futures assets array has a non-zero balance in any tracked balance field. The Shadow Account supports USDT collateral only, so any leftover non-USDT balance (dust, USDC, BUSD, BNB fee balances) is rejected.","triggerScenarios":"Holding residual USDC/BUSD/BNB in the futures wallet; airdropped dust; receiving multi-asset collateral; auto-conversion settings leaving non-USDT balances.","commonSituations":"Prior trading on multi-asset mode, BNB fee discount balances, unswept conversion dust, or using the same account previously with USDC-margined contracts.","solutions":["Convert/transfer all non-USDT balances out of the futures wallet (use Binance's Convert-to-USDT or transfer to spot)","Disable multi-assets mode so only USDT collateral applies","Start with a clean sub-account funded solely with USDT","Sweep BNB and other dust via the conversion endpoint"],"exampleFix":"# before: wallet holds {USDT: 5000, USDC: 12.3}\n# after: convert or transfer out\nPOST /sapi/v1/asset/dust (or futures transfer) -> wallet holds {USDT: 5012.3}","handlingStrategy":"validation","validationCode":"acct = await client.futures_account()\nnonzero = [a['asset'] for a in acct['assets'] if a['asset'].upper() != 'USDT' and any(float(a.get(f, 0) or 0) != 0 for f in ('balance', 'availableBalance', 'crossUnPnl'))]\nif nonzero:\n    raise RuntimeError(f\"non-USDT balances present: {nonzero}\")","typeGuard":"def wallet_is_usdt_only(assets: list[dict]) -> bool:\n    return all(\n        str(a.get('asset', '')).upper() == 'USDT'\n        or all(float(a.get(f, 0) or 0) == 0 for f in ('balance', 'availableBalance', 'crossUnPnl'))\n        for a in assets\n    )","tryCatchPattern":"try:\n    obs = await connector.read_account_observation()\nexcept UsdMObservationError as e:\n    if \"USDT asset only\" in str(e):\n        raise RuntimeError(\"convert or transfer out non-USDT futures balances, then retry\")\n    raise","preventionTips":["Keep the futures wallet funded with USDT only","Sweep dust/airdrops via Convert before onboarding the account","Use a fresh dedicated sub-account for the Shadow Account"],"tags":["binance","futures","usdt-only","wallet-hygiene"],"backgroundTag":"unsupported-asset-balance","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}