View as Markdown
Codex icon

Codex ACTION

Get Pair Stats

Returns metadata and trading statistics for a token pair: price, volume, liquidity, and price changes across multiple timeframes. Use this to analyze DEX pair activity (e.g., Uniswap V2/V3 pools). statsType FILTERED removes wash trades for cleaner signal; UNFILTERED includes all activity. Use Get Networks to resolve the numeric networkId if needed. See the documentation
  • Action
  • Read only
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Codex account once, then configure and run Get Pair Stats from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "codex-get-pair-stats",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    codex: { authProvisionId: "apn_xxxxxxx" },
    pairAddress: "Pair Address",
    networkId: 10,
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Get Pair Stats inputs
Property Type Description
pairAddress Pair Address string
Contract address of the trading pair (e.g., 0xb4e16d0168e52d35cacd2c6185b44281ec28c9dc for WETH/USDC Uniswap V2).
Required
networkId Network ID integer
Numeric blockchain network ID. Use Get Networks to list all supported networks and their IDs (e.g., 1 = Ethereum, 137 = Polygon).
Required
statsType Stats Type string
FILTERED removes wash trades for cleaner data (default). UNFILTERED returns all raw activity.
Optional
tokenOfInterest Token Of Interest string
The token of interest used to calculate token-specific stats for the pair. Can be token0 or token1.
Optional
timestamp Timestamp integer
The unix timestamp for the stats. Defaults to current.
Optional
durations Durations string[]
The list of durations to get detailed pair stats for.
Optional
bucketCount Bucket Count integer
The number of aggregated values to receive. Note: Each duration has predetermined bucket sizes.
Optional

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
codex-get-pair-stats
Version
0.0.2
App
Codex
Authentication
API key
Read-only
Yes
Destructive
No
Open world
Yes