Skip to content

Commit 684870c

Browse files
Tendows123testg1nt0ki
authored
Add project fufuture. Fufuture project is the world's first decentralized currency standard Perpetual options Transaction agreement. (DefiLlama#9697)
* Add fufuture project.The world's first decentralized currency standard Perpetual options Transaction agreement * feat:Add fufuture project.The world's first decentralized currency standard Perpetual options Transaction agreement. * code refactor --------- Co-authored-by: test <[email protected]> Co-authored-by: g1nt0ki <[email protected]>
1 parent 2ef981e commit 684870c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

projects/fufuture/index.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
const { getLogs2, getAddress, } = require('../helper/cache/getLogs');
2+
const { sumTokens2 } = require('../helper/unwrapLPs');
3+
4+
async function tvl(api) {
5+
const { factory, fromBlock, optionsTrade } = config[api.chain]
6+
const privateLogs = await getLogs2({ api, factory, fromBlock, extraKey: 'private-pool', topics: ['0x321e5276dc2982b3e95825088a15cf891d1f691c70b6236b506afa3810ec0297'] })
7+
const publicLogs = await getLogs2({ api, factory, fromBlock, extraKey: 'public-pool', topics: ['0x53aad570e9fba02f275a68e410f634e241c8301d036a94761d71bcba65941a36'] })
8+
const logs = privateLogs.concat(publicLogs)
9+
const ownerTokens = []
10+
const allTokens = []
11+
logs.forEach(({ topics }) => {
12+
const token = getAddress(topics[2])
13+
const pool = getAddress(topics[3])
14+
ownerTokens.push([[token], pool])
15+
allTokens.push(token)
16+
})
17+
ownerTokens.push([allTokens, optionsTrade])
18+
return sumTokens2({ api, ownerTokens, permitFailure: true })
19+
}
20+
21+
module.exports = {
22+
methodology: "The world's first decentralized currency standard Perpetual options Transaction agreement",
23+
};
24+
25+
const config = {
26+
bsc: { factory: '0x0CB5274a8Ff86b7b750933B09aba8B5eb3660977', fromBlock: 33366630, optionsTrade: '0x1e933E0957e6236E519e64CD13f967146Fcb4755' },
27+
arbitrum: { factory: '0x0CB5274a8Ff86b7b750933B09aba8B5eb3660977', fromBlock: 162984841, optionsTrade: '0x1e933E0957e6236E519e64CD13f967146Fcb4755' },
28+
}
29+
30+
Object.keys(config).forEach(chain => {
31+
module.exports[chain] = { tvl }
32+
})

0 commit comments

Comments
 (0)