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

interport_finance : bridge : tvl by user #242

Merged
merged 2 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions adapters/interport/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const getUserTVLByBlock = async (
const holders = await getAllHolders(blockNumber);

for (let i = 0; i < vaultsAddresses.length; i++) {
const {address, token_symbol} = vaultsAddresses[i];
const {address, underlying_symbol, underlying} = vaultsAddresses[i];
const balanceReads: any[] = [];
const farmReads: any[] = [];

Expand Down Expand Up @@ -100,8 +100,8 @@ export const getUserTVLByBlock = async (
block_number: blockNumber,
timestamp: blockTimestamp,
user_address: Array.from(holders)[j].toLowerCase(),
token_address: address.toLowerCase(),
token_symbol: token_symbol,
token_address: underlying.toLowerCase(),
token_symbol: underlying_symbol,
token_balance: userBalance + farmBalance,
usd_price: 0,
});
Expand Down
8 changes: 5 additions & 3 deletions adapters/interport/src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ export const iUSDC = '0x5b45B414c6CD2a3341bE70Ba22BE786b0124003F'
export const stablecoinFarmAddress = "0x29d44c17f4f83b3c77ae2eac4bc1468a496e3196";
export const zeroAddress = "0x0000000000000000000000000000000000000000";

export const vaultsAddresses: { address: `0x${string}`, token_symbol: string, start_block: bigint }[] = [
type Address = `0x${string}`;

export const vaultsAddresses: { address: Address, underlying_symbol: string, start_block: bigint, underlying: Address }[] = [
{
address: iUSDT, token_symbol: "iUSDC", start_block: 3041467n
address: iUSDT, underlying_symbol: "USDC", start_block: 3041467n, underlying: "0xa219439258ca9da29e9cc4ce5596924745e12b93"
},
{
address: iUSDC, token_symbol: "iUSDT", start_block: 3041467n
address: iUSDC, underlying_symbol: "USDT", start_block: 3041467n, underlying: "0x176211869ca2b568f2a7d4ee941e073a821ee1ff"
}
];

Expand Down
Loading