Skip to content

Commit e80a0d4

Browse files
committed
fix broken adapters
1 parent f2922f2 commit e80a0d4

File tree

10 files changed

+27
-17
lines changed

10 files changed

+27
-17
lines changed

projects/blitzlabs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ module.exports = {
1919
tvl: async () => ({}),
2020
},
2121
methodology: "Counts liquidty on the staking and pool2s only",
22+
deadFrom: '2023-12-01',
2223
}

projects/bunni-v2/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Object.keys(config).forEach(chain => {
1515
const poolIds = logs.map(log => log.poolId)
1616
const token0s = await api.multiCall({ abi: 'address:token0', calls: bunnis })
1717
const token1s = await api.multiCall({ abi: 'address:token1', calls: bunnis })
18-
const balances = await api.multiCall({ abi: 'function poolBalances(bytes32) view returns (uint256 token0, uint256 token1)', calls: poolIds, target: factory })
18+
const balances = await api.multiCall({ abi: 'function poolBalances(bytes32) view returns (uint256 token0, uint256 token1)', calls: poolIds, target: factory, permitFailure: true })
1919

20-
const balances0 = balances.map(b => b.token0)
21-
const balances1 = balances.map(b => b.token1)
20+
const balances0 = balances.map(b => b?.token0 ?? 0)
21+
const balances1 = balances.map(b => b?.token1 ?? 0)
2222
api.add(token0s, balances0)
2323
api.add(token1s, balances1)
2424
}

projects/helper/chain/near.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ function sumSingleBalance(balances, token, balance) {
124124
}
125125

126126
async function sumTokens({ balances = {}, owners = [], tokens = []}) {
127+
tokens = tokens.filter(i => i !== 'aurora')
127128
await Promise.all(owners.map(i => addTokenBalances(tokens, i, balances)))
128129
const bals = await Promise.all(owners.map(view_account))
129130
const nearBalance = bals.reduce((a,i) => a + (i.amount/1e24), 0)

projects/helper/tokenMapping.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ const fixBalancesTokens = {
4242
ozone: {
4343
// '0x83048f0bf34feed8ced419455a4320a735a92e9d': { coingeckoId: "ozonechain", decimals: 18 }, // was mapped to wrong chain
4444
},
45+
eclipse: {
46+
'CEBP3CqAbW4zdZA57H2wfaSG1QNdzQ72GiQEbQXyW9Tm': { coingeckoId: 'tether', decimals: 6 },
47+
}
4548
}
4649

4750
ibcChains.forEach(chain => fixBalancesTokens[chain] = { ...ibcMappings, ...(fixBalancesTokens[chain] || {}) })

projects/kongswap/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ module.exports = {
66
}
77

88
async function tvl(api) {
9-
let { tvlUSD } = await get('https://api.kongswap.io/api/defillama/tvl')
10-
api.addCGToken('tether', Math.round(tvlUSD))
9+
let { total_tvl } = await get('https://api.kongswap.io/api/pools/totals')
10+
api.addCGToken('tether', Math.round(total_tvl))
1111
}

projects/solar-studios/index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
1+
const { getConfig } = require("../helper/cache");
12
const { getProvider, sumTokens2 } = require("../helper/solana");
23
const { Program, } = require("@project-serum/anchor");
34

45

56
async function tvl(api) {
67

7-
const provider = getProvider(api.chain)
8+
/* const provider = getProvider(api.chain)
89
const programId = 'sooGfQwJ6enHfLTPfasFZtFR7DgobkJD77maDNEqGkD'
910
const idl = await Program.fetchIdl(programId, provider)
1011
const program = new Program(idl, programId, provider)
1112
const data = await program.account.poolState.all()
1213
const tokenAccounts = data.map(({ account: { token0Vault, token1Vault }}) => ([token0Vault, token1Vault,])).flat()
13-
return sumTokens2({ tokenAccounts, api, })
14+
return sumTokens2({ tokenAccounts, api, }) */
15+
const { data} = await getConfig('solar-studios-tvl', 'https://api.solarstudios.co/pools/info/list?poolType=all&poolSortField=liquidity&sortType=desc&pageSize=1000&page=1')
16+
const tokensAndOwners = []
17+
data.data.map(i => {
18+
tokensAndOwners.push([i.mintA.address, i.id])
19+
tokensAndOwners.push([i.mintB.address, i.id])
20+
})
21+
return sumTokens2({ tokensAndOwners, api, })
1422
}
1523

1624
module.exports = {

projects/tonic/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ async function tvl() {
2929
let listedTokensPerps = (await call(PERPS_CONTRACT, GET_ASSETS_METHOD, {}))
3030
.filter(asset => asset.id !== NATIVE_NEAR)
3131
.map(asset => asset.id);
32-
balances = await addTokenBalances(listedTokensPerps, PERPS_CONTRACT, balances);
32+
balances = await addTokenBalances(listedTokensPerps.filter(i => i !== 'aurora'), PERPS_CONTRACT, balances);
3333
const perps_contract_state = await view_account(PERPS_CONTRACT);
3434
sumSingleBalance(balances, FT_NEAR, perps_contract_state['amount']);
3535
return balances;

projects/tutellus/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
const { get } = require('../helper/http')
1+
const { staking } = require('../helper/staking')
22

33
module.exports = {
44
polygon: {
55
tvl: () => ({}),
6-
staking: tvl,
6+
staking: staking('0xc7963fb87c365f67247f97d329d50b9ec5a374b8', '0x12a34A6759c871C4C1E8A0A42CFc97e4D7Aaf68d'),
77
},
88
timetravel: false,
99
methodology: "Counts the number of TUT tokens locked in Tutellus contracts.",
1010
}
1111

12-
async function tvl(api) {
13-
const endpoint = 'https://backend.tutellus.io/api'
14-
const data = await get(endpoint + `/tvl`, { data: { id: 1, jsonrpc: "2.0", method: "invokefunction", }});
15-
api.add('0x12a34A6759c871C4C1E8A0A42CFc97e4D7Aaf68d', data.bigNumber);
16-
}

projects/universeftm/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@ module.exports = masterchefExports({
44
chain: 'fantom',
55
nativeToken: '0xf346362004540F714a45c6E80c719767e087a649',
66
masterchef: '0x5b996C1F5bc7Ba09fB8d69FBB1c495f0a9D6b7D9',
7-
})
7+
})
8+
9+
module.exports.deadFrom = '2022-04-01'

projects/veax/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const { sumTokens, call, } = require('../helper/chain/near')
33
const tvl = async (api) => {
44
const contract = 'veax.near'
55
const tokens = await call(contract, 'get_verified_tokens')
6-
return sumTokens({ owners: [contract], tokens})
6+
return sumTokens({ owners: [contract], tokens: tokens.filter(i => i !== 'aurora')})
77
}
88

99
module.exports = {

0 commit comments

Comments
 (0)