curl --request GET \
--url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl/historyconst options = {method: 'GET'};
fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl/history"
response = requests.get(url)
print(response.text)false{
"history": [
{
"timestamp": 123,
"type": "deposit",
"pnl": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"investment": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"positionValue": {
"usd": "1234.56789",
"sol": "1234.56789"
}
}
],
"totalPnl": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"invested": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"truncatedHistory": true,
"accountingVersion": 2,
"status": "complete",
"reasons": [
"<string>"
]
}{
"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"
}
]
}{
"metadata": "Account could not be found"
}{
"error": "The requested calculation is not supported for this asset"
}{
"error": "An internal error occurred"
}{
"error": "<string>"
}Get profit and loss history for an obligation
Returns transaction and periodic mark-to-market PnL for the current obligation. Snapshots are hourly for positions younger than 32 days and daily otherwise, timestamped at observation time. Periodic points that cannot be valued are omitted. Optional start (inclusive) and end (exclusive) filter the history; totals always describe the current position. For xSOL pairs, useStakeRate uses stake-rate pricing.
curl --request GET \
--url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl/historyconst options = {method: 'GET'};
fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl/history', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl/history"
response = requests.get(url)
print(response.text)false{
"history": [
{
"timestamp": 123,
"type": "deposit",
"pnl": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"investment": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"positionValue": {
"usd": "1234.56789",
"sol": "1234.56789"
}
}
],
"totalPnl": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"invested": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"truncatedHistory": true,
"accountingVersion": 2,
"status": "complete",
"reasons": [
"<string>"
]
}{
"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"
}
]
}{
"metadata": "Account could not be found"
}{
"error": "The requested calculation is not supported for this asset"
}{
"error": "An internal error occurred"
}{
"error": "<string>"
}Path Parameters
Kamino Lend market public key
"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"
Kamino Lend obligation public key
"63QrAB1okxCc4FpsgcKYHjYTp1ua8ch6mLReyKRdc22o"
Query Parameters
Solana cluster environment
mainnet-beta, devnet, localnet "mainnet-beta"
KLend program ID
"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"
For xSOL pairs, calculate the PnL using the stake rate
true, false "true"
Date input (ISO 8601 string or epoch in ms)
"2024-01-01T00:00:00.000Z"
Date input (ISO 8601 string or epoch in ms)
"2024-01-01T00:00:00.000Z"
Response
OK
Show child attributes
Show child attributes
Current PnL; start and end do not affect it
Show child attributes
Show child attributes
Current net capital invested; start and end do not affect it
Show child attributes
Show child attributes
True when the computation cap dropped older transactions or periodic points
PnL accounting version
2 Accounting completeness
complete, partial, unavailable Reasons for partial or unavailable accounting