Get profit and loss for an obligation
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",
"invested": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"truncatedHistory": true
}{
"error": "The requested calculation is not supported for this asset"
}{
"error": "An internal error occurred"
}{
"error": "<string>"
}User and Loans Data
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.
GET
/
v2
/
kamino-market
/
{marketPubkey}
/
obligations
/
{obligationPubkey}
/
pnl
Get profit and loss for an obligation
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",
"invested": {
"usd": "1234.56789",
"sol": "1234.56789"
},
"truncatedHistory": true
}{
"error": "The requested calculation is not supported for this asset"
}{
"error": "An internal error occurred"
}{
"error": "<string>"
}Path Parameters
Kamino Lend market public key
Example:
"7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF"
Kamino Lend obligation public key
Example:
"63QrAB1okxCc4FpsgcKYHjYTp1ua8ch6mLReyKRdc22o"
Query Parameters
Solana cluster environment
Available options:
mainnet-beta, devnet, localnet Example:
"mainnet-beta"
KLend program ID
Example:
"KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD"
For xSOL pairs, calculate the PnL using the stake rate
Available options:
true, false Example:
"true"
Response
OK