-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Umoja TVL * Update PR to include TVL from API.
- Loading branch information
1 parent
d21c89d
commit d6dc498
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const Address = require( "../helper/coreAssets.json" ); | ||
const Http = require( "../helper/http" ); | ||
|
||
const UMOJA_SYNTH_POOL = "0x7ba46133E8D6075af638ffDc9472AcCFEFb27A2b"; | ||
|
||
module.exports = { | ||
arbitrum: { | ||
tvl: async function ( api ) | ||
{ | ||
const tvl_map = { | ||
[Address.arbitrum.USDC_CIRCLE]: { amount: 0, decimals: 6 } | ||
}; | ||
|
||
const data = await Http.get( "https://api.protocol.umoja.xyz/tokens/tvl/d-llama" ); | ||
|
||
for ( const entry of data ) | ||
{ | ||
if ( entry.currency == "USDC" ) tvl_map[Address.arbitrum.USDC_CIRCLE].amount = entry.tvl; | ||
} | ||
|
||
for ( const key in tvl_map ) | ||
{ | ||
const entry = tvl_map[key]; | ||
const amount = entry.amount * Math.pow( 10, entry.decimals ); | ||
api.add( key, BigInt( Math.trunc( amount ) ) ); | ||
} | ||
} | ||
} | ||
}; |