From ae987960548d3e574de12ee69421e69224b1b4ba Mon Sep 17 00:00:00 2001 From: "Web3.World" <165679484+web3world@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:05:13 +0400 Subject: [PATCH] add web3world tvl (#9668) --- projects/helper/chains.json | 1 + projects/web3world/index.js | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 projects/web3world/index.js diff --git a/projects/helper/chains.json b/projects/helper/chains.json index 36034c8f6fb4..59733c054331 100644 --- a/projects/helper/chains.json +++ b/projects/helper/chains.json @@ -280,6 +280,7 @@ "umee", "vechain", "velas", + "venom", "vision", "vite", "vive", diff --git a/projects/web3world/index.js b/projects/web3world/index.js new file mode 100644 index 000000000000..d8032383da70 --- /dev/null +++ b/projects/web3world/index.js @@ -0,0 +1,22 @@ +const { post } = require('../helper/http') +const BigNumber = require('bignumber.js') + +async function fetch() { + const tvl = (await post("https://api.web3.world/v2/pools", { + limit: 1000, + offset: 0, + ordering: "tvldescending", + whiteListUri: "https://static.web3.world/assets/manifest.json", + }) + ).pools.map(p => p.tvl).reduce( + (a, c) => new BigNumber(a).plus(c)); + + return tvl; +} + +module.exports = { + venom: { + fetch + }, + fetch +};