curl --request POST \
--url https://api.yield.xyz/v1/actions/enter \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"arguments": {
"amount": "1000000000000000000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": [
"cosmosvaloper1...",
"cosmosvaloper2..."
],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": true
}
}
'import requests
url = "https://api.yield.xyz/v1/actions/enter"
payload = {
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"arguments": {
"amount": "1000000000000000000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": ["cosmosvaloper1...", "cosmosvaloper2..."],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": 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({
yieldId: 'ethereum-eth-lido-staking',
address: '0x1234...',
arguments: {
amount: '1000000000000000000',
validatorAddress: 'cosmosvaloper1...',
validatorAddresses: ['cosmosvaloper1...', 'cosmosvaloper2...'],
providerId: 'kiln',
duration: 1209600,
inputToken: '0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E',
subnetId: 1,
feeConfigurationId: 'custom-fee-config-1',
cosmosPubKey: 'cosmospub1...',
tezosPubKey: 'edpk...',
cAddressBech: '0x123...',
pAddressBech: 'P-avax1...',
executionMode: 'individual',
ledgerWalletApiCompatible: true
}
})
};
fetch('https://api.yield.xyz/v1/actions/enter', 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://api.yield.xyz/v1/actions/enter",
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([
'yieldId' => 'ethereum-eth-lido-staking',
'address' => '0x1234...',
'arguments' => [
'amount' => '1000000000000000000',
'validatorAddress' => 'cosmosvaloper1...',
'validatorAddresses' => [
'cosmosvaloper1...',
'cosmosvaloper2...'
],
'providerId' => 'kiln',
'duration' => 1209600,
'inputToken' => '0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E',
'subnetId' => 1,
'feeConfigurationId' => 'custom-fee-config-1',
'cosmosPubKey' => 'cosmospub1...',
'tezosPubKey' => 'edpk...',
'cAddressBech' => '0x123...',
'pAddressBech' => 'P-avax1...',
'executionMode' => 'individual',
'ledgerWalletApiCompatible' => 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://api.yield.xyz/v1/actions/enter"
payload := strings.NewReader("{\n \"yieldId\": \"ethereum-eth-lido-staking\",\n \"address\": \"0x1234...\",\n \"arguments\": {\n \"amount\": \"1000000000000000000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E\",\n \"subnetId\": 1,\n \"feeConfigurationId\": \"custom-fee-config-1\",\n \"cosmosPubKey\": \"cosmospub1...\",\n \"tezosPubKey\": \"edpk...\",\n \"cAddressBech\": \"0x123...\",\n \"pAddressBech\": \"P-avax1...\",\n \"executionMode\": \"individual\",\n \"ledgerWalletApiCompatible\": 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://api.yield.xyz/v1/actions/enter")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"yieldId\": \"ethereum-eth-lido-staking\",\n \"address\": \"0x1234...\",\n \"arguments\": {\n \"amount\": \"1000000000000000000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E\",\n \"subnetId\": 1,\n \"feeConfigurationId\": \"custom-fee-config-1\",\n \"cosmosPubKey\": \"cosmospub1...\",\n \"tezosPubKey\": \"edpk...\",\n \"cAddressBech\": \"0x123...\",\n \"pAddressBech\": \"P-avax1...\",\n \"executionMode\": \"individual\",\n \"ledgerWalletApiCompatible\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yield.xyz/v1/actions/enter")
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 \"yieldId\": \"ethereum-eth-lido-staking\",\n \"address\": \"0x1234...\",\n \"arguments\": {\n \"amount\": \"1000000000000000000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E\",\n \"subnetId\": 1,\n \"feeConfigurationId\": \"custom-fee-config-1\",\n \"cosmosPubKey\": \"cosmospub1...\",\n \"tezosPubKey\": \"edpk...\",\n \"cAddressBech\": \"0x123...\",\n \"pAddressBech\": \"P-avax1...\",\n \"executionMode\": \"individual\",\n \"ledgerWalletApiCompatible\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "action_123abc",
"intent": "manage",
"type": "CLAIM_REWARDS",
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"amount": "1000000000000000000",
"amountRaw": "1000000000000000000",
"amountUsd": "1500.50",
"transactions": [
{
"id": "tx_123abc",
"title": "Approve USDC",
"network": "ethereum",
"status": "PENDING",
"type": "STAKE",
"hash": "0x1234567890abcdef...",
"createdAt": "2023-11-07T05:31:56Z",
"broadcastedAt": "2023-11-07T05:31:56Z",
"signedTransaction": "<string>",
"unsignedTransaction": "0x02f87082012a022f2f83018000947a250d5630b4cf539739df2c5dacb4c659f2488d880de0b6b3a764000080c080a0ef0de6c7b46fc75dd6cb86dccc3cfd731c2bdf6f3d736557240c3646c6fe01a6a07cd60b58dfe01847249dfdd7950ba0d045dded5bbe410b07a015a0ed34e5e00d",
"annotatedTransaction": {
"method": "stake",
"inputs": {
"amount": "1000000000000000000"
}
},
"structuredTransaction": {},
"stepIndex": 0,
"description": "Approve USDC for staking",
"error": "<string>",
"gasEstimate": "21000",
"explorerUrl": "https://etherscan.io/tx/0x1234...",
"isMessage": false
}
],
"executionPattern": "synchronous",
"rawArguments": {
"amount": "1000000000000000000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": [
"cosmosvaloper1...",
"cosmosvaloper2..."
],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": true
},
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}{
"message": "Validation failed",
"error": "Bad Request",
"statusCode": 400
}{
"message": "Invalid API key",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Access denied from US (US-CA)",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Rate limit exceeded",
"error": "Too Many Requests",
"statusCode": 429,
"retryAfter": 30
}{
"message": "Internal server error",
"error": "Internal Server Error",
"statusCode": 500
}Enter a yield
Generate the transactions needed to enter a yield position with the provided parameters.
curl --request POST \
--url https://api.yield.xyz/v1/actions/enter \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"arguments": {
"amount": "1000000000000000000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": [
"cosmosvaloper1...",
"cosmosvaloper2..."
],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": true
}
}
'import requests
url = "https://api.yield.xyz/v1/actions/enter"
payload = {
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"arguments": {
"amount": "1000000000000000000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": ["cosmosvaloper1...", "cosmosvaloper2..."],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": 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({
yieldId: 'ethereum-eth-lido-staking',
address: '0x1234...',
arguments: {
amount: '1000000000000000000',
validatorAddress: 'cosmosvaloper1...',
validatorAddresses: ['cosmosvaloper1...', 'cosmosvaloper2...'],
providerId: 'kiln',
duration: 1209600,
inputToken: '0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E',
subnetId: 1,
feeConfigurationId: 'custom-fee-config-1',
cosmosPubKey: 'cosmospub1...',
tezosPubKey: 'edpk...',
cAddressBech: '0x123...',
pAddressBech: 'P-avax1...',
executionMode: 'individual',
ledgerWalletApiCompatible: true
}
})
};
fetch('https://api.yield.xyz/v1/actions/enter', 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://api.yield.xyz/v1/actions/enter",
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([
'yieldId' => 'ethereum-eth-lido-staking',
'address' => '0x1234...',
'arguments' => [
'amount' => '1000000000000000000',
'validatorAddress' => 'cosmosvaloper1...',
'validatorAddresses' => [
'cosmosvaloper1...',
'cosmosvaloper2...'
],
'providerId' => 'kiln',
'duration' => 1209600,
'inputToken' => '0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E',
'subnetId' => 1,
'feeConfigurationId' => 'custom-fee-config-1',
'cosmosPubKey' => 'cosmospub1...',
'tezosPubKey' => 'edpk...',
'cAddressBech' => '0x123...',
'pAddressBech' => 'P-avax1...',
'executionMode' => 'individual',
'ledgerWalletApiCompatible' => 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://api.yield.xyz/v1/actions/enter"
payload := strings.NewReader("{\n \"yieldId\": \"ethereum-eth-lido-staking\",\n \"address\": \"0x1234...\",\n \"arguments\": {\n \"amount\": \"1000000000000000000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E\",\n \"subnetId\": 1,\n \"feeConfigurationId\": \"custom-fee-config-1\",\n \"cosmosPubKey\": \"cosmospub1...\",\n \"tezosPubKey\": \"edpk...\",\n \"cAddressBech\": \"0x123...\",\n \"pAddressBech\": \"P-avax1...\",\n \"executionMode\": \"individual\",\n \"ledgerWalletApiCompatible\": 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://api.yield.xyz/v1/actions/enter")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"yieldId\": \"ethereum-eth-lido-staking\",\n \"address\": \"0x1234...\",\n \"arguments\": {\n \"amount\": \"1000000000000000000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E\",\n \"subnetId\": 1,\n \"feeConfigurationId\": \"custom-fee-config-1\",\n \"cosmosPubKey\": \"cosmospub1...\",\n \"tezosPubKey\": \"edpk...\",\n \"cAddressBech\": \"0x123...\",\n \"pAddressBech\": \"P-avax1...\",\n \"executionMode\": \"individual\",\n \"ledgerWalletApiCompatible\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yield.xyz/v1/actions/enter")
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 \"yieldId\": \"ethereum-eth-lido-staking\",\n \"address\": \"0x1234...\",\n \"arguments\": {\n \"amount\": \"1000000000000000000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E\",\n \"subnetId\": 1,\n \"feeConfigurationId\": \"custom-fee-config-1\",\n \"cosmosPubKey\": \"cosmospub1...\",\n \"tezosPubKey\": \"edpk...\",\n \"cAddressBech\": \"0x123...\",\n \"pAddressBech\": \"P-avax1...\",\n \"executionMode\": \"individual\",\n \"ledgerWalletApiCompatible\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "action_123abc",
"intent": "manage",
"type": "CLAIM_REWARDS",
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"amount": "1000000000000000000",
"amountRaw": "1000000000000000000",
"amountUsd": "1500.50",
"transactions": [
{
"id": "tx_123abc",
"title": "Approve USDC",
"network": "ethereum",
"status": "PENDING",
"type": "STAKE",
"hash": "0x1234567890abcdef...",
"createdAt": "2023-11-07T05:31:56Z",
"broadcastedAt": "2023-11-07T05:31:56Z",
"signedTransaction": "<string>",
"unsignedTransaction": "0x02f87082012a022f2f83018000947a250d5630b4cf539739df2c5dacb4c659f2488d880de0b6b3a764000080c080a0ef0de6c7b46fc75dd6cb86dccc3cfd731c2bdf6f3d736557240c3646c6fe01a6a07cd60b58dfe01847249dfdd7950ba0d045dded5bbe410b07a015a0ed34e5e00d",
"annotatedTransaction": {
"method": "stake",
"inputs": {
"amount": "1000000000000000000"
}
},
"structuredTransaction": {},
"stepIndex": 0,
"description": "Approve USDC for staking",
"error": "<string>",
"gasEstimate": "21000",
"explorerUrl": "https://etherscan.io/tx/0x1234...",
"isMessage": false
}
],
"executionPattern": "synchronous",
"rawArguments": {
"amount": "1000000000000000000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": [
"cosmosvaloper1...",
"cosmosvaloper2..."
],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86a33E6776C8DB91C5C7AcE16ccE5C5eE0d7E",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": true
},
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}{
"message": "Validation failed",
"error": "Bad Request",
"statusCode": 400
}{
"message": "Invalid API key",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Access denied from US (US-CA)",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Rate limit exceeded",
"error": "Too Many Requests",
"statusCode": 429,
"retryAfter": 30
}{
"message": "Internal server error",
"error": "Internal Server Error",
"statusCode": 500
}Authorizations
Body
Response
Returns action with array of transactions to execute
Unique action identifier
"action_123abc"
High-level action intent
enter, manage, exit "manage"
Specific action type
STAKE, UNSTAKE, CLAIM_REWARDS, RESTAKE_REWARDS, WITHDRAW, WITHDRAW_ALL, RESTAKE, CLAIM_UNSTAKED, UNLOCK_LOCKED, STAKE_LOCKED, VOTE, REVOKE, VOTE_LOCKED, REVOTE, REBOND, MIGRATE, VERIFY_WITHDRAW_CREDENTIALS, DELEGATE "CLAIM_REWARDS"
Yield ID this action belongs to
"ethereum-eth-lido-staking"
User wallet address
"0x1234..."
Amount involved in the action
"1000000000000000000"
Raw wei amount (full precision)
"1000000000000000000"
USD value of the amount
"1500.50"
Array of transactions for this action
Show child attributes
Show child attributes
Transaction execution pattern - synchronous (submit one by one, wait for each), asynchronous (submit all at once), or batch (single transaction with multiple operations)
synchronous, asynchronous, batch "synchronous"
Raw arguments exactly as submitted by the user for this action
Show child attributes
Show child attributes
When the action was created
When the action was completed
Current status of the action
CANCELED, CREATED, WAITING_FOR_NEXT, PROCESSING, FAILED, SUCCESS, STALE 
