SDK
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getWalletPositionsV2('CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i', {
category: 'lending', // Or liquidity, staking, leverage, orders, rewards, other.
// platform: 'kamino', // An id from client.getPortfolioPlatformsV2().
limit: 50,
});
for (const position of data.positions) {
console.log(position.name, position.usd, position.apy, position.healthPercent, position.claimableUsd);
}
// client.iterateWalletPositionsV2() walks every page.
curl --request GET \
--url https://data.solanatracker.io/v2/wallet/{wallet}/positions \
--header 'x-api-key: <api-key>'import requests
url = "https://data.solanatracker.io/v2/wallet/{wallet}/positions"
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://data.solanatracker.io/v2/wallet/{wallet}/positions', 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://data.solanatracker.io/v2/wallet/{wallet}/positions",
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://data.solanatracker.io/v2/wallet/{wallet}/positions"
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://data.solanatracker.io/v2/wallet/{wallet}/positions")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.solanatracker.io/v2/wallet/{wallet}/positions")
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{
"wallet": "CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i",
"slot": 475880664,
"updatedAt": 1796067128569,
"positions": [
{
"id": "kamino-vault-LnBhqBJEA4T8JpTSZBrWTFCL4Qa6nWJ6H72ukHkE729",
"platform": "kamino",
"service": "vault",
"category": "liquidity",
"name": "Kamino Vault",
"address": "LnBhqBJEA4T8JpTSZBrWTFCL4Qa6nWJ6H72ukHkE729",
"usd": 26010.10554,
"apy": 8.77,
"yearlyUsd": 2280.462624,
"claimableUsd": 83.651952,
"healthPercent": null,
"inRange": null,
"assets": [
{
"mint": "2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo",
"role": "supplied",
"amount": 26005.642935,
"priceUsd": 1.0001716013994661,
"usd": 26010.10554,
"apy": null,
"yearlyUsd": null
}
],
"claimable": [
{
"mint": "2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo",
"amount": 83.6376,
"priceUsd": 1.0001716013994661,
"usd": 83.651952
}
],
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fkamino.webp"
},
{
"id": "kamino-vault-ADietbkvGfEL5gYFzQN6wzazp4f221tEhZRPUGPck2Sy",
"platform": "kamino",
"service": "vault",
"category": "liquidity",
"name": "Kamino Vault",
"address": "ADietbkvGfEL5gYFzQN6wzazp4f221tEhZRPUGPck2Sy",
"usd": 21154.671999,
"apy": 8,
"yearlyUsd": 1693.263872,
"claimableUsd": 0,
"healthPercent": null,
"inRange": null,
"assets": [
{
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"role": "supplied",
"amount": 21154.671999,
"priceUsd": 1,
"usd": 21154.671999,
"apy": null,
"yearlyUsd": null
}
],
"claimable": [],
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fkamino.webp"
}
],
"tokens": {
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": {
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"image": "https://image.solanatracker.io/proxy?url=https://static.datapi.jup.ag/token-icons/6c4e5669d2a438653105399865445682e4a6cb51e19e1e61dc97578cd27bb9b2.webp",
"supply": 8121434516.222706,
"uri": null,
"description": null,
"creator": null,
"createdOn": null,
"twitter": "https://twitter.com/circle",
"telegram": null,
"website": "https://www.circle.com/en/usdc"
},
"2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo": {
"name": "PayPal USD",
"symbol": "PYUSD",
"decimals": 6,
"image": "https://image.solanatracker.io/proxy?url=https://static.datapi.jup.ag/token-icons/0817b3345e648b1663385bac48eb086877635ee27639c3d5da2a4d9dfd8603b1.webp",
"supply": 688682738.280124,
"uri": "https://token-metadata.paxos.com/pyusd_metadata/prod/solana/pyusd_metadata.json",
"description": "PayPal USD is designed to contribute to the opportunity stablecoins offer for payments and is 100% backed by U.S. dollar deposits, short-term U.S Treasuries and similar cash equivalents. PayPal USD is redeemable 1:1 for U.S. dollars and is issued by Paxos Trust Company.",
"creator": null,
"createdOn": null,
"twitter": null,
"telegram": null,
"website": null
}
},
"nextCursor": "eyJ2IjoyLCJhdCI6MTc5NjA2NzEyODU2OSwicyI6MjExNTQuNjcxOTk5LCJ0Ijoia2FtaW5vLXZhdWx0LUFEaWV0Ymt2R2ZFTDVnWUZ6UU42d3phenA0ZjIyMXRFaFpSUFVHUGNrMlN5IiwicSI6InB8ZHx8In0",
"hasNextPage": true
}{
"error": "Invalid sort. Valid options are: value, amount, change24h"
}{
"error": "<string>"
}{
"error": "Wallet data is temporarily unavailable, please retry"
}Wallet
API de posiciones DeFi de wallets de Solana
Posiciones DeFi de una wallet de Solana en préstamos, liquidez, staking, apalancamiento y órdenes, con valor, APY, salud y recompensas por reclamar.
GET
/
v2
/
wallet
/
{wallet}
/
positions
SDK
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getWalletPositionsV2('CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i', {
category: 'lending', // Or liquidity, staking, leverage, orders, rewards, other.
// platform: 'kamino', // An id from client.getPortfolioPlatformsV2().
limit: 50,
});
for (const position of data.positions) {
console.log(position.name, position.usd, position.apy, position.healthPercent, position.claimableUsd);
}
// client.iterateWalletPositionsV2() walks every page.
curl --request GET \
--url https://data.solanatracker.io/v2/wallet/{wallet}/positions \
--header 'x-api-key: <api-key>'import requests
url = "https://data.solanatracker.io/v2/wallet/{wallet}/positions"
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://data.solanatracker.io/v2/wallet/{wallet}/positions', 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://data.solanatracker.io/v2/wallet/{wallet}/positions",
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://data.solanatracker.io/v2/wallet/{wallet}/positions"
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://data.solanatracker.io/v2/wallet/{wallet}/positions")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://data.solanatracker.io/v2/wallet/{wallet}/positions")
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{
"wallet": "CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i",
"slot": 475880664,
"updatedAt": 1796067128569,
"positions": [
{
"id": "kamino-vault-LnBhqBJEA4T8JpTSZBrWTFCL4Qa6nWJ6H72ukHkE729",
"platform": "kamino",
"service": "vault",
"category": "liquidity",
"name": "Kamino Vault",
"address": "LnBhqBJEA4T8JpTSZBrWTFCL4Qa6nWJ6H72ukHkE729",
"usd": 26010.10554,
"apy": 8.77,
"yearlyUsd": 2280.462624,
"claimableUsd": 83.651952,
"healthPercent": null,
"inRange": null,
"assets": [
{
"mint": "2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo",
"role": "supplied",
"amount": 26005.642935,
"priceUsd": 1.0001716013994661,
"usd": 26010.10554,
"apy": null,
"yearlyUsd": null
}
],
"claimable": [
{
"mint": "2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo",
"amount": 83.6376,
"priceUsd": 1.0001716013994661,
"usd": 83.651952
}
],
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fkamino.webp"
},
{
"id": "kamino-vault-ADietbkvGfEL5gYFzQN6wzazp4f221tEhZRPUGPck2Sy",
"platform": "kamino",
"service": "vault",
"category": "liquidity",
"name": "Kamino Vault",
"address": "ADietbkvGfEL5gYFzQN6wzazp4f221tEhZRPUGPck2Sy",
"usd": 21154.671999,
"apy": 8,
"yearlyUsd": 1693.263872,
"claimableUsd": 0,
"healthPercent": null,
"inRange": null,
"assets": [
{
"mint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"role": "supplied",
"amount": 21154.671999,
"priceUsd": 1,
"usd": 21154.671999,
"apy": null,
"yearlyUsd": null
}
],
"claimable": [],
"image": "https://image.solanatracker.io/proxy?url=https%3A%2F%2Fplatform-images.solanatracker.io%2Fkamino.webp"
}
],
"tokens": {
"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v": {
"name": "USD Coin",
"symbol": "USDC",
"decimals": 6,
"image": "https://image.solanatracker.io/proxy?url=https://static.datapi.jup.ag/token-icons/6c4e5669d2a438653105399865445682e4a6cb51e19e1e61dc97578cd27bb9b2.webp",
"supply": 8121434516.222706,
"uri": null,
"description": null,
"creator": null,
"createdOn": null,
"twitter": "https://twitter.com/circle",
"telegram": null,
"website": "https://www.circle.com/en/usdc"
},
"2b1kV6DkPAnxd5ixfnxCpjxmKwqjjaYmCZfHsFu24GXo": {
"name": "PayPal USD",
"symbol": "PYUSD",
"decimals": 6,
"image": "https://image.solanatracker.io/proxy?url=https://static.datapi.jup.ag/token-icons/0817b3345e648b1663385bac48eb086877635ee27639c3d5da2a4d9dfd8603b1.webp",
"supply": 688682738.280124,
"uri": "https://token-metadata.paxos.com/pyusd_metadata/prod/solana/pyusd_metadata.json",
"description": "PayPal USD is designed to contribute to the opportunity stablecoins offer for payments and is 100% backed by U.S. dollar deposits, short-term U.S Treasuries and similar cash equivalents. PayPal USD is redeemable 1:1 for U.S. dollars and is issued by Paxos Trust Company.",
"creator": null,
"createdOn": null,
"twitter": null,
"telegram": null,
"website": null
}
},
"nextCursor": "eyJ2IjoyLCJhdCI6MTc5NjA2NzEyODU2OSwicyI6MjExNTQuNjcxOTk5LCJ0Ijoia2FtaW5vLXZhdWx0LUFEaWV0Ymt2R2ZFTDVnWUZ6UU42d3phenA0ZjIyMXRFaFpSUFVHUGNrMlN5IiwicSI6InB8ZHx8In0",
"hasNextPage": true
}{
"error": "Invalid sort. Valid options are: value, amount, change24h"
}{
"error": "<string>"
}{
"error": "Wallet data is temporarily unavailable, please retry"
}Las posiciones DeFi de la wallet, de mayor a menor. Filtra por
platform o category.
Cada posición tiene:
assets: los tokens de la posición, con su rol (supplied,borrowed,liquidityostaked), cantidad, precio y valor. Los tokens prestados tienenusdnegativo, así que los tokens suman elusdde la posición.apyyyearlyUsd: lo que gana la posición en un año a las tasas actuales, descontando el coste de los préstamos. Las posiciones apalancadas pueden tener unapymuy negativo.healthPercentpara préstamos: 100 significa sin deuda y 0 significa liquidación.inRangepara liquidez concentrada: si el precio actual está dentro del rango de la posición.claimable: recompensas y comisiones que se pueden reclamar ya. Su valor esclaimableUsd, que no está incluido enusd.
id no cambia durante toda la vida de la posición. Los nombres, símbolos y logos de los tokens están en tokens.
¿Buscas las ganancias y pérdidas de trading por token? Usa Get Wallet Positions en PnL V2.
Paginación. Pasa nextCursor como cursor hasta que hasNextPage sea false, con los mismos filtros y sortDirection.
SDK Example
import { Client } from '@solana-tracker/data-api';
const client = new Client({ apiKey: 'YOUR_API_KEY' });
const data = await client.getWalletPositionsV2('CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i', {
category: 'lending', // Or liquidity, staking, leverage, orders, rewards, other.
// platform: 'kamino', // An id from client.getPortfolioPlatformsV2().
limit: 50,
});
for (const position of data.positions) {
console.log(position.name, position.usd, position.apy, position.healthPercent, position.claimableUsd);
}
// client.iterateWalletPositionsV2() walks every page.
Parámetros de ruta
Parámetros de consulta
Solo posiciones en esta plataforma. Usa un id de Get Portfolio Platforms.
Ejemplo:
"kamino"
Respuesta
Una página de las posiciones DeFi de la wallet.
¿Esta página le ayudó?