Coinbase Prime offers real-time portfolio and wallet balance information through its API. Note that the endpoints described here do not retain historical balance data. If a use case requires a history of balances over time, these endpoints should periodically queried with the results stored in an external system for long-term recordkeeping.

Calculating Portfolio Balances

Use List Portfolio Balances to see aggregated balances for all assets within a specific portfolio. This is useful for high-level monitoring and trading workflows, such as displaying a portfolio overview or verifying available funds before placing orders.

BalancesService balancesService = PrimeServiceFactory.createBalancesService(client);

ListPortfolioBalancesRequest request = new ListPortfolioBalancesRequest.Builder("PORTFOLIO_ID_HERE").build();

ListPortfolioBalancesResponse response = balancesService.listPortfolioBalances(request);

To learn more about this SDK, please visit the Prime Java SDK.

Calculating Wallet Balances

Individual wallet balances can be obtained with Get Wallet Balance. This endpoint returns the current balance for a single wallet, making it ideal for tracking balances at the wallet level — for instance, monitoring a specific vault wallet in Coinbase Custody or a trading wallet in Prime. Please review the Wallets page before proceeding.

BalancesService balancesService = PrimeServiceFactory.createBalancesService(client);

GetWalletBalanceRequest request = new GetWalletBalanceRequest.Builder()
    .portfolioId("PORTFOLIO_ID_HERE")
    .walletId("WALLET_ID_HERE")
    .build();

GetWalletBalanceResponse response = balancesService.getWalletBalance(request);

To learn more about this SDK, please visit the Prime Java SDK.

Please note: All requests discussed above require proper authentication. For more information, visit REST API Authentication.