Skip to content

Commit

Permalink
Add kamino lend yields (#1079)
Browse files Browse the repository at this point in the history
  • Loading branch information
peroxy authored Nov 18, 2023
1 parent 3f62227 commit f8fa115
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/adaptors/kamino-lend/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const axios = require('axios');
const utils = require('../utils');

const getApy = async () => {
const markets = ['7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF'];
const reserveApys = [];
for (const market of markets) {
const reserves = (await axios.get(`https://api.kamino.finance/kamino-market/${market}/reserves/metrics?env=mainnet-beta`)).data;

reserveApys.push(
...reserves.map((r) => {
return {
pool: r.reserve,
chain: 'Solana',
project: 'kamino-lend',
symbol: utils.formatSymbol(r.liquidityToken),
underlyingTokens: [r.liquidityTokenMint],
tvlUsd: Number(r.totalSupplyUsd - r.totalBorrowUsd),
url: `https://app.kamino.finance/lending/reserve/${r.reserve}`,
apyBase: Number(r.supplyApy) * 100,
totalSupplyUsd: Number(r.totalSupplyUsd),
totalBorrowUsd: Number(r.totalBorrowUsd),
apyBaseBorrow: Number(r.borrowApy) * 100,
ltv: Number(r.maxLtv),
};
})
);
}

return reserveApys;
};

module.exports = {
apy: getApy,
url: 'https://app.kamino.finance/',
};

0 comments on commit f8fa115

Please sign in to comment.