curl --request GET \
--url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnlconst options = {method: 'GET'};
fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl', 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"
response = requests.get(url)
print(response.text)false{
"usd": "25.21",
"sol": "1.0",
"accountingVersion": 2,
"status": "complete",
"reasons": [
"<string>"
],
"invested": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"truncatedHistory": true
}{
"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 for an obligation
Get profit and loss (PnL) for a specific obligation. For xSOL pairs, useStakeRate can be set to true to calculate the PnL using the stake rate.
curl --request GET \
--url https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnlconst options = {method: 'GET'};
fetch('https://api.kamino.finance/v2/kamino-market/{marketPubkey}/obligations/{obligationPubkey}/pnl', 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"
response = requests.get(url)
print(response.text)false{
"usd": "25.21",
"sol": "1.0",
"accountingVersion": 2,
"status": "complete",
"reasons": [
"<string>"
],
"invested": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"truncatedHistory": true
}{
"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"
Response
OK
PnL in USD
"25.21"
PnL in SOL
"1.0"
PnL accounting version
2 Accounting completeness
complete, partial, unavailable Reasons for partial or unavailable accounting
Invested amounts
Show child attributes
Show child attributes
Set when the obligation transaction history exceeded the computation cap and older transactions were dropped from the PnL calculation