GROUND_API_TOKEN. The examples below use the sandbox API:
1. Fetch yield sources
Fetch the available yield sources before creating the wallet. Use the returnedid and depositToken values when building the strategy.
2. Create the wallet
Allocations for each token must total 100%.status: "creating". Subscribe to
portfolio_wallet.status_changed before creating the wallet. When the matching
walletId reaches idle, read GET /v2/wallets/{id} to get its deposit
addresses. Handle failed as a provisioning failure, and use the wallet read
to reconcile a delayed or missed webhook.
3. Deposit funds
Send a supported stablecoin to the matching deposit address. Ground credits the deposit and deploys the funds toward the target percentages. Subscribe to these events or poll the related resources:
Wait for the deposit to become
completed before using it in your application.
See Deposits.
4. Read or update the portfolio
Read the wallet to get its current cash, investments, and balances:PATCH /v2/wallets/{id}/strategy.
5. View yield
Read lifetime earnings, estimated annualized yield, and the current breakdown by yield source:6. Withdraw funds
Do not specify funding sources while automatic rebalancing is enabled. Ground chooses the positions used for the withdrawal.portfolio_wallet.withdrawal.status_changed until the withdrawal
finishes. If it requires customer approval, complete the configured
transaction approval.
Test the integration
In sandbox:- Create a wallet with automatic rebalancing and wait for
idle. - Deposit test USDC to
depositAddresses.ethereum_sepolia. - Confirm the deposit completes and a rebalance deploys the funds.
- Confirm
GET /v2/wallets/{id}returns the new positions. - Confirm
GET /v2/wallets/{id}/yieldreturns the yield summary. - Preview and complete a small withdrawal.