Skip to content

Commit

Permalink
Merge pull request #242 from astroKo/interport-fix
Browse files Browse the repository at this point in the history
interport_finance : bridge : tvl by user
  • Loading branch information
0xroll authored Jun 28, 2024
2 parents a87e2fb + 3318832 commit 8814543
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
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

0 comments on commit 8814543

Please sign in to comment.