Skip to main content
Schema: aptos.defi Table: fact_dex_swaps Type: Base Table

Description

This table records all raw on-chain DEX swap events on Aptos for protocols including animeswap, auxexchange, batswap, cellana, cetus, hippo, liquidswap, pancake, sushi, thala, and tsunami. It provides the unadjusted, protocol-level swap data, including token addresses, amounts, and swapper addresses, without any decimal adjustment, token symbol enrichment, or price attribution.

Key Use Cases

  • Analyzing DEX trading activity and protocol market share
  • Building custom swap aggregations and liquidity analytics
  • Auditing raw swap flows for compliance or research
  • Powering dashboards for DEX volume, user activity, and token flows
  • Supporting downstream enrichment models for DeFi analytics

Important Relationships

  • Serves as the source for enriched swap data in defi.ez_dex_swaps
  • Token metadata is joined from core.dim_tokens for symbol/decimals
  • Can be linked to price data in price.ez_prices_hourly for USD values
  • Related to bridge activity in defi.fact_bridge_activity for cross-protocol analysis

Commonly-used Fields

  • tx_hash, event_index: Unique identifiers for each swap event
  • platform: DEX protocol name
  • token_in, token_out: Token addresses for swap input/output
  • amount_in_unadj, amount_out_unadj: Raw, non-decimal-adjusted swap amounts
  • swapper: Address of the user executing the swap
  • block_timestamp: Time of the swap event

Columns

Column NameData TypeDescription
BLOCK_NUMBERNUMBERAlso known as block height. The block number indicates the position of a block in the blockchain, increasing sequentially after the addition of each new block.
Data type: Integer Example:
  • 12345678
  • 98765432
Business Context:
  • Primary identifier for ordering and filtering blockchain data chronologically.
  • Essential for block-level analysis and network growth tracking.
  • Enables correlation of transactions, transfers, and events to specific blocks. | | BLOCK_TIMESTAMP | TIMESTAMP_NTZ | The date and time at which the block was produced on the Aptos blockchain.
Data type: Timestamp Example:
  • 2024-01-15 14:30:25.123456
Business Context:
  • Primary field for time-series analysis and temporal filtering of blockchain activity.
  • Essential for trend analysis, volume calculations, and historical comparisons.
  • Enables time-based grouping and aggregation for analytics and reporting. | | VERSION | NUMBER | The version number, also known as the height, represents the sequential position of a transaction in the Aptos blockchain. The first transaction has a version of 0, and each subsequent transaction increments by 1.
Data type: Integer Example:
  • 0 (genesis transaction)
  • 12345678
  • 98765432
Business Context:
  • Unique identifier for ordering transactions chronologically across the entire blockchain.
  • Essential for transaction sequencing and version-based analysis.
  • Enables precise transaction tracking and blockchain state verification. | | TX_HASH | TEXT | Transaction hash is a unique 66-character identifier that is generated when a transaction is executed on the Aptos blockchain.
Data type: String Example:
  • 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
Business Context:
  • Primary identifier for linking transaction data across all related tables.
  • Essential for transaction verification and blockchain explorer lookups.
  • Enables correlation of transfers, events, and state changes to specific transactions. | | EVENT_INDEX | NUMBER | Unique identifier for an event within a transaction, representing the sequential order of events emitted during transaction execution.
Data type: Integer Example:
  • 0 (first event in transaction)
  • 1 (second event in transaction)
  • 5 (sixth event in transaction)
Business Context:
  • Essential for determining the chronological order of events within a transaction.
  • Critical for event correlation and transaction flow analysis.
  • Enables precise event sequencing and debugging of complex transactions. | | PLATFORM | TEXT | The name of the platform where the swap occurred.
Data type: String Example:
  • PancakeSwap
  • Uniswap
  • SushiSwap
Business Context:
  • Used for identifying and analyzing DEX platform usage.
  • Enables platform-level analytics, volume tracking, and protocol comparisons.
  • Supports DEX ecosystem analysis and user behavior insights. | | EVENT_ADDRESS | TEXT | | | SWAPPER | TEXT | Address that initiated the swap.
Data type: String Example:
  • 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
Business Context:
  • Used for tracking swap users and their trading activity.
  • Enables user-level analytics, trading patterns, and swapper behavior analysis.
  • Supports linking to address labels and user profiles. | | TOKEN_IN | TEXT | The address of the inbound token in the swap.
Data type: String Example:
  • 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
Business Context:
  • Used for identifying input tokens and their swap activity.
  • Enables token-level analytics, volume tracking, and cross-token analysis.
  • Supports DEX ecosystem monitoring and token flow visualization. | | TOKEN_OUT | TEXT | The address of the outbound token in the swap.
Data type: String Example:
  • 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
Business Context:
  • Used for identifying output tokens and their swap activity.
  • Enables token-level analytics, volume tracking, and cross-token analysis.
  • Supports DEX ecosystem monitoring and token flow visualization. | | AMOUNT_IN_UNADJ | NUMBER | The non-decimal adjusted amount of the inbound token for the swap.
Data type: Integer Example:
  • 1500000 (for 1.5 tokens with 6 decimals)
  • 1000000000000000000 (for 1 token with 18 decimals)
Business Context:
  • Essential for reconstructing the exact on-chain value of swap inputs.
  • Used for technical audits, protocol analytics, and downstream decimal adjustment.
  • Enables accurate calculation of swap volumes and liquidity flows. | | AMOUNT_OUT_UNADJ | NUMBER | The non-decimal adjusted amount of the outbound token for the swap.
Data type: Integer Example:
  • 1500000 (for 1.5 tokens with 6 decimals)
  • 1000000000000000000 (for 1 token with 18 decimals)
Business Context:
  • Essential for reconstructing the exact on-chain value of swap outputs.
  • Used for technical audits, protocol analytics, and downstream decimal adjustment.
  • Enables accurate calculation of swap volumes and liquidity flows. | | FACT_DEX_SWAPS_ID | TEXT | The unique primary key identifier for each row in the table, ensuring data integrity and uniqueness.
Data type: String Example:
  • 0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
Business Context:
  • Essential for data integrity and unique row identification.
  • Critical for join operations and data relationship management.
  • Enables precise data retrieval and referential integrity maintenance. | | INSERTED_TIMESTAMP | TIMESTAMP_NTZ | The UTC timestamp when the row was inserted into the table, representing when the data was first recorded.
Data type: Timestamp Example:
  • 2024-01-15 14:30:25.123456
Business Context:
  • Essential for data lineage tracking and insertion timing analysis.
  • Critical for understanding data freshness and processing delays.
  • Enables data quality analysis and processing performance monitoring. | | MODIFIED_TIMESTAMP | TIMESTAMP_NTZ | The UTC timestamp when the row was last modified, representing when the data was most recently updated.
Data type: Timestamp Example:
  • 2024-01-15 14:30:25.123456
Business Context:
  • Essential for data freshness analysis and update tracking.
  • Critical for understanding data modification patterns and change frequency.
  • Enables data quality monitoring and update performance analysis. |