Skip to content

Commit

Permalink
track soneium
Browse files Browse the repository at this point in the history
  • Loading branch information
g1nt0ki committed Jan 14, 2025
1 parent 5f12e5e commit 5efbb4e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
1 change: 1 addition & 0 deletions projects/dyorswap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const config = {
bob: '0x2CcaDb1e437AA9cDc741574bDa154686B1F04C09',
ink: '0x6c86ab200661512fDBd27Da4Bb87dF15609A2806',
sonic: '0xd8863d794520285185197F97215c8B8AD04E8815',
soneium: '0x4f0c1b4c6FdF983f2d385Cf24DcbC8c68f345E40',
}

module.exports = {
Expand Down
1 change: 1 addition & 0 deletions projects/helper/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
"smartbch",
"solana",
"sommelier",
"soneium",
"songbird",
"sonic",
"sophon",
Expand Down
4 changes: 3 additions & 1 deletion projects/helper/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const DEFAULTS = {
ANKR_API_KEY: '79258ce7f7ee046decc3b5292a24eb4bf7c910d7e39b691384c7ce0cfb839a01',
RENEC_RPC: "https://api-mainnet-beta.renec.foundation:8899/",
RPC_PROXY_URL: "https://rpc-proxy.llama.fi",
FLOW_RPC: "https://mainnet.evm.nodes.onflow.org"
FLOW_RPC: "https://mainnet.evm.nodes.onflow.org",
SONEIUM_RPC: "https://rpc.soneium.org",
SONEIUM_RPC_MULTICALL: "0xcA11bde05977b3631167028862bE2a173976CA11",
}

const ENV_KEYS = [
Expand Down
9 changes: 8 additions & 1 deletion projects/helper/tokenMapping.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ const fixBalancesTokens = {
wc: {
[ADDRESSES.null]: { coingeckoId: 'ethereum', decimals: 18 },
},
soneium: {
[ADDRESSES.null]: { coingeckoId: 'ethereum', decimals: 18 },
[ADDRESSES.optimism.WETH_1]: { coingeckoId: 'ethereum', decimals: 18 },
'0xbA9986D2381edf1DA03B0B9c1f8b00dc4AacC369': { coingeckoId: 'usd-coin', decimals: 6 },
'0x3A337a6adA9d885b6Ad95ec48F9b75f197b5AE35': { coingeckoId: 'tether', decimals: 6 },
'0x2cae934a1e84f693fbb78ca5ed3b0a6893259441': { coingeckoId: 'astar', decimals: 18 },
},
odyssey: {
[ADDRESSES.null]: { coingeckoId: 'dione', decimals: 18 },
'0xf21cbaf7bd040d686bd390957770d2ea652e4013': { coingeckoId: 'dione', decimals: 18 },
Expand Down Expand Up @@ -125,7 +132,7 @@ const fixBalancesTokens = {
starknet: {
'0x20ff2f6021ada9edbceaf31b96f9f67b746662a6e6b2bc9d30c0d3e290a71f6': { coingeckoId: 'spiko-us-t-bills-money-market-fund', decimals: 5 },
'0x4f5e0de717daa6aa8de63b1bf2e8d7823ec5b21a88461b1519d9dbc956fb7f2': { coingeckoId: 'eutbl', decimals: 5 },
}
},
}

ibcChains.forEach(chain => fixBalancesTokens[chain] = { ...ibcMappings, ...(fixBalancesTokens[chain] || {}) })
Expand Down
5 changes: 5 additions & 0 deletions projects/kyo-fi-v3/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const { uniV3Export } = require('../helper/uniswapV3')

module.exports = uniV3Export({
soneium: { factory: '0x137841043180BBA8EF52828F9030D1b7fE065F95', fromBlock: 1 },
})
5 changes: 1 addition & 4 deletions projects/treasury/maxapy.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const VAULTS = {

const tvl = async (api) => {
const vaults = Object.values(VAULTS[api.chain])
const tokens = await api.multiCall({ abi: 'address:asset', calls: vaults })
const balances = await api.multiCall({ abi: 'erc20:balanceOf', calls: vaults.map(vault => ({ target: vault, params: TREASURY[api.chain] })) })
const bals = await api.multiCall({ abi: 'function convertToAssets(uint256) view returns (uint256)', calls: vaults.map((vault, i) => ({ target: vault, params: balances[i] })) })
api.add(tokens, bals)
return api.sumTokens({ owner: TREASURY[api.chain], tokens: vaults })
}

module.exports = {
Expand Down

0 comments on commit 5efbb4e

Please sign in to comment.