GROUND_API_KEY. 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 allocation group must total 100%. Persist the request ID and payload before submitting; reuse them unchanged after an uncertain response.status: "creating" or return a prepared wallet. Subscribe to
portfolio_wallet.status_changed before creating the wallet. When the matching
walletId reaches idle, read GET /v3/wallets/{id} to get its deposit
addresses. Fund only after the intended network’s address appears; idle does not imply all networks are ready. 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 /v3/wallets/{id}/strategy.
5. Monitor earnings and withdrawals
Use Balances and Yield to interpret holdings and earnings. To pay treasury funds out, follow Withdraw Funds: preview first, persist the withdrawal request, handle any customer approval, and track receiver delivery. Automatic wallets let Ground choose funding positions; omit explicitsources.
Test the integration
In sandbox:- Create a wallet with automatic rebalancing and wait for the intended deposit address.
- Deposit test USDC to
depositAddresses.ethereum_sepolia. - Confirm the deposit completes and a rebalance deploys the funds.
- Confirm
GET /v3/wallets/{id}returns the new positions. - Confirm
GET /v3/wallets/{id}/yieldreturns the yield summary. - Preview and complete a small withdrawal.