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

# SKILL

> Enter (deposit into) a yield position on Yield.xyz by creating an enter action, signing its unsigned transactions, and submitting them. Use when the user wants to stake, deposit, lend, or otherwise enter a yield.

# Enter position

Create an enter action with `POST /v1/actions/enter`. The API returns ordered unsigned transactions. You sign them, then either submit the signed payload for Yield.xyz to broadcast or broadcast it yourself and submit the hash.

## When to use

* Stake tokens (for example, "Stake 1 ETH with Lido")
* Deposit into a lending market or vault
* Start earning on a token

## Authentication and host

Send the project API key in the `x-api-key` header.

```
https://api.yield.xyz/v1
```

## Step 1: Check the yield accepts deposits

```bash theme={null}
curl "https://api.yield.xyz/v1/yields/{yieldId}" -H "x-api-key: $YIELD_API_KEY"
```

Confirm `status.enter` is `true`. If the yield has `mechanics.requirements.kycRequired`, check KYC first with `GET /v1/yields/{yieldId}/kyc/status?address=...`.

## Step 2: Read the argument schema

Read `mechanics.arguments.enter.fields[]` from the yield. Common arguments:

| Argument | Type | Notes |
| - | - | - |
| `amount` | string | Human-readable decimal, for example `"1.5"` for 1.5 USDC. Not the smallest unit. |
| `amountRaw` | string | Smallest unit. Use instead of `amount`, never both. |
| `validatorAddress` / `validatorAddresses` | string / string\[] | For validator yields. Pick from `GET /v1/yields/{yieldId}/validators`. |
| `providerId` | string | Ethereum native staking provider. |
| `inputToken` | string | Token to deposit when several are accepted. `0x` is the native token. Add `inputTokenNetwork` for cross-chain deposits. |
| `feeConfigurationId` | string | Optional fee configuration. |
| `subnetId`, `duration`, `tronResource` | various | Network-specific: Bittensor, Avalanche, Tron. |
| `skipPrechecks` | boolean | Skips pre-flight balance and rent checks. |

The schema on the yield is authoritative. Send only fields it lists.

## Step 3: Create the enter action

`POST /v1/actions/enter`. `yieldId` and `address` are required. `arguments` is optional in the schema, but most yields need fields.

```bash theme={null}
curl -X POST "https://api.yield.xyz/v1/actions/enter" \
  -H "x-api-key: $YIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "yieldId": "ethereum-eth-lido-staking",
    "address": "0xYOUR_WALLET_ADDRESS",
    "arguments": { "amount": "0.01" }
  }'
```

With a validator:

```json theme={null}
{
  "yieldId": "cosmos-atom-native-staking",
  "address": "cosmos1YOUR_ADDRESS",
  "arguments": { "amount": "10", "validatorAddress": "cosmosvaloper1VALIDATOR" }
}
```

The response is `201` with an `ActionDto`: `id`, `intent: "enter"`, `type`, `status`, `executionPattern`, and `transactions[]`. Each transaction has `id`, `type`, `status`, `stepIndex`, `unsignedTransaction`, and `network`. Solana enters can also return `entryReserveEstimate`.

Optionally call `POST /v1/actions/enter/simulate` first to estimate gas. Simulation does not count against the action creation limit.

## Step 4: Sign and submit each transaction

Process `transactions[]` in `stepIndex` order.

* If `executionPattern` is `synchronous`, wait for each transaction to confirm before the next.
* If it is `batch`, one transaction bundles several operations.
* `asynchronous` is also a declared value, but current actions return `synchronous` or `batch`.

Sign `unsignedTransaction` with the user's wallet, then use one path per transaction, never both:

**A. Yield.xyz broadcasts:** `POST /v1/transactions/{transactionId}/submit` with body `{ "signedTransaction": "..." }`. Returns `201` with the updated transaction, including `hash`.

**B. You broadcast:** `PUT /v1/transactions/{transactionId}/submit-hash` with body `{ "hash": "0x..." }`. Returns `200`.

```bash theme={null}
curl -X PUT "https://api.yield.xyz/v1/transactions/{transactionId}/submit-hash" \
  -H "x-api-key: $YIELD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "hash": "0xTRANSACTION_HASH" }'
```

## Step 5: Track completion

`GET /v1/actions/{actionId}` until `status` is terminal: `SUCCESS`, `FAILED`, or `CANCELED`. Track a single transaction with `GET /v1/transactions/{transactionId}`; `CONFIRMED`, `FAILED`, and `SKIPPED` are terminal. If a broadcast fails, the action moves to `FAILED`; create a new action to retry.

## Errors

| Status | Meaning | Action |
| - | - | - |
| 400 | Invalid arguments, or the yield is unknown or not enabled for the project | Check `yieldId`, `address`, and the argument schema. |
| 401 | Missing or invalid API key | Check the `x-api-key` header. |
| 403 | Geo-blocked region | Stop. The user cannot proceed from this region. |
| 412 | Yield closed for new deposits (`status.enter` is `false`) | Choose another yield. |
| 429 | Rate limited | Wait for `retry-after` seconds. |

## Edge cases

* **Approvals:** EVM lending and vault yields often return an `APPROVAL` transaction before the deposit. Run them in order.
* **Minimums:** Entry limits are in `mechanics.entryLimits`. Amounts below them fail with `400`.
* **Stale actions:** An action with no progress for 30 minutes becomes `STALE`. Create a new one.
* **Never reuse signed payloads:** A terminal transaction rejects a different signed payload or hash with `412`.


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