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 Wallet Address

Ethereum Logo

Looking for swaps by wallet address on EVM?

Access swaps by wallet address data using our EVM API.

Explore EVM API
GEThttps://solana-gateway.moralis.io/account/:network/:walletAddress/swaps

Get all swap related transactions (buy, sell) for a specific wallet address.

PATH PARAMS
networkstringrequired
The network to query
walletAddressstringrequired
The address of the wallet
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. Possible values: 'buy','sell' or both separated by comma
tokenAddressstring
Token address to get transactions for
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/account/mainnet/6Hf1CYNfDAbpKdiz8N9RAFMoZfqinGVytJX7hD1zHg7v/swaps?order=DESC', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Response Example
{
"cursor": "",
"page": 1,
"pageSize": 100,
"result": [
{
"transactionHash": "5KweZ2jJsfeyYdjZBsQdntbaxcH4EhSqbeWxLZsDDMCuqTmQJEqA2etZzrrgSuoRVLP7oqxk5jmKzUZnVf4Q37h5",
"transactionIndex": 195,
"transactionType": "buy",
"baseQuotePrice": "0.000001180",
"blockTimestamp": "2024-12-04T09:59:07.000Z",
"blockNumber": "",
"subCategory": "accumulation",
"walletAddress": "6Hf1CYNfDAbpKdiz8N9RAFMoZfqinGVytJX7hD1zHg7v",
"pairAddress": "4w2iPn26d9UJAbQpoaAw34iFPta53fq6KvHr3cGfYsxa",
"pairLabel": "SANTA/SOL",
"exchangeName": "Raydium AMM v4",
"exchangeAddress": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8",
"exchangeLogo": "https://entities-logos.s3.amazonaws.com/raydium.png",
"baseToken": "J8uZpXLyrmaPawRFdu81byzRSLqnurTvhQ9nd2ZLVQvE",
"quoteToken": "So11111111111111111111111111111111111111112",
"bought": {
"address": "J8uZpXLyrmaPawRFdu81byzRSLqnurTvhQ9nd2ZLVQvE",
"amount": "84006.619895709",
"usdPrice": 0.000278171,
"usdAmount": 23.368205463009268,
"symbol": "SANTA",
"logo": "https://gateway.irys.xyz/4teQlB8gGU-G_RfqUOiK3gg9h3VelCt_rFcl7dlzrQg",
"name": "santawifhat",
"tokenType": "token0"
},
"sold": {
"address": "So11111111111111111111111111111111111111112",
"amount": "0.099150000",
"usdPrice": 235.686180744,
"usdAmount": 23.368284820767602,
"symbol": "SOL",
"logo": "",
"name": "Wrapped SOL",
"tokenType": "token1"
},
"totalValueUsd": 23.36828482
}
]
}