debug_traceCall
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",
"value": "0xde0b6b3a7640000",
"data": "0x"
},
"latest",
{
"tracer": "callTracer"
}
],
"id": 1
}
'import requests
url = "https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm"
payload = {
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [{
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",
"value": "0xde0b6b3a7640000",
"data": "0x"
}, "latest", { "tracer": "callTracer" }],
"id": 1
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'debug_traceCall',
params: [
{
from: '0x69835D480110e4919B7899f465aAB101e21c8A87',
to: '0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5',
gas: '0x76c0',
gasPrice: '0x9184e72a000',
value: '0xde0b6b3a7640000',
data: '0x'
},
'latest',
{tracer: 'callTracer'}
],
id: 1
})
};
fetch('https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm', 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://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm",
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([
'jsonrpc' => '2.0',
'method' => 'debug_traceCall',
'params' => [
[
'from' => '0x69835D480110e4919B7899f465aAB101e21c8A87',
'to' => '0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5',
'gas' => '0x76c0',
'gasPrice' => '0x9184e72a000',
'value' => '0xde0b6b3a7640000',
'data' => '0x'
],
'latest',
[
'tracer' => 'callTracer'
]
],
'id' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"debug_traceCall\",\n \"params\": [\n {\n \"from\": \"0x69835D480110e4919B7899f465aAB101e21c8A87\",\n \"to\": \"0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5\",\n \"gas\": \"0x76c0\",\n \"gasPrice\": \"0x9184e72a000\",\n \"value\": \"0xde0b6b3a7640000\",\n \"data\": \"0x\"\n },\n \"latest\",\n {\n \"tracer\": \"callTracer\"\n }\n ],\n \"id\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
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://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"debug_traceCall\",\n \"params\": [\n {\n \"from\": \"0x69835D480110e4919B7899f465aAB101e21c8A87\",\n \"to\": \"0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5\",\n \"gas\": \"0x76c0\",\n \"gasPrice\": \"0x9184e72a000\",\n \"value\": \"0xde0b6b3a7640000\",\n \"data\": \"0x\"\n },\n \"latest\",\n {\n \"tracer\": \"callTracer\"\n }\n ],\n \"id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"debug_traceCall\",\n \"params\": [\n {\n \"from\": \"0x69835D480110e4919B7899f465aAB101e21c8A87\",\n \"to\": \"0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5\",\n \"gas\": \"0x76c0\",\n \"gasPrice\": \"0x9184e72a000\",\n \"value\": \"0xde0b6b3a7640000\",\n \"data\": \"0x\"\n },\n \"latest\",\n {\n \"tracer\": \"callTracer\"\n }\n ],\n \"id\": 1\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {
"type": "CALL",
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"value": "0xde0b6b3a7640000",
"gas": "0x76c0",
"gasUsed": "0x5208",
"input": "0x",
"output": "0x"
}
}Hyperliquid node API
debug_traceCall | Hyperliquid EVM
The debug_traceCall JSON-RPC method executes a call and returns detailed trace information without creating a transaction. On Hyperliquid EVM.
POST
/
evm
debug_traceCall
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",
"value": "0xde0b6b3a7640000",
"data": "0x"
},
"latest",
{
"tracer": "callTracer"
}
],
"id": 1
}
'import requests
url = "https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm"
payload = {
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [{
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",
"value": "0xde0b6b3a7640000",
"data": "0x"
}, "latest", { "tracer": "callTracer" }],
"id": 1
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'debug_traceCall',
params: [
{
from: '0x69835D480110e4919B7899f465aAB101e21c8A87',
to: '0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5',
gas: '0x76c0',
gasPrice: '0x9184e72a000',
value: '0xde0b6b3a7640000',
data: '0x'
},
'latest',
{tracer: 'callTracer'}
],
id: 1
})
};
fetch('https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm', 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://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm",
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([
'jsonrpc' => '2.0',
'method' => 'debug_traceCall',
'params' => [
[
'from' => '0x69835D480110e4919B7899f465aAB101e21c8A87',
'to' => '0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5',
'gas' => '0x76c0',
'gasPrice' => '0x9184e72a000',
'value' => '0xde0b6b3a7640000',
'data' => '0x'
],
'latest',
[
'tracer' => 'callTracer'
]
],
'id' => 1
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm"
payload := strings.NewReader("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"debug_traceCall\",\n \"params\": [\n {\n \"from\": \"0x69835D480110e4919B7899f465aAB101e21c8A87\",\n \"to\": \"0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5\",\n \"gas\": \"0x76c0\",\n \"gasPrice\": \"0x9184e72a000\",\n \"value\": \"0xde0b6b3a7640000\",\n \"data\": \"0x\"\n },\n \"latest\",\n {\n \"tracer\": \"callTracer\"\n }\n ],\n \"id\": 1\n}")
req, _ := http.NewRequest("POST", url, payload)
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://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm")
.header("Content-Type", "application/json")
.body("{\n \"jsonrpc\": \"2.0\",\n \"method\": \"debug_traceCall\",\n \"params\": [\n {\n \"from\": \"0x69835D480110e4919B7899f465aAB101e21c8A87\",\n \"to\": \"0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5\",\n \"gas\": \"0x76c0\",\n \"gasPrice\": \"0x9184e72a000\",\n \"value\": \"0xde0b6b3a7640000\",\n \"data\": \"0x\"\n },\n \"latest\",\n {\n \"tracer\": \"callTracer\"\n }\n ],\n \"id\": 1\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"jsonrpc\": \"2.0\",\n \"method\": \"debug_traceCall\",\n \"params\": [\n {\n \"from\": \"0x69835D480110e4919B7899f465aAB101e21c8A87\",\n \"to\": \"0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5\",\n \"gas\": \"0x76c0\",\n \"gasPrice\": \"0x9184e72a000\",\n \"value\": \"0xde0b6b3a7640000\",\n \"data\": \"0x\"\n },\n \"latest\",\n {\n \"tracer\": \"callTracer\"\n }\n ],\n \"id\": 1\n}"
response = http.request(request)
puts response.read_body{
"jsonrpc": "2.0",
"id": 1,
"result": {
"type": "CALL",
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"value": "0xde0b6b3a7640000",
"gas": "0x76c0",
"gasUsed": "0x5208",
"input": "0x",
"output": "0x"
}
}This method is available on Chainstack. Not all Hyperliquid methods are available on Chainstack, as the open-source node implementation does not support them yet — see Hyperliquid methods for the full availability breakdown.
debug_traceCall JSON-RPC method executes a call and returns detailed trace information without creating a transaction. This method simulates transaction execution and provides comprehensive debugging information including call traces, gas usage, and state changes, making it essential for testing and debugging smart contract interactions before committing transactions to the blockchain.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.
Parameters
- Call object (object, required): Transaction call details
- Block parameter (string, required): Block number, hash, or “latest”/“earliest”/“pending”
- Tracer configuration (object, required): Configuration options for the tracer
Call object structure
from(string, optional): Address the transaction is sent fromto(string, required): Address the transaction is directed togas(string, optional): Gas provided for the transaction executiongasPrice(string, optional): Gas price for the transactionvalue(string, optional): Value sent with the transactiondata(string, optional): Hash of the method signature and encoded parameters
Tracer configuration options
tracer(string): The type of tracer to use"callTracer": Provides detailed call trace information"prestateTracer": Shows state before execution"4byteTracer": Tracks function selector usage
Response
The method returns detailed trace information for the simulated call, including execution details, gas usage, and state changes.Response structure
Trace data:type— The type of call (CALL, DELEGATECALL, STATICCALL, CREATE, etc.)from— The address that initiated the callto— The address that received the callvalue— The value transferred in the callgas— The amount of gas allocated for the callgasUsed— The amount of gas actually consumedinput— The input data for the calloutput— The output data returned by the callcalls— Array of sub-calls made during execution
Usage example
Basic implementation
// Trace a simulated call
const traceCall = async (callObject, blockParameter = 'latest') => {
const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_ENDPOINT/evm', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
method: 'debug_traceCall',
params: [
callObject,
blockParameter,
{
tracer: 'callTracer'
}
],
id: 1
})
});
const data = await response.json();
return data.result;
};
// Simulate and analyze a contract interaction
const simulateContractCall = async () => {
const callObject = {
from: '0x69835D480110e4919B7899f465aAB101e21c8A87',
to: '0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5',
gas: '0x76c0',
gasPrice: '0x9184e72a000',
value: '0xde0b6b3a7640000',
data: '0x' // Simple transfer, no data
};
try {
const trace = await traceCall(callObject);
console.log('Call Simulation Results:');
console.log(`Type: ${trace.type}`);
console.log(`From: ${trace.from}`);
console.log(`To: ${trace.to}`);
console.log(`Value: ${parseInt(trace.value, 16)} wei`);
console.log(`Gas Used: ${parseInt(trace.gasUsed, 16)}`);
return trace;
} catch (error) {
console.error('Error simulating call:', error);
throw error;
}
};
// Test contract function before execution
const testContractFunction = async (contractAddress, functionData, fromAddress) => {
const callObject = {
from: fromAddress,
to: contractAddress,
data: functionData,
gas: '0x100000' // High gas limit for testing
};
const trace = await traceCall(callObject);
// Analyze the simulation
const analysis = {
willSucceed: trace.output !== '0x',
gasEstimate: parseInt(trace.gasUsed, 16),
hasSubCalls: trace.calls && trace.calls.length > 0,
subCallCount: trace.calls ? trace.calls.length : 0
};
console.log('Function Test Analysis:');
console.log(`Will Succeed: ${analysis.willSucceed}`);
console.log(`Estimated Gas: ${analysis.gasEstimate}`);
console.log(`Sub-calls: ${analysis.subCallCount}`);
return { trace, analysis };
};
// Compare gas usage across different scenarios
const compareGasUsage = async (scenarios) => {
const results = [];
for (const [name, callObject] of scenarios) {
try {
const trace = await traceCall(callObject);
results.push({
scenario: name,
gasUsed: parseInt(trace.gasUsed, 16),
success: trace.output !== '0x'
});
} catch (error) {
results.push({
scenario: name,
error: error.message,
success: false
});
}
}
console.log('Gas Usage Comparison:');
results.forEach(result => {
if (result.success) {
console.log(`${result.scenario}: ${result.gasUsed.toLocaleString()} gas`);
} else {
console.log(`${result.scenario}: Failed - ${result.error}`);
}
});
return results;
};
// Usage
simulateContractCall().then(trace => {
console.log('Simulation completed successfully');
});
Example request
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceCall",
"params": [
{
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",
"value": "0xde0b6b3a7640000",
"data": "0x"
},
"latest",
{
"tracer": "callTracer"
}
],
"id": 1
}' \
https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
from web3 import Web3
w3 = Web3(Web3.HTTPProvider("YOUR_CHAINSTACK_ENDPOINT"))
call_object = {
"from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
"to": "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
"gas": "0x76c0",
"gasPrice": "0x9184e72a000",
"value": "0xde0b6b3a7640000",
"data": "0x",
}
trace = w3.manager.request_blocking(
"debug_traceCall",
[call_object, "latest", {"tracer": "callTracer"}],
)
print(trace)
import { JsonRpcProvider } from "ethers";
const provider = new JsonRpcProvider("YOUR_CHAINSTACK_ENDPOINT");
const callObject = {
from: "0x69835D480110e4919B7899f465aAB101e21c8A87",
to: "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
gas: "0x76c0",
gasPrice: "0x9184e72a000",
value: "0xde0b6b3a7640000",
data: "0x",
};
const trace = await provider.send("debug_traceCall", [
callObject,
"latest",
{ tracer: "callTracer" },
]);
console.log(trace);
import { createPublicClient, http } from "viem";
const client = createPublicClient({
transport: http("YOUR_CHAINSTACK_ENDPOINT"),
});
const callObject = {
from: "0x69835D480110e4919B7899f465aAB101e21c8A87",
to: "0xB7C609cFfa0e47DB2467ea03fF3e598bf59361A5",
gas: "0x76c0",
gasPrice: "0x9184e72a000",
value: "0xde0b6b3a7640000",
data: "0x",
};
const trace = await client.request({
method: "debug_traceCall",
params: [callObject, "latest", { tracer: "callTracer" }],
});
console.log(trace);
Use your own endpoint in your code. The code examples use a placeholder Chainstack endpoint (YOUR_CHAINSTACK_ENDPOINT) — replace it with your own Hyperliquid node endpoint from the Chainstack console. The curl above uses a shared public endpoint for quick checks only; do not use it in production.
Use cases
Thedebug_traceCall method is essential for applications that need to:
- Pre-execution testing: Test transactions before committing them to the blockchain
- Gas estimation: Accurately estimate gas requirements for complex transactions
- Smart contract debugging: Debug contract interactions and identify execution issues
- Transaction simulation: Simulate complex DeFi transactions and multi-step operations
- Error prediction: Predict and prevent transaction failures before execution
- Cost optimization: Optimize transaction parameters for better gas efficiency
- Integration testing: Test smart contract integrations and compatibility
- Security testing: Test for potential vulnerabilities and edge cases
- Development workflows: Integrate simulation into development and testing pipelines
- User experience: Provide users with transaction previews and success predictions
- MEV analysis: Analyze Maximum Extractable Value opportunities safely
- Arbitrage testing: Test arbitrage strategies without risking capital
- Flash loan simulation: Simulate complex flash loan strategies
- Protocol testing: Test new protocol features and upgrades
- Compliance checking: Verify regulatory compliance before transaction execution
- Risk assessment: Assess transaction risks and potential outcomes
Body
application/json
Last modified on June 24, 2026
Was this page helpful?