nautechsystems/nautilus_trader · error
No wallet balance found in response
Error message
No wallet balance found in response
What it means
The adapter expects Bybit's GET /v5/account/wallet-balance response to contain at least one wallet balance entry in `result.list`. When the list is empty, it cannot build an account state and throws this error.
Source
Thrown at crates/adapters/bybit/src/http/client.rs:4207
pub async fn request_account_state(
&self,
account_type: BybitAccountType,
account_id: AccountId,
) -> anyhow::Result<AccountState> {
let params = BybitWalletBalanceParams {
account_type,
coin: None,
};
let response = self.inner.get_wallet_balance(¶ms).await?;
let ts_init = self.generate_ts_init();
// Take the first wallet balance from the list
let wallet_balance = response
.result
.list
.first()
.ok_or_else(|| anyhow::anyhow!("No wallet balance found in response"))?;
parse_account_state(wallet_balance, account_id, ts_init)
}
/// Request multiple order status reports.
///
/// Orders for instruments not currently loaded in cache will be skipped.
///
/// When `open_only` is true the realtime endpoint is queried for currently
/// open orders and again for recently closed orders, so terminal reports
/// are included. The closed pass fetches the most recent page only and is
/// not constrained by `start` or `end`.
///
/// # Errors
///
/// Returns an error if:
/// - Credentials are missing.
/// - The request fails.View on GitHub (pinned to 18893faf8b)
Solutions
- Verify the account_type requested matches where funds actually live (UNIFIED, CONTRACT, FUND, SPOT)
- Check the account has balance/deposit and the API key has Account read permission
- Inspect the raw response `retCode`/`retMsg` for upstream errors masked as an empty list
- Fund the account or switch to the correct account type in the adapter config
Example fix
// before
let wallet_balance = response.result.list.first()
.ok_or_else(|| anyhow::anyhow!("No wallet balance found in response"))?;
// after: validate the account type choice up front
if response.result.list.is_empty() {
anyhow::bail!("No wallet balance for account_type={account_type}; check config and account funding");
} Defensive patterns
Strategy: try-catch
Validate before calling
if not response.get('result', {}).get('list'):
raise ValueError('wallet-balance returned empty list; check account_type') Try / catch
match client.request_account_state(...) { Err(e) if e.to_string().contains("No wallet balance") => fallback_to_next_account_type(), other => other } Prevention
- Confirm the accountType (UNIFIED/CONTRACT/FUND/SPOT) matches where funds are held
- Grant the API key Account read permission
- Fund the account or test against an account with balances
When it happens
Trigger: Calling request_account_state (wallet balance endpoint) when Bybit returns `result.list: []` — e.g. the account has no balance data for the queried account type (UNIFIED vs CONTRACT vs FUND mismatch).
Common situations: Querying a subaccount with no funds; passing the wrong accountType parameter; API key scoped to an account type with no balances; brand-new account before any deposit.
Understand the failure class
Background: EmptyResultError / "no results found": when an API or scraper succeeds but returns zero rows — this error's family across 9 libraries.
Related errors
- No order returned {context}
- No margin data returned from BitMEX
- Invalid config type for BybitDataClientFactory. Expected Byb
- Invalid config type for BybitExecutionClientFactory. Expecte
- Instrument {symbol} not found in cache, ensure instruments l
AI-assisted analysis of nautechsystems/nautilus_trader@18893faf8b (2026-09-08).
Data as JSON: /api/errors/15505527c9cc7643.
Report an issue: GitHub.