Get all swap related transactions (buy, sell) for a specific wallet address.
curl --request GET \
--url https://solana-gateway.moralis.io/account/{network}/{address}/swaps \
--header 'X-Api-Key: <api-key>'import requests
url = "https://solana-gateway.moralis.io/account/{network}/{address}/swaps"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://solana-gateway.moralis.io/account/{network}/{address}/swaps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://solana-gateway.moralis.io/account/{network}/{address}/swaps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://solana-gateway.moralis.io/account/{network}/{address}/swaps"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://solana-gateway.moralis.io/account/{network}/{address}/swaps")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://solana-gateway.moralis.io/account/{network}/{address}/swaps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"page": 123,
"pageSize": 123,
"cursor": "<string>",
"result": [
{
"transactionHash": "0xafc66b9b1802618f560be5244395f0fc0b95a1f1fdeee7a206acbb546c9e8a72",
"transactionIndex": 5,
"transactionType": "buy",
"blockNumber": 12345678,
"blockTimestamp": "2024-11-21T09:22:28.000Z",
"subCategory": "ACCUMULATION",
"walletAddress": "0x1c584a6baecb7c5d51caa0ef3a579e08bd49d4e5",
"pairAddress": "0xdded227d71a096c6b5d87807c1b5c456771aaa94",
"pairLabel": "USDC/WETH",
"exchangeAddress": "0x1080ee857d165186af7f8d63e8ec510c28a6d1ea",
"exchangeName": "Uniswap",
"exchangeLogo": "https://logo.moralis.io/0xe708_0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f_769a0b766bd3d6d1830f0a95d7b3e313",
"baseToken": "ETH",
"quoteToken": "USDT",
"bought": {
"address": "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f",
"name": "Wrapped Ether",
"symbol": "SYM",
"logo": "https://example.com/logo-token1.png",
"amount": "0.000014332429005002",
"usdPrice": 3148.1828278180296,
"usdAmount": 1230,
"tokenType": "token1"
},
"sold": {
"address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff",
"name": "USDC",
"symbol": "SYM",
"logo": "https://example.com/logo-token2.png",
"amount": "1000",
"usdPrice": 0.9999999999999986,
"usdAmount": -0.045138999999999936,
"tokenType": "token0"
},
"baseQuotePrice": "0.01",
"totalValueUsd": 1230
}
]
}Wallet API
Wallet Swaps
Get all swap related transactions (buy, sell) for a specific wallet address.
GET
/
account
/
{network}
/
{address}
/
swaps
Get all swap related transactions (buy, sell) for a specific wallet address.
curl --request GET \
--url https://solana-gateway.moralis.io/account/{network}/{address}/swaps \
--header 'X-Api-Key: <api-key>'import requests
url = "https://solana-gateway.moralis.io/account/{network}/{address}/swaps"
headers = {"X-Api-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<api-key>'}};
fetch('https://solana-gateway.moralis.io/account/{network}/{address}/swaps', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://solana-gateway.moralis.io/account/{network}/{address}/swaps",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://solana-gateway.moralis.io/account/{network}/{address}/swaps"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://solana-gateway.moralis.io/account/{network}/{address}/swaps")
.header("X-Api-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://solana-gateway.moralis.io/account/{network}/{address}/swaps")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"page": 123,
"pageSize": 123,
"cursor": "<string>",
"result": [
{
"transactionHash": "0xafc66b9b1802618f560be5244395f0fc0b95a1f1fdeee7a206acbb546c9e8a72",
"transactionIndex": 5,
"transactionType": "buy",
"blockNumber": 12345678,
"blockTimestamp": "2024-11-21T09:22:28.000Z",
"subCategory": "ACCUMULATION",
"walletAddress": "0x1c584a6baecb7c5d51caa0ef3a579e08bd49d4e5",
"pairAddress": "0xdded227d71a096c6b5d87807c1b5c456771aaa94",
"pairLabel": "USDC/WETH",
"exchangeAddress": "0x1080ee857d165186af7f8d63e8ec510c28a6d1ea",
"exchangeName": "Uniswap",
"exchangeLogo": "https://logo.moralis.io/0xe708_0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f_769a0b766bd3d6d1830f0a95d7b3e313",
"baseToken": "ETH",
"quoteToken": "USDT",
"bought": {
"address": "0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f",
"name": "Wrapped Ether",
"symbol": "SYM",
"logo": "https://example.com/logo-token1.png",
"amount": "0.000014332429005002",
"usdPrice": 3148.1828278180296,
"usdAmount": 1230,
"tokenType": "token1"
},
"sold": {
"address": "0x176211869ca2b568f2a7d4ee941e073a821ee1ff",
"name": "USDC",
"symbol": "SYM",
"logo": "https://example.com/logo-token2.png",
"amount": "1000",
"usdPrice": 0.9999999999999986,
"usdAmount": -0.045138999999999936,
"tokenType": "token0"
},
"baseQuotePrice": "0.01",
"totalValueUsd": 1230
}
]
}Authorizations
Path Parameters
The network to query
Available options:
mainnet, devnet The address to query
Example:
"kXB7FfzdrfZpAZEW3TZcp8a8CwQbsowa6BdfAHZ4gVs"
Query Parameters
The limit per page
Required range:
1 <= x <= 100The cursor to the next page
The order of items
Available options:
ASC, DESC The starting date (format in seconds or datestring accepted by momentjs)
The ending date (format in seconds or datestring accepted by momentjs)
Transaction types to fetch. Possible values: 'buy','sell' or both separated by comma
Example:
"buy,sell"
Token address to get transactions for
⌘I

