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

# Vaults

> Deposit into a third-party protocol or curator vault, track the share position, and exit, including a queued exit.

Deposit into a third-party protocol or curator vault through the Yield API, track the resulting share position, and exit it, including a vault that queues its exit behind a cooldown.

<Note>
  This is Earn › DeFi › Vaults: third-party vaults such as Morpho curator vaults. yield.xyz's own vault infrastructure (OAVs, Meta Vaults) is a different product; see [Platform › Vaults](/documentation/platform/vaults/index).
</Note>

## Prerequisites

* A yield.xyz API key, sent as `x-api-key` on every request.
* A vault yield enabled for your project. See [Discover yields](/guides/earn/discover-yields).
* A signer for the target chain. This guide uses a generic `signAndBroadcast` placeholder; see [Transaction signing](/guides/transaction-signing/index).

## Part A: an instant-redemption vault (Morpho)

### Discover a vault

Morpho vault yield IDs embed the vault's contract address, so they aren't stable across a whole product line the way `base-usdc-aave-v3-lending` is for lending. Discover them instead of hardcoding one:

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.yield.xyz/v1/yields?types=vault&providers=morpho&network=base&inputToken=USDC' \
    --header "x-api-key: $YIELD_API_KEY"
  ```

  ```typescript TypeScript theme={null}
  const params = new URLSearchParams({
    types: 'vault',
    providers: 'morpho',
    network: 'base',
    inputToken: 'USDC',
  });
  const res = await fetch(`https://api.yield.xyz/v1/yields?${params}`, {
    headers: { 'x-api-key': process.env.YIELD_API_KEY! },
  });
  const { items } = await res.json();
  const vault = items[0]; // pick a result; don't freeze an id in your own code
  ```
</CodeGroup>

```json Response (excerpt, one example result) theme={null}
{
  "id": "base-usdc-steakusdc-0xbeef0e0834849acc03f0089f01f4f1eeb06873c9-4626-vault",
  "providerId": "morpho",
  "metadata": { "name": "Steakhouse Prime Instant Morpho V2 Vault" },
  "outputToken": { "symbol": "steakUSDC" }
}
```

That `id` is one example, not a fixed value: pick from `items` at runtime. `metadata.name` identifies the vault and `outputToken` is its share token. The yield object also has an optional `curator` field; don't assume a vault result carries it.

### Read the schema, then enter

Read `mechanics.arguments.enter.fields` from `GET /v1/yields/{yieldId}` before building the request, the same pattern as [Enter and exit flows](/guides/earn/enter-exit-flows#build-the-enter-arguments-from-the-schema). A Morpho vault's enter schema takes `amount` (required), plus optional `useMaxAllowance` and `receiverAddress`.

```bash cURL theme={null}
curl --request POST \
  --url https://api.yield.xyz/v1/actions/enter \
  --header "x-api-key: $YIELD_API_KEY" \
  --header 'content-type: application/json' \
  --data '{
    "yieldId": "base-usdc-steakusdc-0xbeef0e0834849acc03f0089f01f4f1eeb06873c9-4626-vault",
    "address": "0xYOUR_WALLET_ADDRESS",
    "arguments": { "amount": "100" }
  }'
```

The response is an approval transaction (`SKIPPED` if your allowance already covers `amount`) followed by a `SUPPLY` transaction that deposits and mints vault shares. Sign, submit, and poll both through [Enter and exit flows](/guides/earn/enter-exit-flows#enter-a-position).

### Track the share position

```bash cURL theme={null}
curl --request POST \
  --url https://api.yield.xyz/v1/yields/base-usdc-steakusdc-0xbeef0e0834849acc03f0089f01f4f1eeb06873c9-4626-vault/balances \
  --header "x-api-key: $YIELD_API_KEY" \
  --header 'content-type: application/json' \
  --data '{ "address": "0xYOUR_WALLET_ADDRESS" }'
```

```json Response (excerpt) theme={null}
{
  "balances": [
    {
      "type": "active",
      "amount": "100.42",
      "shareAmount": "98.10",
      "shareToken": { "symbol": "steakUSDC" },
      "isEarning": true,
      "pendingActions": []
    }
  ]
}
```

`amount` is the position in the underlying asset (USDC); `shareAmount` and `shareToken` are the vault share balance and share token that back it, alongside it on the same balance. As the vault's strategy earns, the share's redemption value rises, so `amount` grows against a `shareAmount` that only changes when you enter or exit.

<Note>
  Morpho vaults on Ethereum can also carry a separate `MORPHO` reward balance with a `CLAIM_REWARDS` pending action, when the vault has one. Run it through `POST /v1/actions/manage` like any other pending action; see [Morpho](/documentation/earn/defi/vaults/morpho).
</Note>

### Exit

```bash cURL theme={null}
curl --request POST \
  --url https://api.yield.xyz/v1/actions/exit \
  --header "x-api-key: $YIELD_API_KEY" \
  --header 'content-type: application/json' \
  --data '{
    "yieldId": "base-usdc-steakusdc-0xbeef0e0834849acc03f0089f01f4f1eeb06873c9-4626-vault",
    "address": "0xYOUR_WALLET_ADDRESS",
    "arguments": { "useMaxAmount": true }
  }'
```

This redeems shares back to the underlying asset in a single transaction, no cooldown, as long as the vault's own on-chain liquidity covers the redemption. `mechanics.arguments.exit` also accepts `shareAmount` in place of `amount` when you want to specify the exit in shares rather than the underlying asset.

## Part B: a queued exit (Ethena)

`ethena-usde-staking` deposits USDe on Ethereum and holds sUSDe, but its exit isn't instant: it has a 7-day `cooldownPeriod`.

<Steps>
  <Step title="Start the exit">
    ```bash cURL theme={null}
    curl --request POST \
      --url https://api.yield.xyz/v1/actions/exit \
      --header "x-api-key: $YIELD_API_KEY" \
      --header 'content-type: application/json' \
      --data '{
        "yieldId": "ethena-usde-staking",
        "address": "0xYOUR_WALLET_ADDRESS",
        "arguments": { "amount": "100" }
      }'
    ```

    Sign and submit this the same way as any other exit. It doesn't withdraw funds yet: it starts the protocol's cooldown.
  </Step>

  <Step title="See the exiting balance">
    ```bash cURL theme={null}
    curl --request POST \
      --url https://api.yield.xyz/v1/yields/ethena-usde-staking/balances \
      --header "x-api-key: $YIELD_API_KEY" \
      --header 'content-type: application/json' \
      --data '{ "address": "0xYOUR_WALLET_ADDRESS" }'
    ```

    ```json Response (excerpt, during cooldown) theme={null}
    {
      "balances": [
        { "type": "exiting", "amount": "100", "date": "2026-10-07T00:00:00Z", "pendingActions": [] }
      ]
    }
    ```

    The balance's `type` is `exiting` for the full cooldown window; `date` is when it ends. There's no pending action to run yet.
  </Step>

  <Step title="Claim after cooldown">
    Once `date` has passed, the same balance call returns a `CLAIM_UNSTAKED` pending action:

    ```json Response (excerpt, after cooldown) theme={null}
    {
      "balances": [
        {
          "type": "withdrawable",
          "amount": "100",
          "pendingActions": [
            { "type": "CLAIM_UNSTAKED", "passthrough": "PASSTHROUGH_FROM_THE_BALANCE" }
          ]
        }
      ]
    }
    ```

    Execute it with `POST /v1/actions/manage`, passing the pending action's own `type` as `action` and its `passthrough` unchanged:

    ```bash cURL theme={null}
    curl --request POST \
      --url https://api.yield.xyz/v1/actions/manage \
      --header "x-api-key: $YIELD_API_KEY" \
      --header 'content-type: application/json' \
      --data '{
        "yieldId": "ethena-usde-staking",
        "address": "0xYOUR_WALLET_ADDRESS",
        "action": "CLAIM_UNSTAKED",
        "passthrough": "PASSTHROUGH_FROM_THE_BALANCE"
      }'
    ```

    Sign and submit the returned transaction like any other, then read balances again to confirm the funds have moved to your wallet.
  </Step>
</Steps>

Other vaults queue their exit differently: Maple queues redemption through the pool's own withdrawal manager, and Veda-based vaults (Veda, Ether.fi Liquid, Kinetiq) use an on-chain withdrawal queue with a per-vault cooldown. Check each protocol's own page rather than assuming Ethena's shape; see [Vaults](/documentation/earn/defi/vaults/index).

## Next steps

<Columns cols={2}>
  <Card title="Enter and exit flows" icon="arrow-right-arrow-left" href="/guides/earn/enter-exit-flows">
    The full branch, sign, submit, and poll loop reused above.
  </Card>

  <Card title="Tracking balances" icon="wallet" href="/guides/earn/tracking-balances">
    Build portfolio views across share and underlying-asset positions.
  </Card>
</Columns>


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