Execute an action
Build the unsigned transactions for a perps action such as opening a position, and return them for the wallet to sign.
curl --request POST \
--url https://perps.yield.xyz/v1/actions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"providerId": "hyperliquid",
"address": "0x1234...",
"action": "open",
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 2000,
"stopLossPrice": 1800,
"takeProfitPrice": 2200,
"orderId": "12345",
"orderIds": [
"12345",
"67890"
],
"assetIndex": 0,
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "My Trading Bot",
"validUntil": 1735689600,
"stopLossOrderId": "12345",
"takeProfitOrderId": "12346",
"skipApproval": true,
"fundingMethod": "bridge2",
"enabled": true
}
}
'import requests
url = "https://perps.yield.xyz/v1/actions"
payload = {
"providerId": "hyperliquid",
"address": "0x1234...",
"action": "open",
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 2000,
"stopLossPrice": 1800,
"takeProfitPrice": 2200,
"orderId": "12345",
"orderIds": ["12345", "67890"],
"assetIndex": 0,
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "My Trading Bot",
"validUntil": 1735689600,
"stopLossOrderId": "12345",
"takeProfitOrderId": "12346",
"skipApproval": True,
"fundingMethod": "bridge2",
"enabled": True
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providerId: 'hyperliquid',
address: '0x1234...',
action: 'open',
args: {
marketId: 'hyperliquid-eth-usdc',
side: 'long',
amount: '100',
size: '1000',
leverage: 10,
marginMode: 'isolated',
limitPrice: 2000,
stopLossPrice: 1800,
takeProfitPrice: 2200,
orderId: '12345',
orderIds: ['12345', '67890'],
assetIndex: 0,
agentAddress: '0x1234567890abcdef1234567890abcdef12345678',
agentName: 'My Trading Bot',
validUntil: 1735689600,
stopLossOrderId: '12345',
takeProfitOrderId: '12346',
skipApproval: true,
fundingMethod: 'bridge2',
enabled: true
}
})
};
fetch('https://perps.yield.xyz/v1/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://perps.yield.xyz/v1/actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providerId' => 'hyperliquid',
'address' => '0x1234...',
'action' => 'open',
'args' => [
'marketId' => 'hyperliquid-eth-usdc',
'side' => 'long',
'amount' => '100',
'size' => '1000',
'leverage' => 10,
'marginMode' => 'isolated',
'limitPrice' => 2000,
'stopLossPrice' => 1800,
'takeProfitPrice' => 2200,
'orderId' => '12345',
'orderIds' => [
'12345',
'67890'
],
'assetIndex' => 0,
'agentAddress' => '0x1234567890abcdef1234567890abcdef12345678',
'agentName' => 'My Trading Bot',
'validUntil' => 1735689600,
'stopLossOrderId' => '12345',
'takeProfitOrderId' => '12346',
'skipApproval' => true,
'fundingMethod' => 'bridge2',
'enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://perps.yield.xyz/v1/actions"
payload := strings.NewReader("{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234...\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 2000,\n \"stopLossPrice\": 1800,\n \"takeProfitPrice\": 2200,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"12345\",\n \"67890\"\n ],\n \"assetIndex\": 0,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"My Trading Bot\",\n \"validUntil\": 1735689600,\n \"stopLossOrderId\": \"12345\",\n \"takeProfitOrderId\": \"12346\",\n \"skipApproval\": true,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://perps.yield.xyz/v1/actions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234...\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 2000,\n \"stopLossPrice\": 1800,\n \"takeProfitPrice\": 2200,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"12345\",\n \"67890\"\n ],\n \"assetIndex\": 0,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"My Trading Bot\",\n \"validUntil\": 1735689600,\n \"stopLossOrderId\": \"12345\",\n \"takeProfitOrderId\": \"12346\",\n \"skipApproval\": true,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://perps.yield.xyz/v1/actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234...\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 2000,\n \"stopLossPrice\": 1800,\n \"takeProfitPrice\": 2200,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"12345\",\n \"67890\"\n ],\n \"assetIndex\": 0,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"My Trading Bot\",\n \"validUntil\": 1735689600,\n \"stopLossOrderId\": \"12345\",\n \"takeProfitOrderId\": \"12346\",\n \"skipApproval\": true,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"providerId": "hyperliquid",
"action": "open",
"status": "CREATED",
"summary": {
"type": "Open Position",
"assetId": 11,
"orderType": "market",
"direction": "long",
"asset": "ETH",
"price": 3500,
"size": "0.5",
"leverage": 40,
"collateral": "87.50",
"fee": "0.001",
"orderValue": 1750.25,
"stopLoss": 3200,
"takeProfit": 4000,
"oldLiquidationPrice": 1850.5,
"estimatedLiquidationPrice": 1920.3,
"oldStopLoss": 3000,
"oldTakeProfit": 4200,
"marginMode": "isolated",
"orderId": "12345",
"orderIds": [
"12345",
"67890"
],
"cancelledOrderTypes": [
"tp",
"sl"
],
"amount": "100",
"fromToken": {
"network": "ethereum",
"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
},
"method": "bridge2",
"agentAddress": "0x1234...",
"agentName": "Trading Bot 1",
"enabled": true,
"closedPrice": 1000,
"pnl": "100",
"margin": "450.00",
"entryPrice": 3500,
"exitPrice": 3500
},
"transactions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"network": "hyperliquid",
"chainId": "1337",
"type": "OPEN_POSITION",
"status": "CREATED",
"address": "0x123...",
"explorerUrls": [
"https://app.hyperliquid.xyz/explorer/tx/0x8a3fb2c1d4e5f67890abcdef12345678"
],
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 2000,
"stopLossPrice": 1800,
"takeProfitPrice": 2200,
"orderId": "12345",
"orderIds": [
"12345",
"67890"
],
"assetIndex": 0,
"fromToken": {
"network": "ethereum",
"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
},
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "My Trading Bot",
"validUntil": 1735689600,
"stopLossOrderId": "12345",
"takeProfitOrderId": "12346",
"skipApproval": true,
"fundingMethod": "bridge2",
"enabled": true
},
"signingFormat": "EIP712_TYPED_DATA",
"signablePayload": {
"domain": {
"name": "Hyperliquid",
"version": "1",
"chainId": 1337
},
"types": {},
"message": {}
},
"rawPayload": {
"type": "order",
"orders": [
{
"a": 4,
"b": true,
"p": "3500.0",
"s": "0.5",
"r": false,
"t": {
"limit": {
"tif": "Gtc"
}
}
}
],
"grouping": "na",
"nonce": 1706198400000
}
}
],
"createdAt": "2026-02-19T10:23:45.000Z",
"completedAt": "2026-02-19T10:23:48.000Z",
"signedMetadata": "01012b02010181d0010081d1040000000b24034152421547..."
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"validation": {
"message": [
"<string>"
]
}
}{
"statusCode": 401,
"timestamp": "2026-05-04T12:00:00.000Z",
"path": "/v1/actions",
"message": "Invalid API key",
"details": {
"message": "Invalid API key",
"code": "AUTH_INVALID_API_KEY"
}
}{
"message": "Access denied from US (US-CA)",
"error": "Forbidden",
"statusCode": 403
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"details": {
"code": "EXECUTE_NOT_FOUND",
"error": "<string>",
"message": "<string>",
"reason": "<string>",
"retryAfter": 123
},
"validation": {
"message": [
"<string>"
]
}
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"details": {
"code": "EXECUTE_PRECONDITION_FAILED",
"error": "<string>",
"message": "<string>",
"reason": "<string>",
"retryAfter": 123
},
"validation": {
"message": [
"<string>"
]
}
}{
"statusCode": 429,
"timestamp": "2026-05-04T12:00:00.000Z",
"path": "/v1/actions",
"message": "Rate limit exceeded",
"details": {
"message": "Rate limit exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"error": "Too Many Requests",
"retryAfter": 30
}
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"details": {
"code": "EXECUTE_INTERNAL",
"error": "<string>",
"message": "<string>",
"reason": "<string>",
"retryAfter": 123
},
"validation": {
"message": [
"<string>"
]
}
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"details": {
"code": "EXECUTE_SERVICE_UNAVAILABLE",
"error": "<string>",
"message": "<string>",
"reason": "<string>",
"retryAfter": 123
},
"validation": {
"message": [
"<string>"
]
}
}200 with an action whose transactions[] you sign and submit in the order returned, using Submit a transaction, then poll Get an action. Nothing executes until a signed payload is submitted. All 14 action types are accepted; each provider’s supportedActions and argument schemas come from GET /v1/providers.
Beyond the requested action, the response can contain transactions returned before it, such as APPROVE_BUILDER_FEE and SET_USER_ABSTRACTION. Sign every transaction returned, in order, even if you did not request it. Required arguments per action are in Action arguments.
{
"providerId": "hyperliquid",
"address": "0xYOUR_WALLET_ADDRESS",
"action": "open",
"args": {
"marketId": "YOUR_MARKET_ID",
"side": "long",
"amount": "100",
"leverage": 5,
"marginMode": "cross",
"limitPrice": 2000
}
}
details.code envelope described in Errors and retries. Codes specific to this route:
| Status | details.code | Cause |
|---|---|---|
| 400 | EXECUTE_INVALID_PROVIDER | Unknown or unsupported providerId |
| 400 | EXECUTE_INVALID_ARGUMENT | An argument failed validation, for example a notional below 10 USD |
| 400 | EXECUTE_MISSING_ARGUMENTS | A required argument for the action is missing |
| 403 | EXECUTE_FORBIDDEN | Caller region is blocked, or the project is explicitly disabled for the provider or for Perps |
| 404 | EXECUTE_NOT_FOUND | A referenced resource, such as the market, was not found |
| 412 | EXECUTE_PRECONDITION_FAILED | A precondition for the action is not met |
| 500 | EXECUTE_INTERNAL | Unexpected server error |
| 503 | EXECUTE_SERVICE_UNAVAILABLE | The provider is temporarily unavailable |
POST /v1/actions is the only Perps route behind the geolocation guard; it returns 403 for blocked regions. Read the perpetuals disclaimer before integrating.Body
Response
Action created with unsigned transactions ready for signing
TLV-encoded, secp256k1-signed metadata.
Hex string of concatenated TLV fields. Each field: Tag (1 byte) + Length (1 byte) + Value (N bytes). Tags > 0x7f use a 3-byte header: 0x81 prefix + Tag (1 byte) + Length (1 byte).
Fields in order: STRUCTURE_TYPE (0x01), VERSION (0x02), ACTION_TYPE (0x81 0xd0, u8: order=0x00 modify=0x01 cancel=0x02 updateLeverage=0x03 close=0x04 updateIsolatedMargin=0x05), ASSET_ID (0x81 0xd1, uint32 BE), ASSET_TICKER (0x24, UTF-8), NETWORK_TYPE (0x81 0xd2), BUILDER_ADDRESS (0x81 0xd3, 20 bytes, optional), MARGIN (0x81 0xd4, u64 big-endian, USD value with 6 decimal precision, e.g. 87500000 = $87.50, optional), LEVERAGE (0x81 0xd5, u32 big-endian, optional), SIGNATURE (0x15, DER-encoded secp256k1 over SHA-256 of preceding bytes).
"01012b02010181d0010081d1040000000b24034152421547..."
curl --request POST \
--url https://perps.yield.xyz/v1/actions \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"providerId": "hyperliquid",
"address": "0x1234...",
"action": "open",
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 2000,
"stopLossPrice": 1800,
"takeProfitPrice": 2200,
"orderId": "12345",
"orderIds": [
"12345",
"67890"
],
"assetIndex": 0,
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "My Trading Bot",
"validUntil": 1735689600,
"stopLossOrderId": "12345",
"takeProfitOrderId": "12346",
"skipApproval": true,
"fundingMethod": "bridge2",
"enabled": true
}
}
'import requests
url = "https://perps.yield.xyz/v1/actions"
payload = {
"providerId": "hyperliquid",
"address": "0x1234...",
"action": "open",
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 2000,
"stopLossPrice": 1800,
"takeProfitPrice": 2200,
"orderId": "12345",
"orderIds": ["12345", "67890"],
"assetIndex": 0,
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "My Trading Bot",
"validUntil": 1735689600,
"stopLossOrderId": "12345",
"takeProfitOrderId": "12346",
"skipApproval": True,
"fundingMethod": "bridge2",
"enabled": True
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
providerId: 'hyperliquid',
address: '0x1234...',
action: 'open',
args: {
marketId: 'hyperliquid-eth-usdc',
side: 'long',
amount: '100',
size: '1000',
leverage: 10,
marginMode: 'isolated',
limitPrice: 2000,
stopLossPrice: 1800,
takeProfitPrice: 2200,
orderId: '12345',
orderIds: ['12345', '67890'],
assetIndex: 0,
agentAddress: '0x1234567890abcdef1234567890abcdef12345678',
agentName: 'My Trading Bot',
validUntil: 1735689600,
stopLossOrderId: '12345',
takeProfitOrderId: '12346',
skipApproval: true,
fundingMethod: 'bridge2',
enabled: true
}
})
};
fetch('https://perps.yield.xyz/v1/actions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://perps.yield.xyz/v1/actions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'providerId' => 'hyperliquid',
'address' => '0x1234...',
'action' => 'open',
'args' => [
'marketId' => 'hyperliquid-eth-usdc',
'side' => 'long',
'amount' => '100',
'size' => '1000',
'leverage' => 10,
'marginMode' => 'isolated',
'limitPrice' => 2000,
'stopLossPrice' => 1800,
'takeProfitPrice' => 2200,
'orderId' => '12345',
'orderIds' => [
'12345',
'67890'
],
'assetIndex' => 0,
'agentAddress' => '0x1234567890abcdef1234567890abcdef12345678',
'agentName' => 'My Trading Bot',
'validUntil' => 1735689600,
'stopLossOrderId' => '12345',
'takeProfitOrderId' => '12346',
'skipApproval' => true,
'fundingMethod' => 'bridge2',
'enabled' => true
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://perps.yield.xyz/v1/actions"
payload := strings.NewReader("{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234...\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 2000,\n \"stopLossPrice\": 1800,\n \"takeProfitPrice\": 2200,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"12345\",\n \"67890\"\n ],\n \"assetIndex\": 0,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"My Trading Bot\",\n \"validUntil\": 1735689600,\n \"stopLossOrderId\": \"12345\",\n \"takeProfitOrderId\": \"12346\",\n \"skipApproval\": true,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://perps.yield.xyz/v1/actions")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234...\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 2000,\n \"stopLossPrice\": 1800,\n \"takeProfitPrice\": 2200,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"12345\",\n \"67890\"\n ],\n \"assetIndex\": 0,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"My Trading Bot\",\n \"validUntil\": 1735689600,\n \"stopLossOrderId\": \"12345\",\n \"takeProfitOrderId\": \"12346\",\n \"skipApproval\": true,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://perps.yield.xyz/v1/actions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"providerId\": \"hyperliquid\",\n \"address\": \"0x1234...\",\n \"action\": \"open\",\n \"args\": {\n \"marketId\": \"hyperliquid-eth-usdc\",\n \"side\": \"long\",\n \"amount\": \"100\",\n \"size\": \"1000\",\n \"leverage\": 10,\n \"marginMode\": \"isolated\",\n \"limitPrice\": 2000,\n \"stopLossPrice\": 1800,\n \"takeProfitPrice\": 2200,\n \"orderId\": \"12345\",\n \"orderIds\": [\n \"12345\",\n \"67890\"\n ],\n \"assetIndex\": 0,\n \"agentAddress\": \"0x1234567890abcdef1234567890abcdef12345678\",\n \"agentName\": \"My Trading Bot\",\n \"validUntil\": 1735689600,\n \"stopLossOrderId\": \"12345\",\n \"takeProfitOrderId\": \"12346\",\n \"skipApproval\": true,\n \"fundingMethod\": \"bridge2\",\n \"enabled\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "550e8400-e29b-41d4-a716-446655440000",
"providerId": "hyperliquid",
"action": "open",
"status": "CREATED",
"summary": {
"type": "Open Position",
"assetId": 11,
"orderType": "market",
"direction": "long",
"asset": "ETH",
"price": 3500,
"size": "0.5",
"leverage": 40,
"collateral": "87.50",
"fee": "0.001",
"orderValue": 1750.25,
"stopLoss": 3200,
"takeProfit": 4000,
"oldLiquidationPrice": 1850.5,
"estimatedLiquidationPrice": 1920.3,
"oldStopLoss": 3000,
"oldTakeProfit": 4200,
"marginMode": "isolated",
"orderId": "12345",
"orderIds": [
"12345",
"67890"
],
"cancelledOrderTypes": [
"tp",
"sl"
],
"amount": "100",
"fromToken": {
"network": "ethereum",
"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
},
"method": "bridge2",
"agentAddress": "0x1234...",
"agentName": "Trading Bot 1",
"enabled": true,
"closedPrice": 1000,
"pnl": "100",
"margin": "450.00",
"entryPrice": 3500,
"exitPrice": 3500
},
"transactions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"network": "hyperliquid",
"chainId": "1337",
"type": "OPEN_POSITION",
"status": "CREATED",
"address": "0x123...",
"explorerUrls": [
"https://app.hyperliquid.xyz/explorer/tx/0x8a3fb2c1d4e5f67890abcdef12345678"
],
"args": {
"marketId": "hyperliquid-eth-usdc",
"side": "long",
"amount": "100",
"size": "1000",
"leverage": 10,
"marginMode": "isolated",
"limitPrice": 2000,
"stopLossPrice": 1800,
"takeProfitPrice": 2200,
"orderId": "12345",
"orderIds": [
"12345",
"67890"
],
"assetIndex": 0,
"fromToken": {
"network": "ethereum",
"address": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
},
"agentAddress": "0x1234567890abcdef1234567890abcdef12345678",
"agentName": "My Trading Bot",
"validUntil": 1735689600,
"stopLossOrderId": "12345",
"takeProfitOrderId": "12346",
"skipApproval": true,
"fundingMethod": "bridge2",
"enabled": true
},
"signingFormat": "EIP712_TYPED_DATA",
"signablePayload": {
"domain": {
"name": "Hyperliquid",
"version": "1",
"chainId": 1337
},
"types": {},
"message": {}
},
"rawPayload": {
"type": "order",
"orders": [
{
"a": 4,
"b": true,
"p": "3500.0",
"s": "0.5",
"r": false,
"t": {
"limit": {
"tif": "Gtc"
}
}
}
],
"grouping": "na",
"nonce": 1706198400000
}
}
],
"createdAt": "2026-02-19T10:23:45.000Z",
"completedAt": "2026-02-19T10:23:48.000Z",
"signedMetadata": "01012b02010181d0010081d1040000000b24034152421547..."
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"validation": {
"message": [
"<string>"
]
}
}{
"statusCode": 401,
"timestamp": "2026-05-04T12:00:00.000Z",
"path": "/v1/actions",
"message": "Invalid API key",
"details": {
"message": "Invalid API key",
"code": "AUTH_INVALID_API_KEY"
}
}{
"message": "Access denied from US (US-CA)",
"error": "Forbidden",
"statusCode": 403
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"details": {
"code": "EXECUTE_NOT_FOUND",
"error": "<string>",
"message": "<string>",
"reason": "<string>",
"retryAfter": 123
},
"validation": {
"message": [
"<string>"
]
}
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"details": {
"code": "EXECUTE_PRECONDITION_FAILED",
"error": "<string>",
"message": "<string>",
"reason": "<string>",
"retryAfter": 123
},
"validation": {
"message": [
"<string>"
]
}
}{
"statusCode": 429,
"timestamp": "2026-05-04T12:00:00.000Z",
"path": "/v1/actions",
"message": "Rate limit exceeded",
"details": {
"message": "Rate limit exceeded",
"code": "RATE_LIMIT_EXCEEDED",
"error": "Too Many Requests",
"retryAfter": 30
}
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"details": {
"code": "EXECUTE_INTERNAL",
"error": "<string>",
"message": "<string>",
"reason": "<string>",
"retryAfter": 123
},
"validation": {
"message": [
"<string>"
]
}
}{
"statusCode": 123,
"timestamp": "2023-11-07T05:31:56Z",
"path": "<string>",
"message": "<string>",
"details": {
"code": "EXECUTE_SERVICE_UNAVAILABLE",
"error": "<string>",
"message": "<string>",
"reason": "<string>",
"retryAfter": 123
},
"validation": {
"message": [
"<string>"
]
}
}
