> ## 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.

# Actions

> Execute enter, exit, and manage operations on yield positions

## What Actions Do

Actions turn protocol-specific yield operations into a single, normalized interface. Instead of integrating each protocol's SDK or smart contract, you call one API and receive **ordered, unsigned transactions** ready for signing.

<CardGroup cols={3}>
  <Card title="Enter" icon="arrow-right-to-bracket">
    Deposit assets to start earning yield
  </Card>

  <Card title="Exit" icon="arrow-right-from-bracket">
    Withdraw assets from a position
  </Card>

  <Card title="Manage" icon="sliders">
    Claim rewards, compound, redelegate, or perform other operations
  </Card>
</CardGroup>

***

## How Actions Work

<Steps>
  <Step title="Request an action">
    Call `POST /v1/actions/enter` (or `exit`, `manage`) with the `yieldId`, user address, and required arguments.
  </Step>

  <Step title="Receive unsigned transactions">
    The API returns one or more ordered transactions with gas estimates. These are ready to sign — no protocol-specific logic required.
  </Step>

  <Step title="Sign and submit">
    Route the unsigned payloads through your signing infrastructure (browser wallet, hardware device, custody platform, or smart account).
  </Step>

  <Step title="Report transaction hashes">
    Submit the broadcast transaction hash back to the API for lifecycle tracking.
  </Step>
</Steps>

<Info>
  Yield.xyz never holds keys or executes transactions. You retain full custody and signing control.
</Info>

***

## Ordered Unsigned Transactions

Actions may return **multiple transactions** that must be executed in order:

| Step | Example                        |
| ---- | ------------------------------ |
| 1    | Approve token spending         |
| 2    | Deposit into protocol          |
| 3    | (Optional) Stake receipt token |

Each transaction includes:

* `unsignedTransaction` — the payload to sign
* `gasEstimate` — suggested gas parameters
* `type` — describes the operation (approve, stake, claim, etc.)

<Warning>
  Always execute transactions in the order returned. Some steps depend on prior transactions being confirmed.
</Warning>

***

## Signing Responsibility

Yield.xyz is **signer-agnostic**. The API returns unsigned payloads that work with any signing infrastructure:

<Tabs>
  <Tab title="Browser wallets">
    MetaMask, Phantom, Keplr, etc.

    Pass `unsignedTransaction` to the wallet's signing method.
  </Tab>

  <Tab title="Hardware wallets">
    Ledger, Trezor via Ledger Live or similar.

    Route through your hardware wallet integration.
  </Tab>

  <Tab title="Smart accounts">
    Safe, Kernel, Stackup, and other ERC-4337 accounts.

    Bundle transactions or execute through your smart account SDK.
  </Tab>

  <Tab title="MPC & custody">
    Fireblocks, Copper, BitGo, and other institutional custody platforms.

    Submit unsigned payloads to your custody provider's signing flow.
  </Tab>
</Tabs>

***

## Management Actions

Beyond enter and exit, yields may support additional operations:

<AccordionGroup>
  <Accordion title="CLAIM_REWARDS">
    Claim pending rewards to the user's wallet. Common for Cosmos staking, some DeFi protocols.
  </Accordion>

  <Accordion title="RESTAKE_REWARDS">
    Compound rewards back into the position. Available where protocols support auto-compounding.
  </Accordion>

  <Accordion title="CLAIM_UNSTAKED">
    Claim funds after an unbonding period completes. Required for protocols with cooldowns.
  </Accordion>

  <Accordion title="REDELEGATE">
    Move staked assets from one validator to another without unstaking. Common for Cosmos, Polkadot.
  </Accordion>

  <Accordion title="WITHDRAW">
    Finalize a vault withdrawal after any required waiting period.
  </Accordion>
</AccordionGroup>

<Tip>
  Check the yield's `pendingActions` field in balances to see which management actions are currently available for a position.
</Tip>

***

## Smart Routing

If a user holds a different token than the yield expects, the API can return a route that includes swaps or bridges before the deposit. This is handled transparently — you receive the full transaction sequence.

***

## Monetization

Actions can include fee collection as part of the transaction flow. See [Fees](/documentation/core-concepts/fees) for details on:

* Deposit fees (deducted at entry)
* Performance fees (on rewards)
* Management fees (on AUM)

Fee logic is embedded in the transaction construction — no additional integration required.

***

## API Reference

For complete endpoint documentation:

<CardGroup cols={2}>
  <Card title="Enter" icon="arrow-right-to-bracket" href="/api-reference/ActionsController_enterYield">
    POST /v1/actions/enter
  </Card>

  <Card title="Exit" icon="arrow-right-from-bracket" href="/api-reference/ActionsController_exitYield">
    POST /v1/actions/exit
  </Card>

  <Card title="Manage" icon="sliders" href="/api-reference/ActionsController_manageYield">
    POST /v1/actions/manage
  </Card>

  <Card title="Get Action" icon="circle-info" href="/api-reference/ActionsController_getAction">
    GET /v1/actions/{id}
  </Card>
</CardGroup>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Balances & Positions" icon="wallet" href="/documentation/core-concepts/balances-positions">
    Track positions and lifecycle states
  </Card>

  <Card title="Quickstart" icon="rocket" href="/documentation/quickstart">
    Run the complete flow end-to-end
  </Card>
</CardGroup>
