From a357fc0f4ca7d777857395b8af81874ed3bcd82e Mon Sep 17 00:00:00 2001 From: 0xngmi <0xngmi@protonmail.com> Date: Tue, 17 Oct 2023 05:01:11 +0100 Subject: [PATCH] add superrare --- projects/superrare/index.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 projects/superrare/index.js diff --git a/projects/superrare/index.js b/projects/superrare/index.js new file mode 100644 index 000000000000..6d7a16498b63 --- /dev/null +++ b/projects/superrare/index.js @@ -0,0 +1,22 @@ +const { request, gql } = require("graphql-request"); + +async function staking(_time, block){ + const query = gql`query AllRareLocked ($block: Int) { + pools(first: 1000, block: { number: $block }) { + totalRareLocked + } + }` + const result = await request("https://gateway-arbitrum.network.thegraph.com/api/5fba66cce34542163f90501c363f99e8/subgraphs/id/Cc4fyxiBkZYdzATQDhTv3zLzfEwRupygp7HB2WWQciw5", query, { + block, + }); + return { + "0xba5BDe662c17e2aDFF1075610382B9B691296350": result.pools.reduce((sum, a)=>sum+Number(a.totalRareLocked), 0) + } +} + +module.exports={ + ethereum:{ + staking, + tvl: async()=>({}) + } +} \ No newline at end of file