Skip to main content
Before you start, set up your gVault and allowlist the customer wallet.

1. Connect to your PRIME gVault

Use your PRIME gVault’s contractAddress from setup. Set primeAssetId to the underlying PRIME investment UUID returned as assetId by discovery. Connect the customer’s wallet to Tempo.

2. Fund your sandbox wallet

For sandbox, get gTESTUSDC from Ground’s sandbox faucet and gas fee tokens from the Tempo faucet. For production, continue to Deposit assets with the funding asset and gas fee tokens already in the customer’s wallet.
Save request.id. On your backend, poll until the transfer is confirmed before depositing:
If polling times out, check the same request ID again. If the transfer fails, contact Ground with the request ID before requesting another transfer.

3. Deposit assets

Back in your application, use the customer’s wallet to approve the asset, simulate the deposit, then call deposit. This example accepts up to 0.5% fewer shares than the estimate. Choose a tolerance appropriate for your application. assetAmount is a decimal string: "1" deposits one funding token.
When the deposit confirms, the customer receives shares. If simulation fails, check wallet access, the funding balance and the requested amount before submitting.

4. Read the customer’s balance

Read the customer’s shares and their estimated value in the funding asset:
previewRedeem estimates the current asset value; the amount received can change before redemption.

5. Redeem shares

The customer signs a redemption to exchange shares for assets. PRIME redemptions settle in the transaction when liquidity is available. This example redeems the balance read above with a 0.5% tolerance. shareAmount is a decimal string in share units. Here, owner is the customer’s wallet and receiver is the address that receives the assets. Both use the customer’s address.
If redemption reverts, the customer keeps their shares. Simulate again before retrying. If a transaction is still pending, check its status before sending another. See Deposit and redeem onchain for the contract method reference and fee-share redemptions.