Skip to content

Commit 9a8efb5

Browse files
g1nt0kiperoxy
andauthored
Update kamino lending markets (DefiLlama#9211)
* Fetch kamino lend markets dynamically * kamino: cache api response --------- Co-authored-by: peroxy <[email protected]>
1 parent 5a47ac0 commit 9a8efb5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

projects/kamino-lending/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ const { getConnection, sumTokens } = require('../helper/solana');
33
const { Program } = require('@project-serum/anchor');
44
const kaminoIdl = require('./kamino-lending-idl.json');
55
const { MintLayout } = require("../helper/utils/solana/layouts/mixed-layout");
6+
const { getConfig } = require('../helper/cache')
67

78
async function tvl() {
89
const connection = getConnection();
910
const programId = new PublicKey('KLend2g3cP87fffoy8q1mQqGKjrxjC8boSyAYavgmjD');
10-
const markets = ['7u3HeHxYDLhnCoErrtycNokbQYbWGzLs6JSDqGAv5PfF', 'DxXdAyU3kCjnyggvHmY5nAwg5cRbbmdyX3npfDMjjMek'];
11+
const markets = (await getConfig('kamino-lending', 'https://api.kamino.finance/v2/kamino-market')).map(x => x.lendingMarket);
1112
const lendingMarketAuthSeed = 'lma';
1213
const tokensAndOwners = [];
1314
const ktokens = {};

0 commit comments

Comments
 (0)