Skip to main content
Deposit assets and redeem shares directly from customer wallets through your organization’s gToken contract. Before depositing, set up your gVault and allowlist the customer wallet. Call the methods below on the discovered contractAddress. Use yieldSourceId to choose the withdrawal method.

Deposit

Both USTB and PRIME accept the same deposit method:
  1. From the customer’s wallet, approve the exact funding amount to contractAddress and wait for the approval transaction to confirm.
  2. Choose a positive minWrapperShares from current contract reads or a simulated deposit and your slippage tolerance.
  3. Call deposit from the admitted wallet, using that same address as receiver.
  4. Wait for a successful receipt and verify the customer’s share balance increased.
Express assets in the funding token’s smallest units and minWrapperShares in the contract’s share units. For example, 1 USDC is 1000000 units when the funding token has 6 decimals. The quickstart includes a runnable deposit example.

USTB withdrawals

For yieldSourceId: ground-ustb-vault, withdrawals can settle immediately when the underlying vault has enough liquidity. The customer who owns the shares sends the transaction, passing their address as owner and the destination for the assets as receiver:
Use redeem to withdraw a number of shares, or withdraw to receive a specified amount of the funding asset. When withdrawal requires asynchronous settlement, the owner requests redemption and claims the assets after settlement:
  1. Call requestRedeem from the owner’s wallet. Save the chain, contract address, owner, request ID and successful request receipt.
  2. Wait for the underlying redemption to settle. Confirm readiness through contract reads or a simulated claim before submitting claimRedeem.
  3. Call claimRedeem from the owner’s wallet with the saved request ID. Wait for a successful receipt and verify the owner’s funding-asset balance increased.
Claim proceeds go to the owner. Shares committed to a request cannot be spent again; track pending claims separately from available shares. See asynchronous operations for request tracking and recovery.

PRIME withdrawals

For yieldSourceId: ground-tempo-prime-vault, use the four-argument redemption method:
The customer who owns the shares sends the transaction, passing their address as owner and the destination for the assets as receiver. Set a positive minAssets in the funding token’s smallest units, based on current contract reads or a simulated redemption and your slippage tolerance. Wait for a successful receipt and verify the receiver’s funding-asset balance increased.

Redeem earned fees

Management and performance fees accrue as shares minted to the configured recipients. Each recipient reads balanceOf(recipient) on contractAddress and redeems through the USTB or PRIME withdrawal methods above, using their address as owner. A balance read does not trigger fee accrual. Deposits, redemptions and fee configuration changes accrue fees according to the contract.