Description
The Swaps endpoint provides per-swap fee accounting for AMM pools. Each swap record includes executed token amounts, computed fee amounts, and fee splits across recipients (LPs/users, protocol, extra destinations). This data enables revenue attribution, pool economics analysis, and feeds into yield prediction models.Endpoint Matrix
| Endpoint | Summary | Dataset ID | Typical Latency |
|---|---|---|---|
POST /evm/swaps/fees | Per-swap fee accounting (executed sizes + fee amounts) | 0303 | < 250 ms |
Parameter Conventions
Starting block height (inclusive) for swap fee records.
Ending block height (inclusive) for swap fee records.
Starting timestamp (ISO-8601). If it falls between blocks, the next block after this timestamp is used.
Ending timestamp (ISO-8601). If it falls between blocks, the last block before this timestamp is used.
BlockDB pool identifiers for filtering swap fees by pool.
Pool contract addresses to scope swap fee data.
Filter by input token addresses.
Filter by output token addresses.
Filter by fee token addresses.
Chain identifier for the target EVM network. See Chain enumeration for supported values.
Usage Guidance
- Join with fee terms — Link swap fees to pool fee configuration via
pool_uidto understand fee splits - Time-series analysis — Swap fees are ordered by block/time; use ranges for historical revenue analysis
- Filter by tokens — Use
token_in_addressesandtoken_out_addressesto analyze specific trading pairs - Revenue attribution — Fee split fields (
fee_amount_user,fee_amount_protocol,fee_amount_extra) enable precise revenue attribution - Feed yield models — Swap fee data is the primary input for yield/ROI predictions (see
/evm/yields)
Fee Calculation
Swap fees are computed using the pool’s fee terms (from/evm/pools/fee-terms):
fee_amount_total ≈ amount_in * total_feefee_amount_user ≈ amount_in * user_fee(when available)fee_amount_protocol ≈ amount_in * protocol_fee(when available)fee_amount_extra ≈ amount_in * extra_fee(when available)
fee_token, which may differ from token_in or token_out depending on the pool type.
Common Patterns
Calculate pool revenue over time:Dataset Relationships
- Pools → Swap Fees: Join pool metadata to swap fees using
pool_uid - Fee Terms → Swap Fees: Fee terms define the fee calculation rules applied to each swap
- Swap Fees → Yields: Yield predictions are derived from historical swap fees and current reserves
- Swap Fees → Reserves: Swap fees indicate liquidity changes that affect reserve snapshots
- Swap Fees → Prices: Swap execution prices are captured in the pricing layers
See Also
POST /evm/swaps/fees— Per-swap fee accounting endpointPOST /evm/pools/fee-terms— Pool fee configurationPOST /evm/yields— Yield/ROI predictions derived from swap feesPOST /evm/reserves— Pool reserve snapshotsPOST /evm/pools— Pool metadata registry- Pool Type — AMM pool classifications