Skip to content

Commit

Permalink
code refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Jan 20, 2025
1 parent dcaee61 commit cadd763
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
13 changes: 7 additions & 6 deletions projects/ekubo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ const { getConfig } = require('../helper/cache')
const market = '0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b'

async function tvl(api) {
const tokens = await getConfig('ekubo', "https://mainnet-api.ekubo.org/tokens")
return sumTokens({ api, owner: market, tokens: tokens.map(t=>t.l2_token_address) })
const tokens = await getConfig('ekubo', "https://mainnet-api.ekubo.org/tokens")
return sumTokens({ api, owner: market, tokens: tokens.map(t => t.l2_token_address) })
}

module.exports = {
methodology: 'Value of LP in the DEX, includes LPs that are out of range and thus not providing active liquidity',
starknet: {
tvl
},
methodology: 'Value of LP in the DEX, includes LPs that are out of range and thus not providing active liquidity',
starknet: {
tvl
},
isHeavyProtocol: true,
}
2 changes: 1 addition & 1 deletion projects/helper/chain/starknet.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async function multiCall({ abi: rootAbi, target: rootTarget, calls = [], allAbi
const allData = []
const chunks = sliceIntoChunks(callBodies, 25)
for (const chunk of chunks) {
await sleep(2000)
await sleep(200)
const { data } = await axios.post(STARKNET_RPC, chunk)
allData.push(...data)
}
Expand Down
1 change: 1 addition & 0 deletions projects/jediswap-v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ async function tvl(api) {

module.exports = {
timetravel: false,
isHeavyProtocol: true,
starknet: {
tvl,
}
Expand Down
1 change: 1 addition & 0 deletions projects/jediswap/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ async function tvl() {

module.exports = {
timetravel: false,
isHeavyProtocol: true,
starknet: {
tvl,
}
Expand Down
1 change: 1 addition & 0 deletions projects/sithswap/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ async function tvl() {

module.exports = {
timetravel: false,
isHeavyProtocol: true,
starknet: {
tvl,
}
Expand Down
1 change: 1 addition & 0 deletions projects/starkdefi/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ async function tvl() {
module.exports = {
timetravel: false,
methodology: "Value of all LP available in the DEX",
isHeavyProtocol: true,
starknet: {
tvl,
},
Expand Down

0 comments on commit cadd763

Please sign in to comment.