> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yield.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Zama

> Deposit confidential tokens into Zama confidential vaults on Ethereum, where amounts stay encrypted on-chain and deposits and private withdrawals settle in daily batches.

The Zama integration gives access to confidential vaults: vaults whose deposit and balance amounts are encrypted on-chain with Zama's [fully homomorphic encryption](https://docs.zama.org/protocol/protocol/overview) (FHE). You deposit the confidential version of a token (cUSDC, cUSDT, cWBTC or cAUSD) and receive an ERC-7984 confidential share token. Each mainnet vault is a Morpho Vaults V2 vault wrapped for confidentiality, so the strategy underneath is public while each holder's amounts stay private.

## Availability

| Yield ID | Name | Deposit token | Share token |
| - | - | - | - |
| `ethereum-usdc-zama-steakhouse-usdc-confidential-vault` | Steakhouse Confidential Prime USDC | cUSDC | csteakcUSDC |
| `ethereum-usdt-zama-flowdesk-usdt-high-yield-confidential-vault` | Flowdesk Confidential High Yield USDT | cUSDT | cfcUSDT |
| `ethereum-usdc-zama-rockawayx-usdc-rwa-confidential-vault` | RockawayX Confidential RWA USDC | cUSDC | croxcUSDC |
| `ethereum-usdt-zama-steakhouse-usdt-prime-confidential-vault` | Steakhouse Prime USDT | cUSDT | csteakUSDT |
| `ethereum-wbtc-zama-wintermute-wbtc-confidential-vault` | Wintermute Confidential WBTC | cWBTC | carmcWBTC |
| `ethereum-ausd-zama-bitwise-ausd-rwa-confidential-vault` | Bitwise Premium RWA AUSD | cAUSD | cPAPY |

All six vaults are on Ethereum mainnet. For testing, `ethereum-sepolia-usdc-zama-steakhouse-usdc-confidential-vault` runs on Ethereum Sepolia with test cUSDC and a zero reward rate.

Enable the Zama yields for your project in the Yield.xyz dashboard, from the project's [enabled-yields list](https://docs.yield.xyz/documentation/advanced-setup/dashboard/yield-blocking.md). If you do not have a project yet, [set one up](https://docs.yield.xyz/documentation/get-started/onboarding.md) first. Then query [`GET /v1/yields?providers=zama`](https://docs.yield.xyz/api-reference/YieldsController_getYields) for the live list of Zama vaults enabled for your project. Contract addresses are on the yield object, in the `tokens`, `rewardTokens` and argument options, so read them from there rather than hardcoding them.

## Confidential tokens

A confidential token is an [ERC-7984](https://docs.zama.org/protocol/examples/openzeppelin-confidential-contracts/erc7984) token whose balances and transfer amounts are encrypted on-chain. Each one wraps a plain ERC-20 token and holds the same value. A Zama vault takes the confidential token, not the plain one.

| Plain token | Confidential token |
| - | - |
| USDC | cUSDC |
| USDT | cUSDT |
| WBTC | cWBTC |
| AUSD | cAUSD |

How a user takes a position depends on what the wallet holds:

* **The wallet holds cUSDC.** It deposits cUSDC directly.
* **The wallet holds USDC.** It wraps USDC into cUSDC first: an approval of USDC if the allowance is short, then a wrap on cUSDC, which is the [wrapper contract](https://docs.zama.org/protocol/protocol-apps/confidential-tokens/confidential-wrapper) for USDC. The [Zama widget](https://docs.yield.xyz/guides/zama/widget.md) sends these transactions for the user, and the [Zama API guide](https://docs.yield.xyz/guides/zama/index.md#2-get-the-confidential-token) shows them in code.

Wrapping keeps the value one to one. Confidential tokens have 6 decimals, so cUSDC, cUSDT and cAUSD match their plain tokens unit for unit. WBTC has 8 decimals, so wrapping rounds the amount down to a multiple of 0.000001 WBTC and refunds the rest to the wallet.

To get the plain token back from a vault, use an [instant exit](#exiting), which pays out the plain token, such as USDC, directly. A private exit pays out the confidential token. Yield.xyz does not unwrap a confidential token held in the wallet; the wrapper contract itself supports a two-step unwrap, covered in the Zama wrapper docs linked above.

## How confidential deposits work

When you deposit, your app encrypts the amount with the Zama SDK before it goes on-chain, so the amount you join a batch with stays encrypted. To keep the chosen vault private too, a deposit carries an encrypted amount for every Zama vault of that asset: the real amount for the vault you chose and an encrypted zero for each of the others. Anyone reading the chain sees a deposit into every vault of that asset and cannot tell which one holds the real amount.

Deposits do not enter the vault one by one. They join a batch, and the batch settles against the vault as one combined amount. Your position starts earning when its batch settles.

Confidentiality has limits that Zama documents in [Confidentiality](https://docs.zama.org/protocol/confidential-vault/concepts/confidentiality):

* **Wrapping is public.** Wrapping USDC into cUSDC is a public transfer, so a wrap right before a deposit shows the most the deposit can be. Wrapping early, or holding a confidential balance, avoids this.
* **Batch totals are public.** Each batch decrypts one value, its total. Who joined and when is public too.
* **A batch with one participant reveals that amount**, because the total is that one amount.
* **The vault you join is public**, unless every request sends a leg to each vault, as Yield.xyz requests do.

### Batch schedule

| | Daily cutoff | Settlement |
| - | - | - |
| Deposits | 15:00 UTC | About one day |
| Private withdrawals | 11:00 UTC | About one day |

The yield's `investmentSchedule` exposes this schedule (see [Yield metadata](https://docs.yield.xyz/documentation/earn/core-concepts/yield-metadata.md)), and a pending position's `date` shows when its batch is due, while the batch can still be canceled. A confirmed transaction means a request joined a batch, not that the batch settled: the action records `DEPOSIT_SETTLED`, `REDEMPTION_SETTLED` or a cancellation in its `events` when the outcome is known. The settled position shows in balances straight away, and the pending row usually clears within about 10 minutes for a deposit and about 20 minutes for a private exit.

## Entering

You enter with the confidential token only: pass it as `inputToken`, and the action returns one `DEPOSIT` transaction. A plain token such as USDC is rejected, so wrap it first. The yield's `inputTokens` also lists the plain token because the Zama widget wraps it for the user, but `enter` itself accepts only the confidential token. The Earn API takes encrypted amounts only, and a request with a plain `amount` other than `"0"` is rejected. Your app encrypts the amount with the Zama SDK and sends the encrypted values as action arguments. The [Zama API guide](https://docs.yield.xyz/guides/zama/index.md) covers the arguments, the encryption and the [error responses](https://docs.yield.xyz/guides/zama/index.md#errors-and-troubleshooting) step by step.

The [Zama widget](https://docs.yield.xyz/guides/zama/widget.md) handles wrapping and encryption for the user, so a widget integration needs no Zama code of its own.

## Exiting

A Zama exit is either private or instant. You pick one with the exit's `outputToken`.

* **Private.** Omit `outputToken` or set it to the confidential token. The withdrawal joins the next daily batch and pays out in the confidential token, so the amount stays encrypted.
* **Instant.** Set `outputToken` to the plain token (for example USDC). The withdrawal does not wait for a batch, but the amount becomes public. It finishes with a `WITHDRAW` pending action on the `withdrawable` balance, which returns `WITHDRAW` and `REDEEM`. If it stops after `WITHDRAW`, resume the `REDEEM` from the action. See [Exit instantly](https://docs.yield.xyz/guides/zama/index.md#9-exit-instantly).

The [Zama API guide](https://docs.yield.xyz/guides/zama/index.md) covers the transactions for each path, including the public decrypt step of an instant exit.

## Pending requests and canceling

A deposit or private withdrawal made through Yield.xyz actions shows, while it waits for its batch, as an `entering` or `exiting` balance with a `CANCEL_PENDING` pending action, submitted through [`POST /v1/actions/manage`](https://docs.yield.xyz/documentation/earn/core-concepts/actions). A request made only outside Yield.xyz, for example in the Zama app, does not show as pending. Once the batch settles, a deposit shows as an `active` balance, and a private withdrawal pays the confidential token to the wallet. An instant exit started outside Yield.xyz has no `withdrawable` balance, so finish it in the app where it started. Canceling returns everything that wallet has in that batch, including amounts added to the same batch from the Zama app, straight to the wallet: a canceled deposit returns the confidential token (for example cUSDC), and a canceled private withdrawal returns the vault share token. A batch cannot be partly canceled, and a batch that has been sent to the vault cannot be canceled. While a cancel is waiting to confirm, the position stays listed without a cancel action.

## Balances

Zama balances are encrypted. An encrypted Zama balance has `isEncrypted: true`, an empty `amount`, the encrypted handle in `shareAmountRaw`, and no USD value. The only plain row is an instant exit waiting for its final `REDEEM`. Only the owner can reveal an amount, by signing a decryption permit with their wallet. Settled positions are read on-chain wherever they were made. To find one made outside Yield.xyz with a network-wide balances call, pass the vault's `yieldId`. If your project returns balances only for yields the address has used through Yield.xyz, the position shows after its first action on that vault through Yield.xyz (see [Read and reveal balances](https://docs.yield.xyz/guides/zama/index.md#7-read-and-reveal-balances)). See [Balances and positions](https://docs.yield.xyz/documentation/earn/core-concepts/balances-positions.md) for the balance types.

> [!NOTE]
>
> After a deposit or a private withdrawal, positions in other Zama vaults of the same asset can appear. They are encrypted like any other Zama balance and reveal as zero. They come from the encrypted zero amounts sent to the vaults you did not choose, which is how Zama keeps the chosen vault private.

## Reward rate

The reward rate is the base APY of the underlying vault. Share value rises as the vault earns, and no claim step is needed.

> [!NOTE]
>
> Zama campaign incentives need a separate opt-in in the [Zama app](https://app.zama.org). The Earn API and the widget do not perform this opt-in, and the reward rate does not include these incentives.

## List the live yields

Copy this request to list the Zama yields enabled for your project. Yield IDs change as vaults are added, so query the API rather than hardcoding them.

```bash theme={null}
curl "https://api.yield.xyz/v1/yields?providers=zama&limit=100" \
  -H "x-api-key: $YIELD_API_KEY"
```

## Next steps

> [card] [Zama API](https://docs.yield.xyz/guides/zama/index.md)
>
> Encrypt amounts, enter, exit, cancel, and reveal balances through the Earn API.

> [card] [Zama widget](https://docs.yield.xyz/guides/zama/widget.md)
>
> Offer Zama vaults in the widget, with wrapping and encryption handled for you.

> [card] [Vaults](https://docs.yield.xyz/documentation/earn/defi/vaults/index.md)
>
> Compare Zama against other vault integrations.

> [card] [Zama documentation](https://docs.zama.org/protocol)
>
> Zama's own docs on the protocol, confidential tokens and the SDK.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.