Skip to main content
curl -X GET "https://api.strike.markets/balances/0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46"
{
  "balance": "1000.50",
  "withdrawable": "500.25",
  "total_deposited": "2000.00",
  "total_withdrawn": "499.50"
}
curl -X GET "https://api.strike.markets/balances/0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46"
{
  "balance": "1000.50",
  "withdrawable": "500.25",
  "total_deposited": "2000.00",
  "total_withdrawn": "499.50"
}

Overview

Retrieve account balance information for a specific wallet address. This endpoint provides real-time balance data including available funds, withdrawable balance, and deposit/withdrawal history.
This is a public endpoint that does not require authentication. You can query any wallet address to view its balance information.

Path Parameters

wallet_address
string
required
The wallet address to get balance information for.Format: Ethereum address (0x prefixed)
Example: “0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46”

Response Fields

balance
string
Current account balance available for trading (USD)
withdrawable
string
Amount available for withdrawal (USD) - excludes reserved margin
total_deposited
string
Total amount deposited to this account (USD)
total_withdrawn
string
Total amount withdrawn from this account (USD)

Balance Components

Account Balance

Total funds in the account:
Balance = Total Deposits - Total Withdrawals + Realized PnL

Withdrawable Amount

Funds available for withdrawal (excludes margin reserved in open positions):
Withdrawable = Account Balance - Reserved Margin

Reserved Margin

Margin locked in open positions (calculated separately, not returned by this endpoint):
Reserved = Sum of all open position margins

Use Cases

Portfolio Tracking

  • Monitor account balance changes over time
  • Track deposit and withdrawal history
  • Calculate net deposits vs current value

Public Information

  • View balance information for any wallet address
  • Analyze public trading account performance
  • Transparency for fund managers or public traders

Integration

  • Display user balance in frontend applications
  • Calculate available funds for new positions
  • Verify withdrawal limits

Error Responses

400 Bad Request
object
Invalid wallet address format
{
  "detail": "Invalid wallet address format"
}
500 Internal Server Error
object
Failed to retrieve balance data
{
  "detail": "Failed to get balance data: {error_details}"
}

Caching and Performance

  • Real-time updates: Balance reflects latest transactions
  • Optimized queries: Fast response times for frequent polling
  • No rate limits: Public endpoint with minimal restrictions

Usage Examples

Basic Balance Check

# Check balance for any wallet
curl -X GET "https://api.strike.markets/balances/0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46"

JavaScript Integration

async function getWalletBalance(walletAddress) {
  try {
    const response = await fetch(`https://api.strike.markets/balances/${walletAddress}`);
    
    if (!response.ok) {
      throw new Error(`HTTP ${response.status}: ${await response.text()}`);
    }
    
    const balance = await response.json();
    
    return {
      balance: parseFloat(balance.balance),
      withdrawable: parseFloat(balance.withdrawable),
      totalDeposited: parseFloat(balance.total_deposited),
      totalWithdrawn: parseFloat(balance.total_withdrawn)
    };
  } catch (error) {
    console.error('Failed to get balance:', error);
    throw error;
  }
}

// Usage
const balance = await getWalletBalance("0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46");
console.log(`Available balance: $${balance.balance}`);
console.log(`Withdrawable: $${balance.withdrawable}`);

Python Integration

import requests

def get_wallet_balance(wallet_address: str) -> dict:
    """Get balance information for a wallet address"""
    
    response = requests.get(f"https://api.strike.markets/balances/{wallet_address}")
    
    if response.status_code == 200:
        data = response.json()
        return {
            'balance': float(data['balance']),
            'withdrawable': float(data['withdrawable']),
            'total_deposited': float(data['total_deposited']),
            'total_withdrawn': float(data['total_withdrawn'])
        }
    else:
        raise Exception(f"Failed to get balance: {response.json()}")

# Usage
balance = get_wallet_balance("0x742d35cc6c6c7532b1140da4c8a2f6c8ecfc9b46")
print(f"Balance: ${balance['balance']:.2f}")
print(f"Net deposits: ${balance['total_deposited'] - balance['total_withdrawn']:.2f}")
  • Dashboard - Comprehensive account overview including positions
  • Get Positions - View positions affecting withdrawable balance
  • Deposit - Add funds to account (requires authentication)
  • Withdraw - Withdraw available balance (requires authentication)

Notes

  • This endpoint provides public balance information for transparency
  • For private operations (deposits, withdrawals, trading), use authenticated endpoints
  • Balance updates immediately after deposits, withdrawals, and position settlements
  • Withdrawable amount may be less than total balance if margin is reserved in open positions