> ## Documentation Index
> Fetch the complete documentation index at: https://turnkey-0e7c1f5b-renovate-npm-js-yaml-vulnerability.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Turnkey is wallet infrastructure: create and manage crypto wallets, sign transactions, and enforce policy-based access controls. Best-fit uses: embedded consumer wallets (email/passkey/social auth, no seed phrases), automated onchain operations with server-side wallets, AI agent wallets with policy-scoped signing, enterprise key management, and verifiable off-chain workloads on Turnkey Verifiable Cloud (TVC).
> Every API call is a JSON POST to https://api.turnkey.com signed with a P-256 API key; create an organization and key self-serve at https://app.turnkey.com.
> Key Turnkey developer resources: API reference (https://docs.turnkey.com/api-reference/overview/intro.md), OpenAPI spec (https://docs.turnkey.com/public_api.swagger.json), authentication (https://docs.turnkey.com/features/authentication/overview.md), webhooks (https://docs.turnkey.com/features/webhooks/overview.md), MCP server for docs search (https://docs.turnkey.com/mcp), agent skills (https://docs.turnkey.com/get-started/ai-skills.md), CLI (https://docs.turnkey.com/sdks/cli.md), SDK reference (https://docs.turnkey.com/sdks/introduction.md), full docs content (https://docs.turnkey.com/llms-full.txt).

# Deploy a vault wrapper

> Enable a yield vault for your organization by deploying its fee wrapper, a one-time setup step that also sets your fee.

Before your users can deposit into a vault, your organization must deploy a **fee wrapper** for it. The wrapper is the contract users actually deposit into. It routes funds to the underlying vault, and the applicable fees accrue onchain to a fee splitter as yield accrues. Deploying it is a one-time activity per vault, with gas sponsored by Turnkey.

## When to deploy

Deploy once per vault you want to offer, per fee configuration. Deposits into a vault with no deployed wrapper fail with `EARN_SETUP_REQUIRED` (see [Deposit into a vault](/features/transaction-management/earn/deposit#prerequisites)). Pick vaults from the [vault catalog](/features/transaction-management/earn/vault-catalog); the catalog's `enabled` flag tells you which vaults your organization has already enabled.

## Choose your fee configuration

The deploy intent carries your fee:

* `clientFeeBps`: your fee on gross yield, in basis points (`"2000"` = 20%). It is capped at 4,000 bps; combined with Turnkey's fee (10% of yield by default), the total cannot exceed 5,000 bps (50% of yield); deployments above the cap are rejected. See the [fee model](/features/transaction-management/earn#fees) for current rates and caps.
* `clientFeeWallet`: the address that receives your fee payouts onchain. It must be a wallet account owned by your organization; addresses outside your org are rejected.

<Warning>
  The fee configuration is bound into the wrapper's deterministic (CREATE2) address. Deploying the same vault with a different `clientFeeBps` or `clientFeeWallet` produces a new wrapper at a new address. Positions in the old wrapper remain fully withdrawable; new deposits should target the new wrapper. To change your fee, redeploy and point deposits at the new address.
</Warning>

## Submit the activity

Submit an [`ACTIVITY_TYPE_EARN_DEPLOY_WRAPPER`](/api-reference/activities/deploy-earn-wrapper) activity with the vault's address (from the catalog), its CAIP-2 chain, and your fee configuration. For Aave, the catalog's `vaultAddress` is the reserve's underlying asset address; pass it through as-is. See [Deploy Earn wrapper](/api-reference/activities/deploy-earn-wrapper) in the API reference for the full request/response schema and cURL example.

<Note>
  **Aave only:** Aave takes a small initial deposit at deployment and permanently locks it in the reserve, so a newly deployed Aave wrapper shows a small position straight away, about \$1 for stablecoin reserves. Turnkey currently funds this deposit from its own wallet. See [Aave's deployment docs](https://aave.com/docs/vaults/simple-earn/deploy#define-configuration).
</Note>

The activity result returns the deployed addresses immediately; they are derived deterministically before the transaction confirms:

* `wrapperAddress`: the deposit target for this vault.
* `splitterAddress`: the fee splitter that distributes fees between you and Turnkey (a `PaymentSplitter` for Morpho, a `RevenueSplitterOwner` for Aave).
* `deployRequestId`: poll handle for the deployment transaction.

## Poll deployment status

The activity completes when the deployment transaction is broadcast, not when it confirms. Poll [`get_earn_deploy_status`](/api-reference/queries/get-earn-deploy-status) with the `deployRequestId` until it reports `COMPLETED` before accepting deposits. `status` is `PENDING`, `COMPLETED`, or `FAILED`; on `COMPLETED` the response carries the `deployTxHash`, and on `FAILED` it includes an `error` field with the reason.

## Gas and idempotency

<Note>
  Wrapper deployment gas costs are currently covered by Turnkey’s infrastructure and are not charged to you or your users. This is subject to change. Deployments are also idempotent: resubmitting the activity with identical parameters re-derives the same wrapper and splitter addresses and skips the broadcast if the contracts already exist, so retries are safe.
</Note>

## Next steps

* [Browse the vault catalog](/features/transaction-management/earn/vault-catalog) to pick vaults to enable
* [Deposit into a vault](/features/transaction-management/earn/deposit) once the deployment is `COMPLETED`
* Review the [fee model](/features/transaction-management/earn#fees)
