Skip to main content
Track internal transactions (traces) to analyze complex contract interactions and value flows through multiple contracts.

Use Case

Call traces help you:
  • Analyze DEX trades with multiple hops
  • Track value flows through proxy contracts
  • Monitor internal contract calls
  • Debug complex contract interactions

Code Example

curl --compress -X POST 'https://portal.sqd.dev/datasets/ethereum-mainnet/stream' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "evm",
    "fromBlock": 18000000,
    "toBlock": 18010000,
    "fields": {
      "block": {
        "number": true
      },
      "trace": {
        "type": true,
        "callFrom": true,
        "callTo": true,
        "callValue": true,
        "callInput": true,
        "callResultOutput": true,
        "callResultGasUsed": true,
        "error": true
      }
    },
    "traces": [{
      "type": ["call"]
    }]
  }'
Try it yourself with the interactive query interface below:

Key Parameters

ParameterDescription
typeTrace type: call (contract calls) or create (contract deployments)
callFromCaller address
callToCallee address
callValueETH value transferred in the call
callInputCall input data
callResultOutputCall output data
callResultGasUsedGas used by the call
errorError message if trace failed
Portal supports two trace types: call for regular contract calls and create for contract deployments. Other EVM trace types like staticcall, delegatecall, and callcode are normalized to call type.

Expected Output

{
  "header": {
    "number": 18000123
  },
  "traces": [
    {
      "type": "call",
      "callFrom": "0x1234...",
      "callTo": "0x5678...",
      "callValue": "1000000000000000000",
      "callInput": "0xa9059cbb...",
      "callResultOutput": "0x0000000000000000000000000000000000000000000000000000000000000001",
      "callResultGasUsed": "45123",
      "error": null
    }
  ]
}

Filter by Specific Contract

Track all calls to or from a specific contract:
curl --compress -X POST 'https://portal.sqd.dev/datasets/ethereum-mainnet/stream' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "evm",
    "fromBlock": 18000000,
    "toBlock": 18010000,
    "fields": {
      "trace": {
        "type": true,
        "callFrom": true,
        "callTo": true,
        "callValue": true
      }
    },
    "traces": [{
      "callTo": ["0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45"]
    }]
  }'
Traces include both successful and failed calls. Check the error field to filter failed traces.

Analyze Value Flows

Track ETH transfers through internal calls:
const blocks = await dataSource.getBlocks({
  from: 18000000,
  to: 18010000,
  fields: {
    trace: { type: true, callFrom: true, callTo: true, callValue: true },
  },
  traces: [
    {
      type: ["call"],
    },
  ],
});

// Filter traces with value transfers
for (const block of blocks) {
  for (const trace of block.traces) {
    if (BigInt(trace.callValue) > 0n) {
      console.log(`${trace.callFrom}${trace.callTo}: ${trace.callValue} wei`);
    }
  }
}

Performance Tips

  1. Filter by type: Specify trace types to reduce data volume
  2. Use callTo/callFrom: Filter by specific contracts
  3. Request minimal fields: Omit input and output if not needed
  4. Post-filter errors: Filter failed traces in your code if needed
Traces can be very numerous. Use specific filters to avoid processing millions of traces.
Last modified on November 18, 2025