v1

latestOpenAPI 3.0.32026-08-041747125.8 KB
Balances

Get rebalancer balances

Retrieves detailed balance information across all protocols and pools for a wallet address. This endpoint provides comprehensive financial data including token balances, net earnings, aggregate APY, and per-protocol/per-pool breakdowns.<br><br>

Authentication: Requires a valid API key. The wallet address must be a valid checksummed EOA address.<br><br>

Token Filtering: The optional tokens query parameter accepts a comma-separated list of token symbols (e.g., USDC,MUSD,USDT,RLUSD,USDG,USDE,PYUSD). If not provided, balances for all supported tokens are returned.<br><br>

Balance Details: For each token, the response includes:

  • Total balance across all chains (raw units and human-readable format)
  • Net earnings in USD (calculated as current balance minus net deposits/withdrawals)
  • Aggregate APY (weighted average across all protocols)
  • Per-chain breakdown with per-protocol and per-pool details<br><br>

Spending / Card Balance (USDC only): For users with the MetaLend card feature active in their configuration, the total rebalancer balance consists of two parts:

  • Regular rebalancing balance — funds held across DeFi pools on all chains, shown in perToken[n].perChain[m].perProtocol[p].perPool[q].
  • Card balance — funds reserved on Linea for card spending, shown in perToken[n].spendingInfo. This is USDC only and has two sub-components:
    • Liquid USDC held in the rebalancer contract on Linea (lineaUsdcBalance)
    • USDC deposited in Aave V3 on Linea, earning yield while available for card spending (lineaAaveUsdcBalance)

spendingInfo is null when the card feature is not active for the user. When displaying total balance to the user, include both the pool balances AND spendingInfo amounts — they are additive parts of the same rebalancer.

Withdraw Request: Each pool balance includes optional withdrawRequest containing EIP-712 domain parameters, type definitions, and value structure for creating withdrawal signatures. The value field includes token and poolContract addresses, while amount and deadline must be supplied by the user when creating a withdrawal via /v1/withdrawals endpoint.<br><br>

Summary: The response includes an aggregate summary with total balance across all queried tokens, total net earnings, queried tokens, and queried chains.<br><br>

Error Handling: If blockchain queries fail or the wallet has no rebalancer configuration, appropriate error responses are returned. The endpoint uses an all-or-nothing approach - if any token query fails, the entire request fails with a 500 or 503 status code.

Rate limiting: 1 request per 12 seconds per client IP. Excess requests receive HTTP 429 with Retry-After, X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers (see RateLimitExceeded response).

get/v1/balances/{walletAddress}

Path parameters

walletAddressstring required

User's Ethereum wallet address

Query parameters

tokensstring

Comma-separated list of token symbols to query

Response

Rebalancer balances retrieved successfully

walletAddressstring required

User's Ethereum wallet address

rebalancerAddressstring required

Rebalancer contract address