Skip to content

Commit

Permalink
joltify: exclude borrowed
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Jun 14, 2024
1 parent 44879a3 commit a730591
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions projects/joltify-rwa/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@ const tvl = async (api) => {
queryV1Beta1({ chain, url: `spv/list_pools` }),
]);

const [price_info] = await Promise.all([
queryV1Beta1({ chain, url: `third_party/pricefeed/v1beta1/prices` }),
]);

pools.pools_info.forEach(async pool => {
const [market, borrowed_denom] = pool.borrowed_amount.denom.split('-');
const market_id = `${market}:usd`;
const price = price_info.prices.find(price => price.market_id === market_id)?.price;
api.add(borrowed_denom, pool.borrowed_amount.amount * price);
api.add(pool.usable_amount.denom, pool.usable_amount.amount);
api.add(pool.escrow_principal_amount.denom, pool.escrow_principal_amount.amount);
api.add(pool.escrow_principal_amount.denom, pool.escrow_interest_amount);
Expand Down

0 comments on commit a730591

Please sign in to comment.