> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.chainstack.com/feedback

```json
{
  "path": "/reference/hyperliquid-evm-trace-raw-transaction",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# trace_rawTransaction | Hyperliquid EVM

> Executes a raw transaction and returns trace information. This method simulates the execution of a raw transaction and provides detailed execution traces.

<Info>
  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](/docs/hyperliquid-methods) for the full availability breakdown.
</Info>

The `trace_rawTransaction` JSON-RPC method executes a raw transaction and returns trace information. This method simulates the execution of a raw transaction and provides detailed execution traces, making it useful for analyzing pre-signed transactions and testing transaction execution without broadcasting.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

1. **Raw transaction data** (string, required): Raw transaction in hexadecimal format
2. **Trace types** (array, required): Array of trace types to include in response

### Trace types

* `"trace"`: Basic execution trace information
* `"vmTrace"`: Virtual machine execution trace
* `"stateDiff"`: State differences caused by the transaction

## Response

The method returns an array of trace objects containing detailed execution information.

### Response structure

**Trace objects:**

* `action` — Details about the call action
* `result` — Execution result
* `traceAddress` — Address path within call hierarchy
* `type` — Type of trace (call, create, suicide, etc.)

## Usage example

### Basic implementation

```javascript theme={"system"}
// Execute a raw transaction with tracing
const traceRawTransaction = async (rawTx, traceTypes = ['trace']) => {
  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: 'trace_rawTransaction',
      params: [rawTx, traceTypes],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Example usage
const rawTx = '0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89';

traceRawTransaction(rawTx).then(traces => {
  console.log('Raw transaction trace:');
  traces.forEach(trace => {
    console.log(`Type: ${trace.type}`);
    console.log(`Gas used: ${parseInt(trace.result.gasUsed, 16)}`);
  });
});
```

## Example request

```shell Shell theme={"system"}
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "trace_rawTransaction",
    "params": [
      "0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89",
      ["trace"]
    ],
    "id": 1
  }' \
  https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm
```

## Use cases

The `trace_rawTransaction` method is essential for applications that need to:

* **Pre-signed transaction analysis**: Analyze transactions before broadcasting
* **Offline transaction testing**: Test transaction execution offline
* **Transaction debugging**: Debug transaction execution issues
* **Security analysis**: Analyze transaction security and potential vulnerabilities
* **Gas estimation**: Get accurate gas estimates for raw transactions
* **Development tools**: Build transaction analysis and debugging tools
* **Wallet applications**: Provide transaction previews in wallet interfaces
* **Compliance checking**: Verify regulatory compliance before broadcasting
* **Educational tools**: Create educational content about transaction execution
* **Research platforms**: Support academic and commercial blockchain research

This method provides comprehensive analysis of raw transactions before execution on the Hyperliquid EVM platform.


## OpenAPI

````yaml /openapi/hyperliquid_node_api/evm_trace_raw_transaction.json post /evm
openapi: 3.0.0
info:
  title: Hyperliquid EVM API - trace_rawTransaction
  version: 1.0.0
servers:
  - url: >-
      https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274
security: []
paths:
  /evm:
    post:
      summary: trace_rawTransaction
      description: >-
        Executes a raw transaction and returns trace information. This method
        simulates the execution of a raw transaction and provides detailed
        execution traces.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
                - id
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                  default: '2.0'
                  description: JSON-RPC version
                method:
                  type: string
                  enum:
                    - trace_rawTransaction
                  default: trace_rawTransaction
                  description: The RPC method name
                params:
                  type: array
                  description: 'Parameters: [raw transaction data, trace types array]'
                  default:
                    - >-
                      0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89
                    - - trace
                id:
                  type: integer
                  default: 1
                  description: Request identifier
            example:
              jsonrpc: '2.0'
              method: trace_rawTransaction
              params:
                - >-
                  0xf86d80843b9aca0082520894b7c609cffa0e47db2467ea03ff3e598bf59361a5880de0b6b3a7640000808207f2a02d013b9980176ca8674f77797ac04e928b8de3be92dd452501ec26acbb2b1abca054041f43109eeadbb4d6b712a20dc71e5dbe1225e549644be3de803b55041a89
                - - trace
              id: 1
      responses:
        '200':
          description: Successful response with trace data
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    description: JSON-RPC version
                  id:
                    type: integer
                    description: Request identifier
                  result:
                    type: array
                    description: Array of trace objects containing execution information
              example:
                jsonrpc: '2.0'
                id: 1
                result:
                  - action:
                      from: 0x...
                      to: 0x...
                      value: 0x...
                      gas: 0x...
                      input: 0x
                      callType: call
                    result:
                      gasUsed: '0x5208'
                      output: 0x
                    traceAddress: []
                    type: call

````