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

Get Swaps by Pair Address Mainnet Only

Solana Logo

Looking for swaps by pair address on Solana?

Access swaps by pair address data using our powerful Solana API

Explore Solana API
GEThttps://deep-index.moralis.io/api/v2.2/pairs/:address/swaps

Fetch swap transactions (buy, sell, add/remove liquidity) for a specific token pair.

Note

Swaps data is synced and available only from September 2024 onwards. Data prior to this date is not included.

PATH PARAMS
addressstringrequired
The pair address token-transactions are to be retrieved for.
QUERY PARAMS
chainstring
The chain to query
cursorstring
The cursor returned in the previous response (used for getting the next page).
limitnumber
The desired page size of the result.
fromBlocknumber

The minimum block number from which to get the token transactions

  • Provide the param 'fromBlock' or 'fromDate'
  • If 'fromDate' and 'fromBlock' are provided, 'fromBlock' will be used.
toBlockstring
The block number to get the token transactions from
fromDatestring

The start date from which to get the token transactions (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 end date from which to get the token transactions (format in seconds or datestring accepted by momentjs)

  • Provide the param 'toBlock' or 'toDate'
  • If 'toDate' and 'toBlock' are provided, 'toBlock' will be used.
orderstring
The order of the result, in ascending (ASC) or descending (DESC)
transactionTypesstring
Array of transaction types. Allowed values are 'buy', 'sell', 'addLiquidity', 'removeLiquidity'.
Responses
200Returns swap transactions by pair address.
400Bad Request
404Not Found
429Too Many Requests
500Internal Server Error
API KEY
curl --request GET \
--url 'https://deep-index.moralis.io/api/v2.2/pairs/0xa43fe16908251ee70ef74718545e4fe6c5ccec9f/swaps?chain=eth&limit=25&order=DESC' \
--header 'accept: application/json' \
--header 'X-API-Key: YOUR_API_KEY'
Response Example
{
"page": "2",
"pageSize": "100",
"cursor": "",
"exchangeAddress": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f",
"exchangeName": "Uniswap v2",
"exchangeLogo": "https://entities-logos.s3.us-east-1.amazonaws.com/uniswap.png",
"pairLabel": "BRETT/WETH",
"pairAddress": "0x36a46dff597c5a444bbc521d26787f57867d2214",
"result": [
{
"transactionHash": "0x2bfcba4715774420936669cd0ff2241d70e9abecab76c9db813602015b3134ad",
"transactionIndex": 1,
"transactionType": "buy",
"blockTimestamp": "2022-02-22T00:00:00Z",
"blockNumber": 21093423,
"subCategory": "accumulation",
"walletAddress": "0x2bfcba4715774420936669cd0ff2241d70e9abec",
"baseTokenAmount": "1481.00",
"quoteTokenAmount": "0.634",
"baseTokenPriceUsd": 0.0734634,
"quoteTokenPriceUsd": 23330,
"baseQuotePrice": "0.00003376480687",
"totalValueUsd": 1165
}
]
}