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

# Execute an Action

> Execute a trading action

## Execute Action

Creates a trading action (open position, close position, etc.).

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.yield.xyz/v1/perps/actions \
    -H "x-api-key: your_api_key" \
    -H "Content-Type: application/json" \
    -d '{
      "provider": "hyperliquid",
      "type": "OPEN_POSITION",
      "args": {
        "market": "BTC-USD-PERP",
        "side": "LONG",
        "size": "0.5",
        "leverage": 10
      },
      "addresses": {
        "address": "0x...",
        "network": "hyperliquid"
      }
    }'
  ```
</RequestExample>

## Response

```json theme={null}
{
  "id": "action_123",
  "status": "created",
  "transactions": [
    {
      "id": "tx_456",
      "unsignedTransaction": {...}
    }
  ]
}
```
