Get Trades
curl --request POST \
--url https://refract.prismapi.io/v1/solana/dex/trades/get-trades \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"wallet": "suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK",
"limit": 20
}
'import requests
url = "https://refract.prismapi.io/v1/solana/dex/trades/get-trades"
payload = {
"wallet": "suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK",
"limit": 20
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({wallet: 'suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK', limit: 20})
};
fetch('https://refract.prismapi.io/v1/solana/dex/trades/get-trades', 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://refract.prismapi.io/v1/solana/dex/trades/get-trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallet' => 'suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK',
'limit' => 20
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://refract.prismapi.io/v1/solana/dex/trades/get-trades"
payload := strings.NewReader("{\n \"wallet\": \"suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK\",\n \"limit\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://refract.prismapi.io/v1/solana/dex/trades/get-trades")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"wallet\": \"suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK\",\n \"limit\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://refract.prismapi.io/v1/solana/dex/trades/get-trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet\": \"suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK\",\n \"limit\": 20\n}"
response = http.request(request)
puts response.read_body{
"count": 123,
"cursor": "<string>",
"data": [
{
"id": 123,
"protocol": "<string>",
"wallet_address": "<string>",
"token_address": "<string>",
"quote_address": "<string>",
"position_address": "<string>",
"token_amount": 123,
"quote_amount": 123,
"native_amount": 123,
"usd_amount": 123,
"pre_token_balance": 123,
"post_token_balance": 123,
"token_price": 123,
"quote_price": 123,
"token_mcap": 123,
"block_slot": 123,
"block_time": "2023-11-07T05:31:56Z",
"tx_hash": "<string>"
}
]
}{
"error": "Bad request: Invalid request parameters"
}{
"error": "Unauthorized: Invalid or missing API key"
}{
"error": "Forbidden: Access denied for the current API plan"
}{
"error": "Too many requests: Rate limit exceeded"
}{
"error": "Internal server error"
}Trades
Get Trades
Returns trades for a combination of wallet, token and/or pool.
POST
/
v1
/
solana
/
dex
/
trades
/
get-trades
Get Trades
curl --request POST \
--url https://refract.prismapi.io/v1/solana/dex/trades/get-trades \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"wallet": "suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK",
"limit": 20
}
'import requests
url = "https://refract.prismapi.io/v1/solana/dex/trades/get-trades"
payload = {
"wallet": "suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK",
"limit": 20
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({wallet: 'suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK', limit: 20})
};
fetch('https://refract.prismapi.io/v1/solana/dex/trades/get-trades', 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://refract.prismapi.io/v1/solana/dex/trades/get-trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wallet' => 'suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK',
'limit' => 20
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://refract.prismapi.io/v1/solana/dex/trades/get-trades"
payload := strings.NewReader("{\n \"wallet\": \"suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK\",\n \"limit\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://refract.prismapi.io/v1/solana/dex/trades/get-trades")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"wallet\": \"suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK\",\n \"limit\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://refract.prismapi.io/v1/solana/dex/trades/get-trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wallet\": \"suqh5sHtr8HyJ7q8scBimULPkPpA557prMG47xCHQfK\",\n \"limit\": 20\n}"
response = http.request(request)
puts response.read_body{
"count": 123,
"cursor": "<string>",
"data": [
{
"id": 123,
"protocol": "<string>",
"wallet_address": "<string>",
"token_address": "<string>",
"quote_address": "<string>",
"position_address": "<string>",
"token_amount": 123,
"quote_amount": 123,
"native_amount": 123,
"usd_amount": 123,
"pre_token_balance": 123,
"post_token_balance": 123,
"token_price": 123,
"quote_price": 123,
"token_mcap": 123,
"block_slot": 123,
"block_time": "2023-11-07T05:31:56Z",
"tx_hash": "<string>"
}
]
}{
"error": "Bad request: Invalid request parameters"
}{
"error": "Unauthorized: Invalid or missing API key"
}{
"error": "Forbidden: Access denied for the current API plan"
}{
"error": "Too many requests: Rate limit exceeded"
}{
"error": "Internal server error"
}Authorizations
Your Prism API key. You can get one for free in the Prism Dashboard.
Body
application/json
Wallet address to filter trades by.
Token address to filter trades by.
Maximum number of results to return in a single page.
Required range:
1 <= x <= 100Opaque cursor returned by a previous response. Pass it to fetch the next page of results.
Was this page helpful?
⌘I