Skip to content

Commit 2e3adaf

Browse files
waynebruce0xtestg1nt0kiYour NameTendows123
authored
Tendows123/main (#17040)
Co-authored-by: test <[email protected]> Co-authored-by: g1nt0ki <[email protected]> Co-authored-by: Your Name <[email protected]> Co-authored-by: Tendows123 <[email protected]>
1 parent 2e0b4d4 commit 2e3adaf

File tree

3 files changed

+145
-1
lines changed

3 files changed

+145
-1
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
const {getLogs2, getAddress,} = require('../helper/cache/getLogs');
2+
const {sumTokens2} = require('../helper/unwrapLPs');
3+
4+
5+
async function tvl(api) {
6+
const {factory, fromBlock} = config[api.chain]
7+
const privateLogs = await getLogs2({
8+
api,
9+
factory,
10+
fromBlock,
11+
extraKey: 'private-pool',
12+
topics: ['0xe34d8fa001b04475d221b96a007a245b5ce7381c8fa9a9bf4b8fb5ffecbca93e']
13+
})
14+
15+
const logs = privateLogs
16+
const ownerTokens = []
17+
const allTokens = []
18+
logs.forEach(({topics}) => {
19+
const token = getAddress(topics[2])
20+
const pool = getAddress(topics[4])
21+
ownerTokens.push([[token], pool])
22+
allTokens.push(token)
23+
})
24+
ownerTokens.push([allTokens, factory])
25+
return sumTokens2({api, ownerTokens, permitFailure: true})
26+
}
27+
28+
module.exports = {
29+
methodology: "The world's first decentralized currency standard Perpetual options Transaction agreement",
30+
};
31+
32+
const config = {
33+
bsc: {
34+
factory: '0x2eA66eF91bF4CeBf05BbfaF0A4d623d70774a95B',
35+
fromBlock: 59530857,
36+
},
37+
base: {
38+
factory: '0x252d96aF69670968Ed130A3FFe1Eb7E05721eb49',
39+
fromBlock: 34843871,
40+
},
41+
conflux:{
42+
factory: '0xb3C0F0330A06dB0587eF4A6A283A1f117203871c',
43+
fromBlock: 129718800,
44+
},
45+
// eni:{
46+
// factory: '0x09cD4951c43D609Ce01E8A05816537bB17eb1788',
47+
// fromBlock: 10830841,
48+
// },
49+
// xlayer:{
50+
// factory: '0x09cD4951c43D609Ce01E8A05816537bB17eb1788',
51+
// fromBlock: 42950554,
52+
// },
53+
// pharos:{
54+
// factory: '0x625D25bc601d92F77e321848f4e937c19F79f6c9',
55+
// fromBlock: 3078868,
56+
// }
57+
}
58+
59+
Object.keys(config).forEach(chain => {
60+
module.exports[chain] = {tvl}
61+
})

projects/fufuture-v2/index.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
const {getLogs2, getAddress,} = require('../helper/cache/getLogs');
2+
const {sumTokens2} = require('../helper/unwrapLPs');
3+
4+
5+
async function tvl(api) {
6+
const {factory, fromBlock, optionsTrade} = config[api.chain]
7+
const privateLogs = await getLogs2({
8+
api,
9+
factory,
10+
fromBlock,
11+
extraKey: 'private-pool',
12+
topics: ['0x321e5276dc2982b3e95825088a15cf891d1f691c70b6236b506afa3810ec0297']
13+
})
14+
const publicLogs = await getLogs2({
15+
api,
16+
factory,
17+
fromBlock,
18+
extraKey: 'public-pool',
19+
topics: ['0x53aad570e9fba02f275a68e410f634e241c8301d036a94761d71bcba65941a36']
20+
})
21+
const logs = privateLogs.concat(publicLogs)
22+
const ownerTokens = []
23+
const allTokens = []
24+
logs.forEach(({topics}) => {
25+
const token = getAddress(topics[2])
26+
const pool = getAddress(topics[3])
27+
ownerTokens.push([[token], pool])
28+
allTokens.push(token)
29+
})
30+
ownerTokens.push([allTokens, optionsTrade])
31+
return sumTokens2({api, ownerTokens, permitFailure: true})
32+
}
33+
34+
module.exports = {
35+
methodology: "The world's first decentralized currency standard Perpetual options Transaction agreement",
36+
};
37+
38+
const config = {
39+
bsc: {
40+
factory: '0x88f29D34c9602130B21Be4E1EaBEB7797177f259',
41+
fromBlock: 46616446,
42+
optionsTrade: '0x4e10384e98F2f170E00bfB1C3363D6f108a9ee68'
43+
},
44+
acala:{
45+
factory: '0xec676347105e7e898e0d8e24f524989cbff23d55',
46+
fromBlock: 7253471,
47+
optionsTrade: '0x5e413ed5e35506488779c5188ea58628955c83b8'
48+
},
49+
// bitlayer:{
50+
// factory: '0xb711ba37fa74b99e70c27e82def0b15a50ac7a9e',
51+
// fromBlock: 4328431,
52+
// optionsTrade: '0x482390a90a49d17d119f5c7dfe5e5bedb149fd9d'
53+
// },
54+
op_bnb:{
55+
factory: '0x91ABFdd51c0959016c54AbDfb012E81Ef82008d1',
56+
fromBlock: 51301555,
57+
optionsTrade: '0x91e644C8Fd5d5B799e0D238F31D9b46a91b8Ca03'
58+
},
59+
// aia:{
60+
// factory: '0x0e1e15b77de5924650da76f9e1ae46b07f493aec',
61+
// fromBlock: 34771150,
62+
// optionsTrade: '0x599bcd62cfa06c7e566da0ce62b376d0359d4a24'
63+
// },
64+
base:{
65+
factory: '0x344d02cEBb36ABBA6e55A9cefC703A75cA09E4E0',
66+
fromBlock: 28996468,
67+
optionsTrade: '0x43F323AcA25b57182bDc87564410ea7056975265'
68+
},
69+
// avalanche:{
70+
// factory: '0x5874ee8e6e96bFB17212962537e5Bf359630a268',
71+
// fromBlock: 57296254,
72+
// optionsTrade: '0x344d02cEBb36ABBA6e55A9cefC703A75cA09E4E0'
73+
// },
74+
conflux:{
75+
factory: '0xdc8091d097ca47afbbcc1ec216f3c5c26c587d19',
76+
fromBlock: 117895905,
77+
optionsTrade: '0x34bfe094c1275026475d37df3bb63a8d0adbc558'
78+
}
79+
}
80+
81+
Object.keys(config).forEach(chain => {
82+
module.exports[chain] = {tvl}
83+
})

projects/fufuture/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ const config = {
2929

3030
Object.keys(config).forEach(chain => {
3131
module.exports[chain] = { tvl }
32-
})
32+
})

0 commit comments

Comments
 (0)