Skip to content

Commit

Permalink
Add Umoja TVL. (#11075)
Browse files Browse the repository at this point in the history
* Add Umoja TVL

* Update PR to include TVL from API.
  • Loading branch information
DarkRoku12 authored Aug 8, 2024
1 parent d21c89d commit d6dc498
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions projects/umoja/index.js
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 ) ) );
}
}
}
};

0 comments on commit d6dc498

Please sign in to comment.