Simulate entering a yield
curl --request POST \
--url https://api.yield.xyz/v1/actions/enter/simulate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"arguments": {
"amount": "1.500000",
"amountRaw": "1000000000000000000",
"amounts": [
"1.500000",
"2.000000"
],
"shareAmount": "1.500000",
"shareAmountRaw": "1500000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": [
"cosmosvaloper1...",
"cosmosvaloper2..."
],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"outputToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": true,
"useMaxAmount": true,
"useInstantExecution": true,
"useAutoClaim": true,
"skipPrechecks": false,
"useMaxAllowance": true,
"feePayerAddress": "7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo",
"receiverAddress": "<string>",
"rangeMin": "0.0",
"rangeMax": "1.0",
"percentage": 50,
"tokenId": "12345"
}
}
'import requests
url = "https://api.yield.xyz/v1/actions/enter/simulate"
payload = {
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"arguments": {
"amount": "1.500000",
"amountRaw": "1000000000000000000",
"amounts": ["1.500000", "2.000000"],
"shareAmount": "1.500000",
"shareAmountRaw": "1500000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": ["cosmosvaloper1...", "cosmosvaloper2..."],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"outputToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": True,
"useMaxAmount": True,
"useInstantExecution": True,
"useAutoClaim": True,
"skipPrechecks": False,
"useMaxAllowance": True,
"feePayerAddress": "7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo",
"receiverAddress": "<string>",
"rangeMin": "0.0",
"rangeMax": "1.0",
"percentage": 50,
"tokenId": "12345"
}
}
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: '1.500000',
amountRaw: '1000000000000000000',
amounts: ['1.500000', '2.000000'],
shareAmount: '1.500000',
shareAmountRaw: '1500000',
validatorAddress: 'cosmosvaloper1...',
validatorAddresses: ['cosmosvaloper1...', 'cosmosvaloper2...'],
providerId: 'kiln',
duration: 1209600,
inputToken: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
outputToken: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
subnetId: 1,
feeConfigurationId: 'custom-fee-config-1',
cosmosPubKey: 'cosmospub1...',
tezosPubKey: 'edpk...',
cAddressBech: '0x123...',
pAddressBech: 'P-avax1...',
executionMode: 'individual',
ledgerWalletApiCompatible: true,
useMaxAmount: true,
useInstantExecution: true,
useAutoClaim: true,
skipPrechecks: false,
useMaxAllowance: true,
feePayerAddress: '7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo',
receiverAddress: '<string>',
rangeMin: '0.0',
rangeMax: '1.0',
percentage: 50,
tokenId: '12345'
}
})
};
fetch('https://api.yield.xyz/v1/actions/enter/simulate', 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/simulate",
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' => '1.500000',
'amountRaw' => '1000000000000000000',
'amounts' => [
'1.500000',
'2.000000'
],
'shareAmount' => '1.500000',
'shareAmountRaw' => '1500000',
'validatorAddress' => 'cosmosvaloper1...',
'validatorAddresses' => [
'cosmosvaloper1...',
'cosmosvaloper2...'
],
'providerId' => 'kiln',
'duration' => 1209600,
'inputToken' => '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'outputToken' => '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'subnetId' => 1,
'feeConfigurationId' => 'custom-fee-config-1',
'cosmosPubKey' => 'cosmospub1...',
'tezosPubKey' => 'edpk...',
'cAddressBech' => '0x123...',
'pAddressBech' => 'P-avax1...',
'executionMode' => 'individual',
'ledgerWalletApiCompatible' => true,
'useMaxAmount' => true,
'useInstantExecution' => true,
'useAutoClaim' => true,
'skipPrechecks' => false,
'useMaxAllowance' => true,
'feePayerAddress' => '7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo',
'receiverAddress' => '<string>',
'rangeMin' => '0.0',
'rangeMax' => '1.0',
'percentage' => 50,
'tokenId' => '12345'
]
]),
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/simulate"
payload := strings.NewReader("{\n \"yieldId\": \"ethereum-eth-lido-staking\",\n \"address\": \"0x1234...\",\n \"arguments\": {\n \"amount\": \"1.500000\",\n \"amountRaw\": \"1000000000000000000\",\n \"amounts\": [\n \"1.500000\",\n \"2.000000\"\n ],\n \"shareAmount\": \"1.500000\",\n \"shareAmountRaw\": \"1500000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"outputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\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 \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"useAutoClaim\": true,\n \"skipPrechecks\": false,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"0.0\",\n \"rangeMax\": \"1.0\",\n \"percentage\": 50,\n \"tokenId\": \"12345\"\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/simulate")
.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\": \"1.500000\",\n \"amountRaw\": \"1000000000000000000\",\n \"amounts\": [\n \"1.500000\",\n \"2.000000\"\n ],\n \"shareAmount\": \"1.500000\",\n \"shareAmountRaw\": \"1500000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"outputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\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 \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"useAutoClaim\": true,\n \"skipPrechecks\": false,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"0.0\",\n \"rangeMax\": \"1.0\",\n \"percentage\": 50,\n \"tokenId\": \"12345\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yield.xyz/v1/actions/enter/simulate")
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\": \"1.500000\",\n \"amountRaw\": \"1000000000000000000\",\n \"amounts\": [\n \"1.500000\",\n \"2.000000\"\n ],\n \"shareAmount\": \"1.500000\",\n \"shareAmountRaw\": \"1500000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"outputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\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 \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"useAutoClaim\": true,\n \"skipPrechecks\": false,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"0.0\",\n \"rangeMax\": \"1.0\",\n \"percentage\": 50,\n \"tokenId\": \"12345\"\n }\n}"
response = http.request(request)
puts response.read_body{
"gas": {
"amount": "<string>",
"token": {
"symbol": "ETH",
"name": "Ethereum",
"decimals": 18,
"network": "Ethereum",
"address": "0x...",
"logoURI": "https://...",
"isPoints": true,
"coinGeckoId": "ethereum"
},
"transactions": [
{
"amount": "<string>",
"token": {
"symbol": "ETH",
"name": "Ethereum",
"decimals": 18,
"network": "Ethereum",
"address": "0x...",
"logoURI": "https://...",
"isPoints": true,
"coinGeckoId": "ethereum"
},
"stepIndex": 123,
"type": "SWAP",
"gasLimit": "<string>"
}
],
"gasLimit": "<string>"
},
"entryReserveEstimate": "<string>"
}{
"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
}Actions
Simulate an enter
Estimate gas for an enter action without creating an action or transactions.
POST
/
v1
/
actions
/
enter
/
simulate
Simulate entering a yield
curl --request POST \
--url https://api.yield.xyz/v1/actions/enter/simulate \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"arguments": {
"amount": "1.500000",
"amountRaw": "1000000000000000000",
"amounts": [
"1.500000",
"2.000000"
],
"shareAmount": "1.500000",
"shareAmountRaw": "1500000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": [
"cosmosvaloper1...",
"cosmosvaloper2..."
],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"outputToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": true,
"useMaxAmount": true,
"useInstantExecution": true,
"useAutoClaim": true,
"skipPrechecks": false,
"useMaxAllowance": true,
"feePayerAddress": "7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo",
"receiverAddress": "<string>",
"rangeMin": "0.0",
"rangeMax": "1.0",
"percentage": 50,
"tokenId": "12345"
}
}
'import requests
url = "https://api.yield.xyz/v1/actions/enter/simulate"
payload = {
"yieldId": "ethereum-eth-lido-staking",
"address": "0x1234...",
"arguments": {
"amount": "1.500000",
"amountRaw": "1000000000000000000",
"amounts": ["1.500000", "2.000000"],
"shareAmount": "1.500000",
"shareAmountRaw": "1500000",
"validatorAddress": "cosmosvaloper1...",
"validatorAddresses": ["cosmosvaloper1...", "cosmosvaloper2..."],
"providerId": "kiln",
"duration": 1209600,
"inputToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"outputToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"subnetId": 1,
"feeConfigurationId": "custom-fee-config-1",
"cosmosPubKey": "cosmospub1...",
"tezosPubKey": "edpk...",
"cAddressBech": "0x123...",
"pAddressBech": "P-avax1...",
"executionMode": "individual",
"ledgerWalletApiCompatible": True,
"useMaxAmount": True,
"useInstantExecution": True,
"useAutoClaim": True,
"skipPrechecks": False,
"useMaxAllowance": True,
"feePayerAddress": "7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo",
"receiverAddress": "<string>",
"rangeMin": "0.0",
"rangeMax": "1.0",
"percentage": 50,
"tokenId": "12345"
}
}
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: '1.500000',
amountRaw: '1000000000000000000',
amounts: ['1.500000', '2.000000'],
shareAmount: '1.500000',
shareAmountRaw: '1500000',
validatorAddress: 'cosmosvaloper1...',
validatorAddresses: ['cosmosvaloper1...', 'cosmosvaloper2...'],
providerId: 'kiln',
duration: 1209600,
inputToken: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
outputToken: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
subnetId: 1,
feeConfigurationId: 'custom-fee-config-1',
cosmosPubKey: 'cosmospub1...',
tezosPubKey: 'edpk...',
cAddressBech: '0x123...',
pAddressBech: 'P-avax1...',
executionMode: 'individual',
ledgerWalletApiCompatible: true,
useMaxAmount: true,
useInstantExecution: true,
useAutoClaim: true,
skipPrechecks: false,
useMaxAllowance: true,
feePayerAddress: '7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo',
receiverAddress: '<string>',
rangeMin: '0.0',
rangeMax: '1.0',
percentage: 50,
tokenId: '12345'
}
})
};
fetch('https://api.yield.xyz/v1/actions/enter/simulate', 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/simulate",
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' => '1.500000',
'amountRaw' => '1000000000000000000',
'amounts' => [
'1.500000',
'2.000000'
],
'shareAmount' => '1.500000',
'shareAmountRaw' => '1500000',
'validatorAddress' => 'cosmosvaloper1...',
'validatorAddresses' => [
'cosmosvaloper1...',
'cosmosvaloper2...'
],
'providerId' => 'kiln',
'duration' => 1209600,
'inputToken' => '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'outputToken' => '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
'subnetId' => 1,
'feeConfigurationId' => 'custom-fee-config-1',
'cosmosPubKey' => 'cosmospub1...',
'tezosPubKey' => 'edpk...',
'cAddressBech' => '0x123...',
'pAddressBech' => 'P-avax1...',
'executionMode' => 'individual',
'ledgerWalletApiCompatible' => true,
'useMaxAmount' => true,
'useInstantExecution' => true,
'useAutoClaim' => true,
'skipPrechecks' => false,
'useMaxAllowance' => true,
'feePayerAddress' => '7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo',
'receiverAddress' => '<string>',
'rangeMin' => '0.0',
'rangeMax' => '1.0',
'percentage' => 50,
'tokenId' => '12345'
]
]),
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/simulate"
payload := strings.NewReader("{\n \"yieldId\": \"ethereum-eth-lido-staking\",\n \"address\": \"0x1234...\",\n \"arguments\": {\n \"amount\": \"1.500000\",\n \"amountRaw\": \"1000000000000000000\",\n \"amounts\": [\n \"1.500000\",\n \"2.000000\"\n ],\n \"shareAmount\": \"1.500000\",\n \"shareAmountRaw\": \"1500000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"outputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\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 \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"useAutoClaim\": true,\n \"skipPrechecks\": false,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"0.0\",\n \"rangeMax\": \"1.0\",\n \"percentage\": 50,\n \"tokenId\": \"12345\"\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/simulate")
.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\": \"1.500000\",\n \"amountRaw\": \"1000000000000000000\",\n \"amounts\": [\n \"1.500000\",\n \"2.000000\"\n ],\n \"shareAmount\": \"1.500000\",\n \"shareAmountRaw\": \"1500000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"outputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\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 \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"useAutoClaim\": true,\n \"skipPrechecks\": false,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"0.0\",\n \"rangeMax\": \"1.0\",\n \"percentage\": 50,\n \"tokenId\": \"12345\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.yield.xyz/v1/actions/enter/simulate")
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\": \"1.500000\",\n \"amountRaw\": \"1000000000000000000\",\n \"amounts\": [\n \"1.500000\",\n \"2.000000\"\n ],\n \"shareAmount\": \"1.500000\",\n \"shareAmountRaw\": \"1500000\",\n \"validatorAddress\": \"cosmosvaloper1...\",\n \"validatorAddresses\": [\n \"cosmosvaloper1...\",\n \"cosmosvaloper2...\"\n ],\n \"providerId\": \"kiln\",\n \"duration\": 1209600,\n \"inputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"outputToken\": \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\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 \"useMaxAmount\": true,\n \"useInstantExecution\": true,\n \"useAutoClaim\": true,\n \"skipPrechecks\": false,\n \"useMaxAllowance\": true,\n \"feePayerAddress\": \"7Qo3awoTH4y5Vui1FQwsncq2arYDzUuivdeWhwgnAvVo\",\n \"receiverAddress\": \"<string>\",\n \"rangeMin\": \"0.0\",\n \"rangeMax\": \"1.0\",\n \"percentage\": 50,\n \"tokenId\": \"12345\"\n }\n}"
response = http.request(request)
puts response.read_body{
"gas": {
"amount": "<string>",
"token": {
"symbol": "ETH",
"name": "Ethereum",
"decimals": 18,
"network": "Ethereum",
"address": "0x...",
"logoURI": "https://...",
"isPoints": true,
"coinGeckoId": "ethereum"
},
"transactions": [
{
"amount": "<string>",
"token": {
"symbol": "ETH",
"name": "Ethereum",
"decimals": 18,
"network": "Ethereum",
"address": "0x...",
"logoURI": "https://...",
"isPoints": true,
"coinGeckoId": "ethereum"
},
"stepIndex": 123,
"type": "SWAP",
"gasLimit": "<string>"
}
],
"gasLimit": "<string>"
},
"entryReserveEstimate": "<string>"
}{
"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
}Same body as Enter a yield. Returns
200 with an ActionSimulationDto: gas (aggregate amount, token, gasLimit, and a per-transaction transactions[] breakdown) and, for Solana enters, entryReserveEstimate. Nothing is created or persisted, so there are no transactions to sign and no action id.
A 200 does not guarantee the real action succeeds on-chain, because construction-level prechecks can be skipped. Errors: 400, 403 (geo-blocked), 400 (unknown or not enabled yield) and 412 when the yield is closed for new deposits. See Errors and retries.Authorizations
Body
application/json
Response
Simulation result for the enter action
Estimated gas cost of the action, aggregated and per transaction.
Show child attributes
Show child attributes
Total SOL side-reserve required for enter validation: account rent plus ~0.005 SOL priority-fee buffer. For max native-SOL deposit use balance minus this value; do not also subtract the gas amount. Only returned on enter simulations; omitted for exits and when unavailable.
⌘I

