DeFi Swaps

NOTE: This endpoint is only callable by API keys in the following tiers:

  • Business
  • Developer
  • Enterprise
  • PremiumSharedRpc
  • StarterSharedRpc
  • UltimateSharedRpc

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.

Log in to see full request history

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); }
Body Params

body

string

The user account or public key references a digital wallet that can be used to sign transactions, transfers and
hold digital assets such as tokens and NFTs.
optional field

string

The source mint references the token that is sent for the swap.
For example, The user account swaps the source mint for the destination mint.
optional field

string

The destination mint references the token that is received from the swap.
For example, The user account swaps the source mint for the destination mint.
optional field

string
Defaults to Jupiter v4

The aggregator name references a program that allows the user account to access liquidity from multiple DEXs. The name is used to identify the liquidity provider used to execute the swap.
optional field

string

The program id references the DEX (decentralized exchange) address that is used to execute the swap with their provided liquidity.
> You can also visit https://www.hellomoon.io/id?search=dex to search for a DEX program using a user interface.
optional field

Unix epoch time (in seconds) of a block as calculated from validator votes.
If you want to look at historical data, let's say 7 days in the past.
1. Change the operator to <
2. Get the current epochtime i.e, 1673831466 -> Jan 15, 2023
3. Subtract the current epochtime from ( 86400 * 7 ). Place the result of 1673831466 - ( 86400 * 7 ) = 1673226666 in the value input - this returns the epochtime time from 7 days ago
optional field

string

The pool id references the pool that is used for the swap.
For example, The user account swaps the source mint for the destination mint.
optional field

string

First signature in a transaction, which can be used to track and verify the transaction status across the complete ledger.
It is a base-58 encoded string that is uniquely generated for each transaction.
optional field

number
1 to 1000

The number of results to return per page
optional field

number
≥ 1

The page number to return
optional field

string

The pagination token to use to keep your position in the results
optional field

Response

Language
Credentials
Request
Click Try It! to start a request and see the response here! Or choose an example:
application/json