跳转到主要内容
GET
SDK
钱包的 DeFi 仓位,按价值从大到小排列。可按 platform 或 category 筛选。 每个仓位包含:
  • assets:仓位中的代币及其角色(supplied、borrowed、liquidity 或 staked)、数量、价格和价值。借入代币的 usd 为负数,因此各代币之和等于仓位的 usd。
  • apy 和 yearlyUsd:按当前利率,仓位一年能赚多少,已扣除借款成本。杠杆仓位的 apy 可能是很大的负数。
  • healthPercent(借款仓位):100 表示没有债务,0 表示清算。
  • inRange(集中流动性):当前价格是否在仓位区间内。
  • claimable:现在就能领取的奖励和手续费,价值见 claimableUsd,不计入 usd。
id 在仓位存续期间保持不变。代币名称、符号和 logo 在 tokens 中。 想查看按代币的交易盈亏?请使用 PnL V2 中的 Get Wallet Positions。 分页。 将 nextCursor 作为 cursor 传入,直到 hasNextPage 为 false,并保持筛选条件和 sortDirection 不变。

SDK Example

授权

x-api-key
string
header
必填

API Key for authentication

路径参数

wallet
string
默认值:CN8w8cuh87gZYjhpaPxbD78GTrBmUKmVysqgsC9uYu9i
必填

钱包地址。

查询参数

limit
integer
默认值:100

每页行数,最多 500。超过 500 时按 500 行返回。

必填范围: 1 <= x <= 500
cursor
string

上一页返回的 nextCursor。其他参数需保持不变,否则请求会返回 400。

platform
string

只返回该平台的仓位。使用 Get Portfolio Platforms 中的 id。

示例:

"kamino"

category
enum<string>

只返回该类别的仓位。

可用选项:
liquidity,
lending,
staking,
leverage,
orders,
rewards,
other
sortDirection
enum<string>
默认值:DESC

DESC 从大到小(默认),ASC 从小到大。没有值的行始终排在最后。

可用选项:
DESC,
ASC

响应

一页钱包 DeFi 仓位。

wallet
string
必填
slot
integer
必填

Solana slot the data was fetched at.

updatedAt
integer
必填

When the data was fetched, in Unix milliseconds.

positions
object[]
必填
tokens
object
必填

Details of each token on the page: name, symbol, decimals and logo.

nextCursor
string | null
必填

Pass as cursor to get the next page. Null on the last page.

hasNextPage
boolean
必填