debug_traceTransaction
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": [
"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31",
{
"tracer": "callTracer"
}
],
"id": 1
}
'import requests
url = "https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm"
payload = {
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": ["0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31", { "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_traceTransaction',
params: [
'0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31',
{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_traceTransaction',
'params' => [
'0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31',
[
'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_traceTransaction\",\n \"params\": [\n \"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31\",\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_traceTransaction\",\n \"params\": [\n \"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31\",\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_traceTransaction\",\n \"params\": [\n \"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31\",\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": "0x...",
"to": "0x...",
"value": "0x0",
"gas": "0x...",
"gasUsed": "0x...",
"input": "0x...",
"output": "0x..."
}
}Hyperliquid node API
debug_traceTransaction | Hyperliquid EVM
The debug_traceTransaction JSON-RPC method returns detailed trace information for a specific transaction. Hyperliquid EVM via Chainstack.
POST
/
evm
debug_traceTransaction
curl --request POST \
--url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": [
"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31",
{
"tracer": "callTracer"
}
],
"id": 1
}
'import requests
url = "https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm"
payload = {
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": ["0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31", { "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_traceTransaction',
params: [
'0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31',
{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_traceTransaction',
'params' => [
'0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31',
[
'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_traceTransaction\",\n \"params\": [\n \"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31\",\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_traceTransaction\",\n \"params\": [\n \"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31\",\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_traceTransaction\",\n \"params\": [\n \"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31\",\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": "0x...",
"to": "0x...",
"value": "0x0",
"gas": "0x...",
"gasUsed": "0x...",
"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_traceTransaction JSON-RPC method returns detailed trace information for a specific transaction. This method provides comprehensive debugging information including call traces, gas usage, state changes, and execution details, making it essential for transaction analysis, debugging, and forensic investigations.
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
- Transaction hash (string, required): The hash of the transaction to trace
- Tracer configuration (object, required): Configuration options for the tracer
Tracer configuration options
tracer(string): The type of tracer to use. Common options include:"callTracer": Provides detailed call trace information"prestateTracer": Shows state before transaction execution"4byteTracer": Tracks function selector usage
Response
The method returns detailed trace information for the specified transaction, including call hierarchy, 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 specific transaction
const traceTransaction = async (txHash) => {
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_traceTransaction',
params: [
txHash,
{
tracer: 'callTracer'
}
],
id: 1
})
});
const data = await response.json();
return data.result;
};
// Analyze transaction execution
const analyzeTransaction = async (txHash) => {
try {
const trace = await traceTransaction(txHash);
console.log('Transaction Trace Analysis:');
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)}`);
// Analyze sub-calls
if (trace.calls && trace.calls.length > 0) {
console.log(`\nSub-calls (${trace.calls.length}):`);
trace.calls.forEach((call, index) => {
console.log(` ${index + 1}. ${call.type}: ${call.from} -> ${call.to}`);
console.log(` Gas Used: ${parseInt(call.gasUsed, 16)}`);
});
}
return trace;
} catch (error) {
console.error('Error tracing transaction:', error);
throw error;
}
};
// Gas usage analysis
const analyzeGasUsage = (trace) => {
const totalGas = parseInt(trace.gas, 16);
const gasUsed = parseInt(trace.gasUsed, 16);
const efficiency = ((gasUsed / totalGas) * 100).toFixed(2);
console.log('Gas Analysis:');
console.log(`Total Gas Limit: ${totalGas.toLocaleString()}`);
console.log(`Gas Used: ${gasUsed.toLocaleString()}`);
console.log(`Efficiency: ${efficiency}%`);
return {
totalGas,
gasUsed,
efficiency: parseFloat(efficiency)
};
};
// Usage
const txHash = '0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31';
analyzeTransaction(txHash).then(trace => {
analyzeGasUsage(trace);
});
Example request
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "debug_traceTransaction",
"params": [
"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31",
{
"tracer": "callTracer"
}
],
"id": 1
}' \
https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
from web3 import Web3
w3 = Web3(Web3.HTTPProvider("YOUR_CHAINSTACK_ENDPOINT"))
tx_hash = "0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31"
# debug_traceTransaction is not a standard eth_* method, so call it via the provider
trace = w3.provider.make_request(
"debug_traceTransaction",
[tx_hash, {"tracer": "callTracer"}],
)
print(trace["result"])
import { JsonRpcProvider } from "ethers";
const provider = new JsonRpcProvider("YOUR_CHAINSTACK_ENDPOINT");
const txHash =
"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31";
// debug_traceTransaction is not exposed as a typed method, so use send()
const trace = await provider.send("debug_traceTransaction", [
txHash,
{ tracer: "callTracer" },
]);
console.log(trace);
import { createPublicClient, http, type Hash } from "viem";
const client = createPublicClient({
transport: http("YOUR_CHAINSTACK_ENDPOINT"),
});
const txHash: Hash =
"0x07712544ce8f50091c6c3b227921f763b342bf9465a22f0226d651a3246adb31";
// debug_traceTransaction is not a standard action, so type the request with a custom RPC schema
const trace = await client.request<{
Method: "debug_traceTransaction";
Parameters: [Hash, { tracer: string }];
ReturnType: unknown;
}>({
method: "debug_traceTransaction",
params: [txHash, { 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_traceTransaction method is essential for applications that need to:
- Transaction debugging: Debug failed transactions and identify execution issues
- Gas optimization: Analyze gas usage patterns and optimize contract efficiency
- Security analysis: Perform security audits and vulnerability assessments
- Forensic investigation: Investigate suspicious transactions and trace fund flows
- Smart contract testing: Test contract behavior and verify execution paths
- Development tools: Build debugging tools and transaction analyzers
- Performance monitoring: Monitor transaction performance and execution metrics
- Error diagnosis: Diagnose and resolve transaction execution errors
- Compliance tracking: Track regulatory compliance and audit trails
- MEV analysis: Analyze Maximum Extractable Value opportunities and patterns
- DeFi protocol analysis: Understand complex DeFi transaction flows
- Arbitrage detection: Identify and analyze arbitrage opportunities
- Front-running detection: Detect and analyze front-running activities
- Sandwich attack analysis: Identify and study sandwich attack patterns
- Educational tools: Create educational content about blockchain execution
- Research platforms: Support academic and commercial blockchain research
Body
application/json
JSON-RPC version
Available options:
2.0 The RPC method name
Available options:
debug_traceTransaction Parameters: [transactionHash, tracerConfig]
Request identifier
Last modified on June 24, 2026
Was this page helpful?