From 5cd85bc9b4f28568d5790d2e2a9e274ea42e55bf Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Tue, 10 Dec 2024 21:03:11 +0100 Subject: [PATCH] fix kamino --- projects/helper/chain/rpcProxy.js | 6 ++++++ projects/kamino/api.js | 1 + projects/kamino/index.js | 11 ++++++++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/projects/helper/chain/rpcProxy.js b/projects/helper/chain/rpcProxy.js index 203d0308c..a1dd3ce6e 100644 --- a/projects/helper/chain/rpcProxy.js +++ b/projects/helper/chain/rpcProxy.js @@ -34,4 +34,10 @@ module.exports = { return data }, }, + kamino: { + tvl: async () => { + const { data } = await client.get('/kamino/tvl') + return data + }, + }, } \ No newline at end of file diff --git a/projects/kamino/api.js b/projects/kamino/api.js index c0c58e761..e41670c74 100644 --- a/projects/kamino/api.js +++ b/projects/kamino/api.js @@ -2,6 +2,7 @@ const { Kamino } = require('@kamino-finance/kliquidity-sdk') const { getConnection, } = require('../helper/solana') async function tvl() { + throw new Error('Using rpc proxy now') const kamino = new Kamino('mainnet-beta', getConnection()); const shareData = await kamino.getStrategiesShareData({}); return { diff --git a/projects/kamino/index.js b/projects/kamino/index.js index c35d609f7..060baec16 100644 --- a/projects/kamino/index.js +++ b/projects/kamino/index.js @@ -1,8 +1,13 @@ -const { getExports } = require('../helper/heroku-api') + +const { kamino } = require("../helper/chain/rpcProxy") module.exports = { doublecounted: true, timetravel: false, - misrepresentedTokens: true, - ...getExports("kamino", ['solana']) + misrepresentedTokens: true, + solana: { tvl } +} + +async function tvl(api) { + api.addUSDValue(await kamino.tvl()) } \ No newline at end of file