Skip to content

Commit

Permalink
venus split apy components
Browse files Browse the repository at this point in the history
  • Loading branch information
slasher125 committed Aug 14, 2022
1 parent f654a4f commit 34f0868
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/adaptors/venus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@ const utils = require('../utils');

const API_URL: string = 'https://api.venus.io/api/governance/venus';

const XVS = '0xcf6bb5389c92bdda8a3747ddb454cb7a64626c63';

interface Market {
address: string;
underlyingSymbol: string;
totalSupplyUsd: string;
totalBorrowsUsd: string;
supplyApy: string;
supplyVenusApy: string;
underlyingAddress: string;
}

const getApy = async () => {
Expand All @@ -21,7 +24,13 @@ const getApy = async () => {
project: 'venus',
symbol: market.underlyingSymbol,
tvlUsd: Number(market.totalSupplyUsd) - Number(market.totalBorrowsUsd),
apy: Number(market.supplyApy) + Number(market.supplyVenusApy),
apyBase: Number(market.supplyApy),
apyReward: Number(market.supplyVenusApy),
rewardTokens: [XVS],
underlyingTokens:
market.underlyingSymbol === 'BNB'
? ['0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c']
: [],
}));

return pools;
Expand Down

0 comments on commit 34f0868

Please sign in to comment.