Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion src/adaptors/degenprime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const AERO_POOL_TUP_CONTRACT = '0x4524D39Ca5b32527E7AF6c288Ad3E2871B9f343B';
const BTC_POOL_TUP_CONTRACT = '0xCA8C954073054551B99EDee4e1F20c3d08778329';
const ETH_POOL_TUP_CONTRACT = '0x81b0b59C7967479EC5Ce55cF6588bf314C3E4852';
const BRETT_POOL_TUP_CONTRACT = '0x6c307F792FfDA3f63D467416C9AEdfeE2DD27ECF';
const KAITO_POOL_TUP_CONTRACT = '0x293E41F1405Dde427B41c0074dee0aC55D064825';

// Token Addresses
const AERO_TOKEN_ADDRESS = '0x940181a94A35A4569E4529A3CDfB74e38FD98631';
Expand All @@ -72,6 +73,7 @@ const BRETT_TOKEN_ADDRESS = '0x532f27101965dd16442E59d40670FaF5eBB142E4';
const BTC_TOKEN_ADDRESS = '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf';
const ETH_TOKEN_ADDRESS = '0x4200000000000000000000000000000000000006';
const DEGEN_TOKEN_ADDRESS = '0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed';
const KAITO_TOKEN_ADDRESS = '0x98d0baa52b2D063E780DE12F615f963Fe8537553';

const getPoolTVL = async (poolAddress, chain = 'base') => {
return (
Expand Down Expand Up @@ -120,6 +122,9 @@ const getBrettPoolDepositRate = async () => {
const getAeroPoolDepositRate = async () => {
return (await getPoolDepositRate(AERO_POOL_TUP_CONTRACT)) / 1e16;
};
const getKaitoPoolDepositRate = async () => {
return (await getPoolDepositRate(KAITO_POOL_TUP_CONTRACT)) / 1e16;
};

const getBtcPoolTVL = async () => {
const supply = await getPoolTVL(BTC_POOL_TUP_CONTRACT);
Expand All @@ -135,6 +140,13 @@ const getEthPoolTVL = async () => {
return (supply * price) / 1e18;
};

const getKaitoPoolTVL = async () => {
const supply = await getPoolTVL(KAITO_POOL_TUP_CONTRACT);

const price = await getTokenPrice(KAITO_TOKEN_ADDRESS);
return (supply * price) / 1e18;
};

const getBrettPoolTVL = async () => {
const supply = await getPoolTVL(BRETT_POOL_TUP_CONTRACT);

Expand Down Expand Up @@ -210,7 +222,18 @@ const getPoolsAPYs = async () => {
underlyingTokens: [ETH_TOKEN_ADDRESS],
};

return [usdcPool, brettPool, aeroPool, btcPool, ethPool];
const kaitoPoolTvl = await getKaitoPoolTVL();
const kaitoPool = {
pool: `dgp-${KAITO_TOKEN_ADDRESS}-base`,
chain: utils.formatChain('base'),
project: 'degenprime',
symbol: utils.formatSymbol('KAITO'),
tvlUsd: kaitoPoolTvl,
apyBase: await getKaitoPoolDepositRate(),
underlyingTokens: [KAITO_TOKEN_ADDRESS],
};

return [usdcPool, brettPool, aeroPool, btcPool, ethPool, kaitoPool];
};

module.exports = {
Expand Down
Loading