Earn is currently an Early Access Product. Contact us to enable it for your organization.
Prerequisites
- Your organization has deployed a wrapper for the vault, and its deployment status is
COMPLETED. Deposits targeting an address with no deployed wrapper fail withEARN_SETUP_REQUIRED. - Deposits to the wrapper are not paused: check
depositsDisabledonlist_earn_enabled_vaults. - The
signWithwallet holds enough of the vault’s underlying asset. For non-sponsored deposits it also needs the chain’s native token for gas.
Sub-organization wallets can deposit into (and withdraw from) wrappers deployed by their parent organization. The wrapper configuration lives on the parent, the sub-org wallet signs, and no per-sub-org deployment is needed.
Submit the deposit
Submit anACTIVITY_TYPE_EARN_DEPOSIT activity with:
- the
wrapperAddressto deposit into, fromlist_earn_enabled_vaults - the
signWithwallet account to deposit from and sign with - the amount in
assets, in raw onchain units of the underlying asset (e.g."1000000"for 1 USDC at 6 decimals) - the CAIP-2 chain in
chainCaip2, and optionallysponsorfor gas sponsorship
depositRequestId.
Gas: sponsored vs self-funded
Withsponsor: true, network fees are covered through Turnkey’s Gas Station and the batch executes as an EIP-7702 sponsored transaction. The signWith wallet does not need a gas token.
With sponsor: false, the signWith wallet pays gas itself, and the user initiating the deposit will need the relevant chain’s gas token.
Poll deposit status (required)
Poll with thedepositRequestId from the activity result. status is PENDING, COMPLETED, or FAILED; on COMPLETED the response carries the depositTxHash, and on FAILED it includes an error field with the reason. See Submissions for general activity semantics.
Next steps
- Track positions once the deposit is
COMPLETED - Withdraw from a vault