Get user KVault PnL history
curl --request GET \
--url https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/historyconst options = {method: 'GET'};
fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history"
response = requests.get(url)
print(response.text)false{
"history": [
{
"timestamp": 123,
"type": "buy",
"position": "1234.56789",
"quantity": "1234.56789",
"tokenPrice": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"sharePrice": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"costBasis": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"realizedPnl": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"pnl": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"positionValue": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"investment": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
}
}
],
"totalPnl": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"totalCostBasis": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
}
}{
"error": "Invalid query request",
"details": [
{
"code": "invalid_union",
"errors": [
[
{
"code": "custom",
"path": [],
"message": "Invalid date string"
}
],
[
{
"expected": "number",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected number, received string"
}
]
],
"path": [
"start"
],
"message": "Invalid input"
}
]
}{
"error": "An internal error occurred"
}User Data
Get user KVault PnL history
Get PnL and cost basis history of user vault position
GET
/
kvaults
/
users
/
{userPubkey}
/
vaults
/
{vaultPubkey}
/
pnl
/
history
Get user KVault PnL history
curl --request GET \
--url https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/historyconst options = {method: 'GET'};
fetch('https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.kamino.finance/kvaults/users/{userPubkey}/vaults/{vaultPubkey}/pnl/history"
response = requests.get(url)
print(response.text)false{
"history": [
{
"timestamp": 123,
"type": "buy",
"position": "1234.56789",
"quantity": "1234.56789",
"tokenPrice": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"sharePrice": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"costBasis": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"realizedPnl": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"pnl": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"positionValue": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"investment": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
}
}
],
"totalPnl": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
},
"totalCostBasis": {
"usd": "1234.56789",
"sol": "1234.56789",
"token": "1234.56789"
}
}{
"error": "Invalid query request",
"details": [
{
"code": "invalid_union",
"errors": [
[
{
"code": "custom",
"path": [],
"message": "Invalid date string"
}
],
[
{
"expected": "number",
"code": "invalid_type",
"path": [],
"message": "Invalid input: expected number, received string"
}
]
],
"path": [
"start"
],
"message": "Invalid input"
}
]
}{
"error": "An internal error occurred"
}Path Parameters
Valid base58-encoded address of the vault
Example:
"HDsayqAsDWy3QvANGqh2yNraqcD8Fnjgh73Mhb3WRS5E"
Valid base58-encoded address of the user wallet
Example:
"AxqtG9SHDkZTLSWg81Sp7VqAzQpRqXtR9ziJ3VQAS8As"
Query Parameters
Date input (ISO 8601 string or epoch in ms)
Example:
"2024-01-01T00:00:00.000Z"
Date input (ISO 8601 string or epoch in ms)
Example:
"2024-01-01T00:00:00.000Z"
⌘I