Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DeltaPrime (outdated) #11663

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions projects/deltaprime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ async function tvlArbitrum(api) {
}

sdk.log(accounts.length)
const ownedAssets = await api.multiCall({ abi: getAllOwnedAssetsAbi, calls: accounts, })
const ownedAssetss = await api.multiCall({ abi: getAllOwnedAssetsAbi, calls: accounts, permitFailure: true })
await addTraderJoeLPs({ api, accounts })

accounts.forEach((o, i) => {
ownedAssets[i].forEach(tokenStr => {
const ownedAssets = ownedAssetss[i]
if (!ownedAssets) return
ownedAssets.forEach(tokenStr => {
tokenStr = ethers.decodeBytes32String(tokenStr)
const token = assetToAddressMappingArbitrum[tokenStr]
if (!token) return;
Expand All @@ -144,9 +146,10 @@ async function tvlArbitrum(api) {

async function addTraderJoeLPs({ api, accounts }) {
const pairSet = new Set()
const bins = await api.multiCall({ abi: 'function getOwnedTraderJoeV2Bins() public view returns (tuple(address pair, uint24 bin)[])', calls: accounts })
const bins = await api.multiCall({ abi: 'function getOwnedTraderJoeV2Bins() public view returns (tuple(address pair, uint24 bin)[])', calls: accounts, permitFailure: true })
const calls = []
bins.forEach((res, i) => {
if (!res) return
const account = accounts[i]
res.forEach(({ pair, bin }) => {
pair = pair.toLowerCase()
Expand Down
Loading