From bd2f7a615a439feb6de31c5333736cfae1753b72 Mon Sep 17 00:00:00 2001 From: g1nt0ki <99907941+g1nt0ki@users.noreply.github.com> Date: Mon, 4 Mar 2024 17:08:14 +0100 Subject: [PATCH] track filecoin tvl --- projects/uniswap/index.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/projects/uniswap/index.js b/projects/uniswap/index.js index 814e57d0830f..4792640c83b2 100644 --- a/projects/uniswap/index.js +++ b/projects/uniswap/index.js @@ -42,6 +42,24 @@ function v3TvlPaged(chain) { } } +async function filecoinTvl(_, _b, _cb, { api, }) { + const { result: { pools } } = await configPost('oku-trade/filecoin', 'https://cush.apiary.software/filecoin', { + "jsonrpc": "2.0", + "method": "cush_topPools", + "params": [ + { + "result_size": 1000, + "sort_by": "tx_count", + "sort_order": false + } + ], + "id": 0 + }) + const ownerTokens = pools.map(i => [[i.t0, i.t1], i.address]) + return api.sumTokens({ ownerTokens }) +} + + module.exports = { methodology: `Counts the tokens locked on AMM pools, pulling the data from the 'ianlapham/uniswapv2' subgraph`, timetravel: false, @@ -60,9 +78,10 @@ module.exports = { moonbeam: { factory: '0x28f1158795a3585caaa3cd6469cd65382b89bb70', fromBlock: 4313505 }, era: { factory: '0x8FdA5a7a8dCA67BBcDd10F02Fa0649A937215422', fromBlock: 12637080 }, boba: { factory: "0xFFCd7Aed9C627E82A765c3247d562239507f6f1B", fromBlock: 969351, }, - rsk: { factory: "0xAf37Ec98A00fD63689cF3060Bf3b6784e00CaD82", fromBlock: 5829207, }, + rsk: { factory: "0xAf37Ec98A00fD63689cF3060Bf3b6784e00CaD82", fromBlock: 5829207, }, scroll: { factory: "0x70C62C8b8e801124A4Aa81ce07b637A3e83cb919", fromBlock: 1367, }, - }) + }), + filecoin: { tvl: filecoinTvl }, } const chains = ['ethereum', 'arbitrum', 'optimism', 'polygon', 'bsc', 'avax', 'base']