Skip to main content
Schema: near.defi Table: ez_dex_swaps Type: View

Description

This table provides an enhanced view of all decentralized exchange (DEX) swap transactions on the NEAR Protocol blockchain, combining raw swap data with token metadata, pricing information, and decimal adjustments. The table includes both raw and adjusted amounts, USD values, and comprehensive token context, making it the primary table for DEX analytics and trading analysis. This easy view eliminates the need for complex joins and calculations, providing ready-to-use data for DeFi analytics, reporting, and business intelligence workflows.

Key Use Cases

  • DEX trading volume analysis with accurate decimal-adjusted amounts and USD values
  • Token pair liquidity analysis and trading pattern identification
  • Price impact analysis and slippage calculation with USD context
  • DEX protocol comparison and performance benchmarking
  • Arbitrage opportunity detection and analysis
  • Trading bot activity monitoring and pattern recognition
  • DeFi protocol integration analysis and cross-protocol flows

Important Relationships

  • Enhances defi.fact_dex_swaps with pricing and metadata from price.ez_prices_hourly
  • Combines token metadata from core.dim_ft_contract_metadata for complete token context
  • Supports defi.ez_intents with swap execution analysis
  • Enables analysis in stats.ez_core_metrics_hourly for DeFi metrics
  • Provides foundation for all DEX-related analytics and reporting
  • Powers cross-protocol analysis with other DeFi activities

Commonly-used Fields

  • amount_in and amount_out: Essential for accurate swap amount analysis
  • amount_in_usd and amount_out_usd: Critical for economic analysis and value calculations
  • block_timestamp: Primary field for time-series analysis and trend detection
  • trader: Important for user behavior analysis and trading patterns
  • platform: Essential for DEX protocol analysis and comparison
  • symbol_in and symbol_out: Important for token pair identification and analysis
  • pool_id: Useful for liquidity pool analysis and performance tracking

Columns

Column NameData TypeDescription
TX_HASHTEXTUnique identifier (hash) of this transaction.
RECEIPT_IDTEXT
BLOCK_IDNUMBERThe height of the chain this block corresponds with.
BLOCK_TIMESTAMPTIMESTAMP_NTZThe date and time at which the block began.
PLATFORMTEXTThe protocol utilized for the operation, likely a swap or bridge.
POOL_IDNUMBERThe unique id for the pool involved in the swap.
TRADERTEXTThe address who initiated the swap.
SWAP_INDEXNUMBERThe index number of the swap indicating its order of execution in the transaction.
AMOUNT_OUT_RAWNUMBERUnadjusted amount of tokens as it appears on-chain (not decimal adjusted). This is the raw token amount before any decimal precision adjustments are applied. For example, if transferring 1 NEAR token, the amount_raw would be 1000000000000000000000000 (1e24) since NEAR has 24 decimal places. This field preserves the exact on-chain representation of the token amount for precise calculations and verification.
AMOUNT_OUTFLOATThe amount of tokens taken out of or received from the swap.
AMOUNT_OUT_USDFLOATUSD value of the token transfer (null if hourly price not available). This field provides the dollar equivalent value of the token transfer by multiplying the decimal-adjusted token amount by the token’s USD price at the time of the transfer. This field is null when price data is unavailable, which can occur for new tokens, tokens with low liquidity, or during periods when price feeds are unavailable.
TOKEN_OUT_CONTRACTTEXTThe address of the deployed contract for the token, nft, or other smart contract.
SYMBOL_OUTTEXTToken symbol (e.g., ‘wNEAR’, ‘SWEAT’). This field contains the abbreviated identifier for the token as commonly used in trading pairs, price feeds, and user interfaces. Token symbols are typically 2-6 characters long and provide a quick way to identify tokens without using their full contract addresses. Examples include ‘NEAR’ for the native token, ‘wNEAR’ for wrapped NEAR, and ‘USDC’ for USD Coin.
TOKEN_OUT_IS_VERIFIEDBOOLEANBoolean flag indicating whether the token or price record is verified by Flipside’s crosschain curation process. Verified tokens are prioritized for analytics and are considered reliable for most use cases. Unverified tokens may be incomplete, deprecated, or experimental.
AMOUNT_IN_RAWNUMBERUnadjusted amount of tokens as it appears on-chain (not decimal adjusted). This is the raw token amount before any decimal precision adjustments are applied. For example, if transferring 1 NEAR token, the amount_raw would be 1000000000000000000000000 (1e24) since NEAR has 24 decimal places. This field preserves the exact on-chain representation of the token amount for precise calculations and verification.
AMOUNT_INFLOATThe amount of tokens put into the swap.
AMOUNT_IN_USDFLOATUSD value of the token transfer (null if hourly price not available). This field provides the dollar equivalent value of the token transfer by multiplying the decimal-adjusted token amount by the token’s USD price at the time of the transfer. This field is null when price data is unavailable, which can occur for new tokens, tokens with low liquidity, or during periods when price feeds are unavailable.
TOKEN_IN_CONTRACTTEXTThe address of the deployed contract for the token, nft, or other smart contract.
SYMBOL_INTEXTToken symbol (e.g., ‘wNEAR’, ‘SWEAT’). This field contains the abbreviated identifier for the token as commonly used in trading pairs, price feeds, and user interfaces. Token symbols are typically 2-6 characters long and provide a quick way to identify tokens without using their full contract addresses. Examples include ‘NEAR’ for the native token, ‘wNEAR’ for wrapped NEAR, and ‘USDC’ for USD Coin.
TOKEN_IN_IS_VERIFIEDBOOLEANBoolean flag indicating whether the token or price record is verified by Flipside’s crosschain curation process. Verified tokens are prioritized for analytics and are considered reliable for most use cases. Unverified tokens may be incomplete, deprecated, or experimental.
SWAP_INPUT_DATAVARIANTJSON of input data for the swap, taken from the FunctionCall JSON.
Note, directional keys such as in and out are determined by the pool.
LOGTEXTA single log extracted from a receipt.
EZ_DEX_SWAPS_IDTEXTA unique identifier for the record.
INSERTED_TIMESTAMPTIMESTAMP_NTZThe timestamp at which the record was initially created and inserted into this table.
MODIFIED_TIMESTAMPTIMESTAMP_NTZThe timestamp at which this record was last modified by an internal process.
TOKEN_IN_IS_VERIFIED_2BOOLEAN
TOKEN_OUT_IS_VERIFIED_2BOOLEAN