Skip to content

Commit f2922f2

Browse files
committed
fix broken adapters
1 parent 9b4a71f commit f2922f2

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

projects/dojoswap/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ const factory = {
66

77
async function staking() {
88

9-
/// POOLS
9+
return {}
10+
/* /// POOLS
1011
const response = await fetch('https://analytics.dojo.trading/dashboard/pools/tvl');
1112
const data = await response.json();
1213
const keys = Object.keys(data);
1314
const tvl = keys.reduce((tvl, key) => tvl + data[key].tvl, 0);
1415
1516
return {
1617
tether: tvl
17-
}
18+
} */
1819
}
1920

2021
module.exports = {

projects/helper/chain/sui.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ async function queryEventsByType({ eventType, transform = i => i }) {
164164
hasNextPage
165165
}
166166
nodes {
167-
json
167+
contents {
168+
json
169+
}
168170
}
169171
}
170172
}`
@@ -173,7 +175,7 @@ async function queryEventsByType({ eventType, transform = i => i }) {
173175
do {
174176
const { events: { pageInfo: { endCursor, hasNextPage}, nodes } } = await sdk.graph.request(graphEndpoint(), query, {variables: { after, eventType}})
175177
after = hasNextPage ? endCursor : null
176-
items.push(...nodes.map(i => i.json).map(transform))
178+
items.push(...nodes.map(i => i.contents.json).map(transform))
177179
} while (after)
178180
return items
179181
}

projects/suimarket/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ async function tvl(api) {
1313
}
1414

1515
module.exports = {
16+
// deadFrom: '2025-04-01',
1617
timetravel: false,
1718
sui: {
1819
tvl

projects/swaylend/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,25 @@ const markets = [
66
'0x657ab45a6eb98a4893a99fd104347179151e8b3828fd8f2a108cc09770d1ebae', // USDC market
77
]
88
async function tvl(api) {
9-
return sumTokens({ api, owners: markets, })
9+
return sumTokens({ api, owners: markets, })
1010
}
1111

1212
async function borrowed(api) {
13-
const abi = await getConfig('swaylend/abi', undefined,{
13+
const abi = await getConfig('swaylend/abi', undefined, {
1414
fetcher: async () => {
1515
let data = await get('https://raw.githubusercontent.com/Swaylend/swaylend-monorepo/refs/heads/develop/apps/frontend/src/contract-types/Market.ts')
1616
data = data.split('const abi =')[1].split(';')[0]
1717
return JSON.parse(data) // ensure that this doesnt fail
1818
// return data
1919
}
2020
})
21+
const whitelistedFunctions = new Set(['get_market_configuration', 'get_market_basics'])
22+
abi.functions = abi.functions.filter(i => whitelistedFunctions.has(i.name))
23+
abi.loggedTypes = []
2124
for (const market of markets) {
2225
const { base_token } = await query({ contractId: market, abi, method: 'get_market_configuration' })
23-
const { total_borrow_base }= await query({ contractId: market, abi, method: 'get_market_basics' })
24-
api.add(base_token.bits, +total_borrow_base )
26+
const { total_borrow_base } = await query({ contractId: market, abi, method: 'get_market_basics' })
27+
api.add(base_token.bits, +total_borrow_base)
2528
}
2629
}
2730

projects/witty/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
const ADDRESSES = require('../helper/coreAssets.json')
13
const { getLogs2 } = require('../helper/cache/getLogs')
24
const { sumTokens2 } = require('../helper/unwrapLPs')
35
const { getUniqueAddresses } = require('../helper/utils')
@@ -7,7 +9,7 @@ const abi = {
79
}
810

911
const config = {
10-
abstract: { arcade: '0x0b4429576e5eD44a1B8f676c8217eb45707AFa3D', fromBlock: 447140, },
12+
abstract: { arcade: '0x0b4429576e5eD44a1B8f676c8217eb45707AFa3D', fromBlock: 6490616, },
1113
}
1214

1315
function customCacheFunction({ cache, logs }) {
@@ -21,6 +23,7 @@ function customCacheFunction({ cache, logs }) {
2123
async function tvl(api) {
2224
const { arcade, fromBlock } = config[api.chain]
2325
const tokens = await getLogs2({ api, factory: arcade, eventAbi: abi.depositEvent, fromBlock, extraKey: 'deposit-address', customCacheFunction,})
26+
tokens.push(ADDRESSES.abstract.WETH, ADDRESSES.abstract.USDC)
2427
return sumTokens2({ api, owner: arcade, tokens, permitFailure: true })
2528
}
2629

0 commit comments

Comments
 (0)