Skip to content

Commit

Permalink
Added tickers to Sailing Protocol and commented out failing ticker (D…
Browse files Browse the repository at this point in the history
…efiLlama#9882)

* added new tickers

* parallelized execution
  • Loading branch information
nicoszerman authored Apr 18, 2024
1 parent f9c3e0b commit 85533a9
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions projects/sailingprotocol/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,30 @@ const tokens = [
"ticker": "QQQ",
"sufficientLiquidityForDefiLlamaIndexer": false,
},
// {
// "address": "0xBa5c32915e2303EA41d1986f5B3AAd0a98B4Fd80",
// "ticker": "ETHE",
// "sufficientLiquidityForDefiLlamaIndexer": false,
// },
{
"address": "0xBa5c32915e2303EA41d1986f5B3AAd0a98B4Fd80",
"ticker": "ETHE",
"address": "0xA78Fb2b64Ce2Fb8bBe46968cf961C5Be6eB12924",
"ticker": "AAAU",
"sufficientLiquidityForDefiLlamaIndexer": false,
},
{
"address": "0xA78Fb2b64Ce2Fb8bBe46968cf961C5Be6eB12924",
"ticker": "AAAU",
"address": "0x79E2174f64286Bb92c8BD00d0D8A126eAc664c27",
"ticker": "ABNB",
"sufficientLiquidityForDefiLlamaIndexer": false,
},
{
"address": "0x1e01aE049Bcb76ec91aa59e11b84a01375cB19b0",
"ticker": "DNA",
"sufficientLiquidityForDefiLlamaIndexer": false,
},
];

async function tvl(api) {
for (const token of tokens) {
const addTokenTVL = async (token) => {
const tokenTotalSupply = await api.call({ target: token.address, abi: 'erc20:totalSupply' });
if (token.sufficientLiquidityForDefiLlamaIndexer) {
api.add(token.address, tokenTotalSupply);
Expand All @@ -98,7 +108,12 @@ async function tvl(api) {
tokenTotalSupply * tickerPrice * (1e6 / 1e18)
);
}
};
const promises = [];
for (const token of tokens) {
promises.push(addTokenTVL(token));
}
await Promise.all(promises);
}

module.exports = {
Expand Down

0 comments on commit 85533a9

Please sign in to comment.