post https://rest-api.hellomoon.io/v0/defi/swaps
DeFi Swaps endpoint can be used to track and verify both large and small
swap amounts that occur on the Solana blockchain. Hello Moon also provides key data fields such as the time of the swap, who made the swap, and the program and aggregator that was used.
Examples
Track swaps for a wallet
const axios = require("axios");
const url = "https://rest-api.hellomoon.io/v0/defi/swaps";
async function getSwaps() {
const { data } = await axios.post(
url,
{
"userAccount": "9QsYSps7ULsTDSgQ8pxCofh4uccCSU4eoPgF68vYLzYb"
},
{
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: "Bearer <your_token>",
},
}
);
console.log(data);
}
List swaps on a specific DEX
const axios = require("axios");
const url = "https://rest-api.hellomoon.io/v0/defi/swaps";
async function getSwapsOnWhirlpool() {
const { data } = await axios.post(
url,
{
"programId": "whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc"
},
{
headers: {
Accept: "application/json",
"Content-Type": "application/json",
Authorization: "Bearer <your_token>",
},
}
);
console.log(data);
}