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
Try it yourself with the interactive query interface below:
Key Parameters
| Parameter | Description |
|---|---|
type | Trace type: call (contract calls) or create (contract deployments) |
callFrom | Caller address |
callTo | Callee address |
callValue | ETH value transferred in the call |
callInput | Call input data |
callResultOutput | Call output data |
callResultGasUsed | Gas used by the call |
error | Error 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
The raw HTTP response nests the requestedcall*/create* fields under action and result sub-objects rather than returning them flat, and numeric values like action.value are hex wei:
transactionHash is not a trace field. To attach a trace to its transaction hash, set "transaction": true in the traces filter and request fields.transaction.hash; the hash arrives on the joined transactions row and you match it by transactionIndex:transactionIndex on both the trace and the transaction selectors. That shared index is the key you match on, since the joined transaction arrives in a separate transactions array.The @subsquid/portal-client typed client flattens the action/result nesting back to the requested selector names (trace.callFrom, trace.callResultGasUsed), as the TypeScript snippet above shows. The nesting only applies to the raw HTTP response.Filter by Specific Contract
Track all calls to or from a specific contract:Traces include both successful and failed calls. Check the
error field to filter failed traces.Analyze Value Flows
Track ETH transfers through internal calls:Performance Tips
- Filter by type: Specify trace types to reduce data volume
- Use callTo/callFrom: Filter by specific contracts
- Request minimal fields: Omit
inputandoutputif not needed - Post-filter errors: Filter failed traces in your code if needed
Related Examples
Query Transactions
Monitor transaction activity
Index DEX Swaps
Track DEX trading with traces
Query Event Logs
Track smart contract events
API Reference
View complete API docs