Skip to content

Commit

Permalink
Merge pull request #215 from dappradar/instadapp-logging
Browse files Browse the repository at this point in the history
Instadapp logging
  • Loading branch information
mantasfam authored Oct 2, 2023
2 parents ea23bca + cbaa679 commit d934f06
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/factory/providers/ethereum/instadapp/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import BigNumber from 'bignumber.js';
import { ITvlParams, ITvlReturn } from '../../../../interfaces/ITvl';
import fetch from 'node-fetch';
import { log } from '../../../../util/logger/logger';

const API =
'https://api.internal.instadapp.io/defi/api/stats/instadapp/overall';
Expand All @@ -13,6 +14,11 @@ async function tvl(params: ITvlParams): Promise<Partial<ITvlReturn>> {

const balances = {};

const response = await fetch(API);
log.info({
message: await response.text(),
endpoint: 'instadapp.tvl',
});
balances['0xdac17f958d2ee523a2206206994597c13d831ec7'] = await fetch(API)
.then((res) => res.json())
.then((res) => BigNumber(res.stats[0].totalSupplied).shiftedBy(6));
Expand Down

0 comments on commit d934f06

Please sign in to comment.