Skip to content

Commit

Permalink
Fix: Swaap-v2 (DefiLlama#10936)
Browse files Browse the repository at this point in the history
* fix swaap-v2 (permitFailure on arbitrum Chain)

* use permitFailure as optional option

---------

Co-authored-by: 0xpeluche <[email protected]>
  • Loading branch information
0xpeluche and 0xpeluche authored Jul 9, 2024
1 parent f69de8d commit 45b89d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions projects/helper/balancer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { sumTokens2 } = require('./unwrapLPs');
const { getLogs } = require('./cache/getLogs')

function onChainTvl(vault, fromBlock, { blacklistedTokens = [], preLogTokens = [], onlyUseExistingCache } = {}) {
function onChainTvl(vault, fromBlock, { blacklistedTokens = [], preLogTokens = [], onlyUseExistingCache, permitFailure } = {}) {
return async (api) => {
const logs = await getLogs({
api,
Expand Down Expand Up @@ -29,7 +29,7 @@ function onChainTvl(vault, fromBlock, { blacklistedTokens = [], preLogTokens = [
const pools = logs.map(i => i.poolAddress)
blacklistedTokens = [...blacklistedTokens, ...pools]

return sumTokens2({ api, owner: vault, tokens, blacklistedTokens, })
return sumTokens2({ api, owner: vault, tokens, blacklistedTokens, permitFailure })
}
}

Expand Down
6 changes: 3 additions & 3 deletions projects/swaap-v2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {onChainTvl} = require("../helper/balancer");
*/
const config = {
ethereum: { vault: '0xd315a9c38ec871068fec378e4ce78af528c76293', fromBlock: 17598578, },
arbitrum: { vault: '0xd315a9c38ec871068fec378e4ce78af528c76293', fromBlock: 137451745,},
arbitrum: { vault: '0xd315a9c38ec871068fec378e4ce78af528c76293', fromBlock: 137451745, permitFailure: true },
polygon: { vault: '0xd315a9c38ec871068fec378e4ce78af528c76293', fromBlock: 44520023,},
optimism: { vault: '0xd315a9c38ec871068fec378e4ce78af528c76293', fromBlock: 120693792, },
bsc: { vault: '0x03c01acae3d0173a93d819efdc832c7c4f153b06', fromBlock: 39148730,},
Expand All @@ -22,8 +22,8 @@ const config = {


Object.keys(config).forEach(chain => {
const { vault, fromBlock } = config[chain]
const { vault, fromBlock, permitFailure } = config[chain]
module.exports[chain] = {
tvl: onChainTvl(vault, fromBlock)
tvl: onChainTvl(vault, fromBlock, { permitFailure })
}
})

0 comments on commit 45b89d1

Please sign in to comment.