Earn is an Enterprise feature. Reach out to sales@privy.io to request
access.
Prerequisites
- A Privy app with embedded wallets configured
- API credentials (your app ID and app secret)
- A webhook endpoint registered in the Privy Dashboard (recommended)
1. Deploy a fee wrapper
Configure a fee wrapper from the Wallet infrastructure > Earn page in the Privy Dashboard. During setup, you will set:- A Morpho vault to allocate assets into
- The percentage of generated yield your app receives
- An admin wallet to claim fees and manage your vault configuration
Using an external wallet as an admin wallet (advanced)
Using an external wallet as an admin wallet (advanced)
If the admin wallet is not a Privy embedded wallet, it must be able to sign onchain transactions
to manage the vault and claim fees. Exchange wallets, cold storage, and other non-signing
wallets are not supported. Once set, Privy cannot reassign the admin wallet.
Updating your fee wrapper configuration (advanced)
Updating your fee wrapper configuration (advanced)
Privy assigns all fee wrapper roles to the admin wallet. This ensures that developers can update
their fee wrapper configurations in the future. Learn more about fee wrapper roles
here. Reach out to
sales@privy.io to make fee wrapper configuration changes.
2. Copy the vault ID
After setup, Privy provides a uniquevault_id for the vault. Copy this value — it is required for all deposit and withdraw API calls.
To verify the vault is live, query its details with the get vault details endpoint:
Example response
3. Deposit funds into the vault
Wallets with
owner_id present must provide an authorization
signature as a request header for deposit, withdraw, and
claim operations.asset_amount is specified in the token’s smallest unit. For USDC (6 decimals), "1000000"
equals 1 USDC.id and a status of "pending". Poll the status with get sweep by ID, or listen for the yield.deposit.confirmed webhook to know when the deposit is confirmed onchain.
Example response
4. Check a wallet’s position
After a deposit is confirmed, query the wallet’s holdings using the get position endpoint. Theassets_in_vault field reflects the current redeemable value, including any accrued yield.
Example response
5. Withdraw funds from the vault
Redeem vault shares and return assets — plus any accrued yield — to the wallet using the withdraw endpoint. The returnedasset_amount reflects the original deposit plus yield earned.
yield.withdraw.confirmed webhook.
Example response
6. Claim reward incentives
Some vaults distribute additional token incentives on top of base yield. Collect these with the claim endpoint. Claims operate at the chain level — pass a CAIP-2 identifier rather than a vault ID. For apps with multiple vaults on the same chain, a single claim collects rewards across all vaults.yield.claim.confirmed webhook.
Example response
Claiming rewards is separate from withdrawing yield. To realize deposit earnings, use the
withdraw endpoint. Claiming does not affect withdrawals
or ongoing earnings.
7. Track activity with webhooks (recommended)
Privy emits webhooks when vault operations are confirmed onchain. Subscribe to earn events from the Configuration > Webhooks page in the Privy Dashboard to keep your app synchronized without polling.| Event | Fired when |
|---|---|
yield.deposit.confirmed | A vault deposit is confirmed onchain |
yield.withdraw.confirmed | A vault withdrawal is confirmed onchain |
yield.claim.confirmed | A reward claim transaction is confirmed onchain |
For full webhook setup instructions and payload schemas, see the webhooks
overview.
Next steps
Earn overview
Learn about capabilities, use cases, and revenue sharing.
Starter template
A working Next.js app with end-to-end deposit and withdraw flows.

