Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Reservoir TVL on Ethereum #11478

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
24 changes: 24 additions & 0 deletions projects/reservoir-protocol/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const ADDRESSES = require('../helper/coreAssets.json');

const rUSD = '0x09D4214C03D01F49544C0448DBE3A27f768F2b34';
const srUSD = '0x738d1115B90efa71AE468F1287fc864775e23a31';
const termIssuer = '0x128D86A9e854a709Df06b884f81EeE7240F6cCf7';

const tvl = async (api) => {

const trUSDTotalDebt = await api.call({ target: termIssuer, abi: 'function totalDebt() external view returns (uint256)' });

api.add(ADDRESSES['ethereum'].USDC, trUSDTotalDebt / 1e12);

const rUSDTotalSupply = await api.call({ target: rUSD, abi: 'function totalSupply() external view returns (uint256)' });

api.add(ADDRESSES['ethereum'].USDC, rUSDTotalSupply / 1e12);

const srUSDTotalSupply = await api.call({ target: srUSD, abi: 'function totalSupply() external view returns (uint256)' });

api.add(ADDRESSES['ethereum'].USDC, srUSDTotalSupply / 1e12);
}

module.exports = {
ethereum: { tvl }
};
Loading