Nansen Query Documentation
  • Introduction
  • Overview
    • 📍Getting Started
    • 📍Benefits of Curation
  • Data
    • 🗃️Data Sources
    • 🗃️Data Catalog
      • 🗃️Raw Events
      • 🗃️Aggregates
        • Entity Stats
        • Address Stats
        • Token Usage Stats
        • Transaction Stats
        • Address & Their Relationships
      • 🗃️Dex Trades
        • 🗃️Dex Trader P&L
        • 🗃️Dex Trader Use Cases
        • 🗃️Advanced Topics
        • 🗃️Trader P&L FAQ
      • 🗃️Decoded Contracts
      • 🗃️NFTs
      • 🗃️Governance
      • 🗃️Solana
        • 🗃️Solana Aggregates
    • 🗃️Repeated / Nested Fields
    • 🗃️Adding New Projects
    • 🗃️Data Marketplace
  • Web App
    • 🖥️Overview
    • 🖥️Getting Started: Web App
    • 🖥️My Queries
    • 🖥️Query Editor
    • 🖥️Visualizations
    • 🖥️Dashboards
    • 🖥️Dashboard Editor
    • 🖥️Refresh Schedules
    • ⚙️Custom Query APIs
      • ⚙️API Keys
      • ⚙️Execute A Query
      • ⚙️Get Query Results
  • Database Access
    • 📂Database Overview
    • 📂Getting Started: Database
    • 📂Sample Queries
      • 📂Wallet Examples
      • 📂Token Examples
      • 📂Trader P&L
      • 📂Project Examples
      • 📂Solana Queries
      • 📂Blockchain Examples
    • 📂Sample Python Code
      • 📂Wallet Examples
      • 📂Token Examples
    • 📂Cost Optimization
    • 📂Database FAQs
  • Other
    • ⁉️General FAQs
    • 🏷️Wallet Labels
Powered by GitBook
On this page
  1. Data
  2. Data Catalog
  3. Dex Trades

Dex Trader P&L

The Dex Trader P&L table is a running (hourly) calculation of an addresses profit and losses (P&L) by token. The P&L only takes into consideration tokens that have been bought and sold on major Dexes and have had some volume.

In this table, each row represent the P&L each trader has for each token as a result of a trade.

  • Rows are only created when a trader makes an eligible trade

  • Prices are the hourly trade weighted average price, where available

The dex trader P&L table uses the following nomenclature: dex_trader_stats_by_hour_token

Field name
Type
Description

block_hour

TIMESTAMP

Hour in which the trading activity took place

trader

STRING

The trader's address

token

STRING

The traded token's address

symbol

STRING

The traded token's symbol

block_hour_trades

REPEATED STRING

Transaction hashes of all trades in block_hour involving this token

bought_token

FLOAT

Total units of token purchased in block_hour

bought_usd

FLOAT

Total $ value of token purchased in block_hour

sold_token

FLOAT

Total units of token sold in block_hour

sold_usd

FLOAT

Total $ value of token sold in block_hour

valid_sold_token

FLOAT

Total units of token sold in block_hour, up to the total amount purchased on DEXs

valid_sold_usd

FLOAT

Total $ value of token sold in block_hour, up to the total amount purchased on DEXs

block_hour_profit

FLOAT

total_profit difference between current block_hour and block_hour the token was last traded, excluding transaction fees

block_hour_fees_usd

FLOAT

Total $ value of transaction fees spent in the block_hour on trades involving the token

total_fees_usd

FLOAT

All time $ value of transaction fees spent on trades involving the token

total_profit

FLOAT

All time realised PnL for the token up to the block_hour, including transaction fees

end_valid_balance

FLOAT

Total units of token held at the end of the block_hour (only ones purchased on DEXs)

end_valid_balance_usd

FLOAT

$ value of token held at the end of the block_hour, (only ones purchased on DEXs)

PreviousDex TradesNextDex Trader Use Cases

Last updated 1 year ago

🗃️
🗃️
🗃️