curl 'https://api.tenderly.co/api/public/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/environments/${ENVIRONMENT_ID}/instance/${INSTANCE_ID}/vnet/${VNET_ID}/transactions/simulate' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
-H 'content-type: application/json' \
--data-raw '{"callArgs":{"from":"0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2","to":"0x6b175474e89094c44da98b954eedeac495271d0f","gas":"0x7a1200","gasPrice":"0x0","value":"0x0","data":"0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b"},"blockNumber":"0x151924A"}' \
--compressedconst options = {
method: 'POST',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callArgs: {
from: '0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2',
to: '0x6b175474e89094c44da98b954eedeac495271d0f',
gas: '0x7a1200',
gasPrice: '0x0',
value: '0x0',
data: '0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b'
},
blockNumber: '0x151924A'
})
};
fetch('https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions/simulate"
payload = {
"callArgs": {
"from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"gas": "0x7a1200",
"gasPrice": "0x0",
"value": "0x0",
"data": "0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b"
},
"blockNumber": "0x151924A"
}
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions/simulate"
payload := strings.NewReader("{\n \"callArgs\": {\n \"from\": \"0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2\",\n \"to\": \"0x6b175474e89094c44da98b954eedeac495271d0f\",\n \"gas\": \"0x7a1200\",\n \"gasPrice\": \"0x0\",\n \"value\": \"0x0\",\n \"data\": \"0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b\"\n },\n \"blockNumber\": \"0x151924A\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-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))
}{
"blockNumber": "0xfc497b",
"cumulativeGasUsed": "0x10",
"gasUsed": "0xb412",
"status": true,
"type": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"metadata": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"logs": [
{
"name": "Transfer",
"anonymous": false,
"raw": {
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000fa78a211f7df670338daed1f96177c9fe154fcb1",
"0x0000000000000000000000006c8b8870c415f3b2d5fe0cd61e9c6960bad8e0c9"
]
},
"inputs": [
{
"name": "from",
"type": "address",
"value": "<unknown>",
"indexed": true
}
]
}
],
"trace": [
{
"from": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"balance": "0x0",
"gas": "0x6f18c5",
"gasUsed": "0x6da1",
"input": "0xa9059cbb000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f10000000000000000000000000000000000000000000000000de0b6b3a7640000",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"method": "transfer",
"error": "Revert",
"errorReason": "ERC20: transfer amount exceeds balance",
"refundAddress": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"subtraces": 1,
"type": "CALL",
"value": "0x0",
"traceAddress": [
0
],
"decodedInput": [
{
"name": "recipient",
"type": "address",
"value": "<unknown>",
"indexed": false
}
],
"decodedOutput": [
{
"name": "<string>",
"type": "bool",
"value": "<unknown>",
"indexed": false
}
]
}
],
"assetChanges": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "Transfer",
"from": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"to": "0x6c8b8870c415f3b2d5fe0cd61e9c6960bad8e0c9",
"amount": "1.0",
"rawAmount": "1000000000000000000",
"dollarValue": "2500.00",
"assetInfo": {
"contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"name": "Dai Stablecoin",
"symbol": "DAI",
"decimals": 18,
"logo": "https://assets.tenderly.co/tokens/dai.png",
"dollarValue": "1.00",
"standard": "ERC20",
"type": "Fungible"
}
}
],
"balanceChanges": [
{
"address": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"dollarValue": "-0.05"
}
],
"exposureChanges": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"type": "Approve",
"owner": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"spender": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
"amount": "unlimited",
"rawAmount": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
"dollarValue": "unlimited",
"assetInfo": {
"contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"name": "Dai Stablecoin",
"symbol": "DAI",
"decimals": 18,
"logo": "https://assets.tenderly.co/tokens/dai.png",
"dollarValue": "1.00",
"standard": "ERC20",
"type": "Fungible"
}
}
],
"stateChanges": [
{
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"balance": {
"previousValue": "0x16345785d8a0000",
"newValue": "0x1bc16d674ec80000"
},
"nonce": {
"previousValue": "0x5",
"newValue": "0x6"
},
"storage": [
{
"slot": "0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3",
"previousValue": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"newValue": "0x0000000000000000000000000000000000000000000000001bc16d674ec80000"
}
]
}
],
"interopInfo": {
"chainId": "10",
"relayError": "relay failed: insufficient gas",
"transactionAddress": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "bad_request",
"message": "Bad request input parameters"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "insufficient_permissions",
"message": "Insufficient permissions"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "resource_not_found",
"message": "The resource you requested could not be found."
}
}{
"error": {
"id": "9a7bbe06-7f6f-4a45-8c78-8d64b9a9d0e1",
"slug": "too_many_requests",
"message": "API Rate limit exceeded."
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "internal_server_error",
"message": "Internal server error"
}
}Simulate Transaction on Environment Virtual Environment
Simulate a transaction on one Virtual Environment without persisting state, with block and state overrides, and get asset, balance, and state changes.
curl 'https://api.tenderly.co/api/public/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/environments/${ENVIRONMENT_ID}/instance/${INSTANCE_ID}/vnet/${VNET_ID}/transactions/simulate' \
-H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
-H 'content-type: application/json' \
--data-raw '{"callArgs":{"from":"0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2","to":"0x6b175474e89094c44da98b954eedeac495271d0f","gas":"0x7a1200","gasPrice":"0x0","value":"0x0","data":"0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b"},"blockNumber":"0x151924A"}' \
--compressedconst options = {
method: 'POST',
headers: {'X-Access-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
callArgs: {
from: '0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2',
to: '0x6b175474e89094c44da98b954eedeac495271d0f',
gas: '0x7a1200',
gasPrice: '0x0',
value: '0x0',
data: '0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b'
},
blockNumber: '0x151924A'
})
};
fetch('https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions/simulate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions/simulate"
payload = {
"callArgs": {
"from": "0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"gas": "0x7a1200",
"gasPrice": "0x0",
"value": "0x0",
"data": "0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b"
},
"blockNumber": "0x151924A"
}
headers = {
"X-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}/environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions/simulate"
payload := strings.NewReader("{\n \"callArgs\": {\n \"from\": \"0xe2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2\",\n \"to\": \"0x6b175474e89094c44da98b954eedeac495271d0f\",\n \"gas\": \"0x7a1200\",\n \"gasPrice\": \"0x0\",\n \"value\": \"0x0\",\n \"data\": \"0x095ea7b3000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1000000000000000000000000000000000000000000000000000000000000012b\"\n },\n \"blockNumber\": \"0x151924A\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Access-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))
}{
"blockNumber": "0xfc497b",
"cumulativeGasUsed": "0x10",
"gasUsed": "0xb412",
"status": true,
"type": "0x0",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"metadata": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
},
"logs": [
{
"name": "Transfer",
"anonymous": false,
"raw": {
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"data": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000fa78a211f7df670338daed1f96177c9fe154fcb1",
"0x0000000000000000000000006c8b8870c415f3b2d5fe0cd61e9c6960bad8e0c9"
]
},
"inputs": [
{
"name": "from",
"type": "address",
"value": "<unknown>",
"indexed": true
}
]
}
],
"trace": [
{
"from": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"to": "0x6b175474e89094c44da98b954eedeac495271d0f",
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"balance": "0x0",
"gas": "0x6f18c5",
"gasUsed": "0x6da1",
"input": "0xa9059cbb000000000000000000000000f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f10000000000000000000000000000000000000000000000000de0b6b3a7640000",
"output": "0x0000000000000000000000000000000000000000000000000000000000000001",
"method": "transfer",
"error": "Revert",
"errorReason": "ERC20: transfer amount exceeds balance",
"refundAddress": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"subtraces": 1,
"type": "CALL",
"value": "0x0",
"traceAddress": [
0
],
"decodedInput": [
{
"name": "recipient",
"type": "address",
"value": "<unknown>",
"indexed": false
}
],
"decodedOutput": [
{
"name": "<string>",
"type": "bool",
"value": "<unknown>",
"indexed": false
}
]
}
],
"assetChanges": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "Transfer",
"from": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"to": "0x6c8b8870c415f3b2d5fe0cd61e9c6960bad8e0c9",
"amount": "1.0",
"rawAmount": "1000000000000000000",
"dollarValue": "2500.00",
"assetInfo": {
"contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"name": "Dai Stablecoin",
"symbol": "DAI",
"decimals": 18,
"logo": "https://assets.tenderly.co/tokens/dai.png",
"dollarValue": "1.00",
"standard": "ERC20",
"type": "Fungible"
}
}
],
"balanceChanges": [
{
"address": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"dollarValue": "-0.05"
}
],
"exposureChanges": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"type": "Approve",
"owner": "0xfa78a211f7df670338daed1f96177c9fe154fcb1",
"spender": "0x7a250d5630b4cf539739df2c5dacb4c659f2488d",
"amount": "unlimited",
"rawAmount": "115792089237316195423570985008687907853269984665640564039457584007913129639935",
"dollarValue": "unlimited",
"assetInfo": {
"contractAddress": "0x6b175474e89094c44da98b954eedeac495271d0f",
"name": "Dai Stablecoin",
"symbol": "DAI",
"decimals": 18,
"logo": "https://assets.tenderly.co/tokens/dai.png",
"dollarValue": "1.00",
"standard": "ERC20",
"type": "Fungible"
}
}
],
"stateChanges": [
{
"address": "0x6b175474e89094c44da98b954eedeac495271d0f",
"balance": {
"previousValue": "0x16345785d8a0000",
"newValue": "0x1bc16d674ec80000"
},
"nonce": {
"previousValue": "0x5",
"newValue": "0x6"
},
"storage": [
{
"slot": "0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3",
"previousValue": "0x0000000000000000000000000000000000000000000000000de0b6b3a7640000",
"newValue": "0x0000000000000000000000000000000000000000000000001bc16d674ec80000"
}
]
}
],
"interopInfo": {
"chainId": "10",
"relayError": "relay failed: insufficient gas",
"transactionAddress": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "bad_request",
"message": "Bad request input parameters"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "unauthorized",
"message": "Unauthorized"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "insufficient_permissions",
"message": "Insufficient permissions"
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "resource_not_found",
"message": "The resource you requested could not be found."
}
}{
"error": {
"id": "9a7bbe06-7f6f-4a45-8c78-8d64b9a9d0e1",
"slug": "too_many_requests",
"message": "API Rate limit exceeded."
}
}{
"error": {
"id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
"slug": "internal_server_error",
"message": "Internal server error"
}
}Authorizations
An API key is a token that a client provides when making API calls. Send it as the X-Access-Key request header on any endpoint:
curl '<API_ENDPOINT>' \ -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \ ...
Learn how to generate API access tokens at Tenderly Docs.
Path Parameters
Body
Simulation parameters
Response
A successful response.
Result of simulating a transaction on an environment Virtual Environment
Bloom filter of all logs emitted during simulation (hex-encoded)
"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"