POST
/
evm
eth_simulateV1
curl --request POST \
  --url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "eth_simulateV1",
  "params": [
    {
      "blockStateCalls": [
        {
          "calls": [
            {
              "from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
              "to": "0xb4DcFE4590adBd275aC3Ef1A3dd10e819d11648c",
              "gas": "0x5208",
              "gasPrice": "0x9184e72a000",
              "value": "0xde0b6b3a7640000",
              "data": "0x"
            }
          ],
          "blockOverride": {
            "number": "latest"
          }
        }
      ],
      "traceTransfers": false,
      "validation": true
    }
  ],
  "id": 1
}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}
The eth_simulateV1 JSON-RPC method provides transaction simulation capabilities on the Hyperliquid EVM blockchain. This method allows developers to execute transactions in a controlled environment without actually submitting them to the blockchain, enabling testing, gas estimation, and outcome prediction.
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

The method accepts a single parameter object containing simulation configuration:

Simulation parameters

  • blockStateCalls (array, required) — Array of block state call objects
    • calls (array, required) — Array of transaction calls to simulate
      • from (string, optional) — Transaction sender address
      • to (string, optional) — Transaction recipient address
      • gas (string, optional) — Gas limit as hexadecimal string
      • gasPrice (string, optional) — Gas price as hexadecimal string
      • value (string, optional) — Transaction value as hexadecimal string
      • data (string, optional) — Transaction data as hexadecimal string
    • blockOverride (object, optional) — Block state override options
      • number (string) — Block number to simulate against (e.g., “latest”)
  • traceTransfers (boolean, optional) — Whether to trace token transfers during simulation
  • validation (boolean, optional) — Whether to perform validation during simulation

Response

The method returns detailed simulation results including transaction outcomes, gas usage, and state changes.

Response structure

Simulation results:
  • result — Object containing simulation outcome data including gas estimates, transaction success status, and any error messages
Transaction simulation details:
  • Gas consumption estimates and limits
  • Transaction success or failure status
  • State changes and side effects
  • Error messages if simulation fails
  • Transfer traces if enabled

Usage example

Basic transaction simulation

// Simulate a simple value transfer
const simulateTransaction = async () => {
  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: 'eth_simulateV1',
      params: [{
        blockStateCalls: [{
          calls: [{
            from: "0x69835D480110e4919B7899f465aAB101e21c8A87",
            to: "0xb4DcFE4590adBd275aC3Ef1A3dd10e819d11648c",
            gas: "0x5208",
            gasPrice: "0x9184e72a000",
            value: "0xde0b6b3a7640000",
            data: "0x"
          }],
          blockOverride: {
            number: "latest"
          }
        }],
        traceTransfers: false,
        validation: true
      }],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Test transaction before sending
simulateTransaction().then(result => {
  console.log('Simulation result:', result);
  // Check if transaction would succeed before actually sending it
});

Example request

Shell
curl -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_simulateV1",
    "params": [
      {
        "blockStateCalls": [
          {
            "calls": [
              {
                "from": "0x69835D480110e4919B7899f465aAB101e21c8A87",
                "to": "0xb4DcFE4590adBd275aC3Ef1A3dd10e819d11648c",
                "gas": "0x5208",
                "gasPrice": "0x9184e72a000",
                "value": "0xde0b6b3a7640000",
                "data": "0x"
              }
            ],
            "blockOverride": {
              "number": "latest"
            }
          }
        ],
        "traceTransfers": false,
        "validation": true
      }
    ],
    "id": 1
  }' \
  https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm

Use cases

The eth_simulateV1 method is essential for applications that need to:
  • Transaction testing: Test transactions before submitting them to avoid failed transactions and wasted gas
  • Gas estimation: Accurately estimate gas requirements for complex transactions and smart contract interactions
  • Smart contract debugging: Debug smart contract calls and identify potential issues before deployment
  • DeFi protocol integration: Test complex DeFi transactions involving multiple protocols and token swaps
  • Transaction optimization: Optimize transaction parameters and gas settings for better execution
  • Risk management: Assess transaction risks and potential failures in trading and financial applications
  • MEV protection: Simulate transactions to detect and prevent MEV (Maximum Extractable Value) attacks
  • Batch transaction planning: Plan and validate batch transactions before execution
  • State change prediction: Predict state changes and side effects of complex transactions
  • Cross-protocol interactions: Test interactions between different protocols and smart contracts
  • Governance proposals: Simulate governance proposals and their effects before voting
  • Arbitrage strategies: Test arbitrage opportunities and validate profitability before execution
  • Liquidation simulations: Test liquidation scenarios and validate liquidation bot strategies
  • Oracle integration: Test oracle data integration and price feed reliability
  • Bridge operations: Simulate cross-chain bridge operations and validate transfer logic
  • Staking mechanisms: Test staking and unstaking operations with various parameters
  • Token distribution: Simulate token distribution scenarios and validate allocation logic
  • Flash loan strategies: Test flash loan strategies and validate repayment scenarios
  • AMM interactions: Simulate automated market maker interactions and liquidity provision
  • NFT marketplace: Test NFT trading scenarios and marketplace integrations
This method provides comprehensive transaction simulation capabilities, enabling developers to build robust and reliable applications on the Hyperliquid EVM platform with confidence in transaction outcomes.

Body

application/json

Response

200 - application/json

Successful response with simulation results

The response is of type object.