Skip to main content

Don't have an API key yet?

Sign-up to Moralis to get your free API key and start building today.

Get Your Free API Key
Version: 2.2

Get Swaps by Pair Address

Ethereum Logo

Looking for swaps by pair address on EVM?

Access token swap data by pair address using our EVM API.

Explore EVM API
GEThttps://solana-gateway.moralis.io/token/:network/pairs/:pairAddress/swaps

Get all swap related transactions (buy, sell, add liquidity & remove liquidity) for a specific pair address.

PATH PARAMS
networkstringrequired
The network to query
pairAddressstringrequired
The address of the pair
QUERY PARAMS
fromDatestring

The starting date (format in seconds or datestring accepted by momentjs)

  • Provide the param 'fromBlock' or 'fromDate'
  • If 'fromDate' and 'fromBlock' are provided, 'fromBlock' will be used.
toDatestring

The ending date (format in seconds or datestring accepted by momentjs)

  • Provide the param 'toBlock' or 'toDate'
  • If 'toDate' and 'toBlock' are provided, 'toBlock' will be used.
cursorstring
The cursor returned in the previous response (used for getting the next page)
limitnumber
The number of results to return
orderstring
The order of the result, in ascending (ASC) or descending (DESC)
transactionTypesstring
Transaction types to fetch. Allowed values are 'buy', 'sell', 'addLiquidity', 'removeLiquidity'.
Responses
API KEY
// Dependencies to install:
// $ npm install node-fetch --save
// add "type": "module" to package.json

import fetch from 'node-fetch';

const options = {
method: 'GET',
headers: {
accept: 'application/json',
'X-API-Key': 'YOUR_API_KEY'
},
};

fetch('https://solana-gateway.moralis.io/token/mainnet/pairs/EP2ib6dYdEeqD8MfE2ezHCxX3kP3K2eLKkirfPm5eyMx/swaps?order=DESC', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response Example
{
"page": 1,
"cursor": "",
"pageSize": 100,
"exchangeLogo": "https://entities-logos.s3.amazonaws.com/raydium.png",
"exchangeName": "Raydium AMM v4",
"exchangeAddress": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
"pairAddress": "EP2ib6dYdEeqD8MfE2ezHCxX3kP3K2eLKkirfPm5eyMx",
"pairLabel": "$WIF/SOL",
"baseToken": {
"address": "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm",
"name": "dogwifhat",
"symbol": "$WIF",
"logo": "https://bafkreibk3covs5ltyqxa272uodhculbr6kea6betidfwy3ajsav2vjzyum.ipfs.nftstorage.link",
"decimals": "6"
},
"quoteToken": {
"address": "So11111111111111111111111111111111111111112",
"name": "Wrapped SOL",
"symbol": "SOL",
"logo": "",
"decimals": "9"
},
"result": [
{
"transactionHash": "3TKXFCC8LQ9AoXjexQZocNaKhP9Lzh76AYL2kRherokwzxaZsaqZTfJU2c79UNsQyjFYxLFR8JLyiwr5Gpu96brW",
"transactionType": "sell",
"transactionIndex": 103,
"blockTimestamp": "2024-12-05T09:16:31.000Z",
"blockNumber": 305530938,
"walletAddress": "MfDuWeqSHEqTFVYZ7LoexgAK9dxk7cy4DFJWjWMGVWa",
"subCategory": "partialSell",
"baseTokenAmount": "267.722149000",
"quoteTokenAmount": "3.718135539",
"baseTokenPriceUsd": 3.268334358,
"quoteTokenPriceUsd": 235.334481202,
"baseQuotePrice": "0.013888038",
"totalValueUsd": 875.005498109
}
]
}