Skip to main content
Available cash represents the funds you have available to open new positions. It is calculated by taking your total credits and subtracting the sum of all pending order amounts.
Available cash only refers to your USD balance.
To retrieve the data needed for this calculation, use the P&L endpoint for either demo or real accounts.

The Calculation Process

Calculating available cash involves fetching your account data and performing a simple subtraction of all pending order amounts from your total credits.

1. Endpoints

Use the P&L endpoint to retrieve your account information. Demo Account: GET https://public-api.etoro.com/api/v1/trading/info/demo/pnl Real Account: GET https://public-api.etoro.com/api/v1/trading/info/real/pnl

2. Header Requirements

Remember to include your authentication headers with every request.
  • x-api-key
  • x-user-key
  • x-request-id

3. Calculation Formula

Available Cash = credits - Σ(ordersForOpen[i].amount)
Where:
  • credits is the total credit balance in your account
  • ordersForOpen is an array of pending orders
  • amount is the allocated amount for each pending order

Examples

curl -X GET "https://public-api.etoro.com/api/v1/trading/info/demo/pnl" \
  -H "x-api-key: <YOUR_PUBLIC_KEY>" \
  -H "x-user-key: <YOUR_USER_KEY>" \
  -H "x-request-id: <UUID>"

Example Calculation

If your account has:
  • credits: 1000
  • ordersForOpen: Two pending orders with amount values of 200 each
Then your available cash would be:
1000 - (200 + 200) = 600

Best Practices

  1. Check Before Trading: Always verify your available cash before attempting to open new positions to avoid insufficient funds errors.
  2. Account for Pending Orders: Remember that funds allocated to pending orders are not available for new positions until those orders are cancelled or executed.
  3. Use the Correct Environment: Make sure to use the demo endpoint when testing and the real endpoint for live trading.