@paraswap/dex-lib 2.28.9-take-surplus.0 → 2.28.9-take-surplus.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/abi/RamsesV2StateMulticall.abi.json +891 -0
- package/build/abi/aerodrome/aerodrome-pool-factory.json +586 -0
- package/build/abi/algebra/AlgebraFactory-v1_1.abi.json +250 -0
- package/build/abi/api3-proxy.json +53 -0
- package/build/abi/api3-server-v1.json +463 -0
- package/build/abi/nomiswap-v2/nomiswap-v2-pool.json +773 -0
- package/build/abi/pancakeswap-v3/PancakeswapV3Factory.abi.json +300 -0
- package/build/abi/quick-perps/fast-price-events.json +70 -0
- package/build/abi/quick-perps/fast-price-feed.json +741 -0
- package/build/abi/quick-perps/reader.json +313 -0
- package/build/abi/quick-perps/vault-price-feed.json +323 -0
- package/build/abi/quick-perps/vault.json +1953 -0
- package/build/abi/quickPerps/fast-price-events.json +70 -0
- package/build/abi/quickPerps/fast-price-feed.json +748 -0
- package/build/abi/quickPerps/reader.json +313 -0
- package/build/abi/quickPerps/vault-price-feed.json +477 -0
- package/build/abi/quickPerps/vault.json +1953 -0
- package/build/abi/ramses-v2/RamsesV2Pool.abi.json +1599 -0
- package/build/abi/uniswap-v3/UniswapV3Factory.abi.json +148 -0
- package/build/abi/uniswap-v3/UniswapV3QuoterV2.abi.json +155 -0
- package/build/composed-event-subscriber.js +8 -2
- package/build/composed-event-subscriber.js.map +1 -1
- package/build/config.d.ts +0 -1
- package/build/config.js +75 -14
- package/build/config.js.map +1 -1
- package/build/constants.d.ts +2 -1
- package/build/constants.js +1 -0
- package/build/constants.js.map +1 -1
- package/build/dex/algebra/algebra-factory.d.ts +25 -0
- package/build/dex/algebra/algebra-factory.js +43 -0
- package/build/dex/algebra/algebra-factory.js.map +1 -0
- package/build/dex/algebra/algebra-pool-v1_1.d.ts +16 -2
- package/build/dex/algebra/algebra-pool-v1_1.js +166 -4
- package/build/dex/algebra/algebra-pool-v1_1.js.map +1 -1
- package/build/dex/algebra/algebra.d.ts +4 -1
- package/build/dex/algebra/algebra.js +42 -21
- package/build/dex/algebra/algebra.js.map +1 -1
- package/build/dex/algebra/config.js +1 -0
- package/build/dex/algebra/config.js.map +1 -1
- package/build/dex/algebra/lib/TickTable.js +51 -40
- package/build/dex/algebra/lib/TickTable.js.map +1 -1
- package/build/dex/algebra/types.d.ts +5 -2
- package/build/dex/algebra/utils.d.ts +3 -1
- package/build/dex/algebra/utils.js +59 -1
- package/build/dex/algebra/utils.js.map +1 -1
- package/build/dex/balancer-v2/balancer-v2.js +79 -6
- package/build/dex/balancer-v2/balancer-v2.js.map +1 -1
- package/build/dex/balancer-v2/config.js +10 -2
- package/build/dex/balancer-v2/config.js.map +1 -1
- package/build/dex/balancer-v2/optimizer.js +38 -51
- package/build/dex/balancer-v2/optimizer.js.map +1 -1
- package/build/dex/balancer-v2/types.d.ts +0 -4
- package/build/dex/balancer-v2/types.js.map +1 -1
- package/build/dex/curve-v1/config.js +40 -38
- package/build/dex/curve-v1/config.js.map +1 -1
- package/build/dex/curve-v1-factory/config.js +17 -9
- package/build/dex/curve-v1-factory/config.js.map +1 -1
- package/build/dex/curve-v1-factory/curve-v1-factory.d.ts +1 -1
- package/build/dex/curve-v1-factory/curve-v1-factory.js +205 -182
- package/build/dex/curve-v1-factory/curve-v1-factory.js.map +1 -1
- package/build/dex/curve-v1-factory/curve-v1-pool-manager.d.ts +2 -1
- package/build/dex/curve-v1-factory/curve-v1-pool-manager.js +8 -2
- package/build/dex/curve-v1-factory/curve-v1-pool-manager.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js +2 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_rates.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/_xp_mem.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js +61 -14
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/constants.js +10 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/constants.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_mem.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y.js.map +1 -1
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js +1 -0
- package/build/dex/curve-v1-factory/price-handlers/functions/get_y_D.js.map +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.js +11 -4
- package/build/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.js.map +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.d.ts +1 -1
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js +2 -2
- package/build/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.js.map +1 -1
- package/build/dex/curve-v1-factory/types.d.ts +4 -1
- package/build/dex/curve-v1-factory/types.js +1 -0
- package/build/dex/curve-v1-factory/types.js.map +1 -1
- package/build/dex/generic-rfq/generic-rfq.d.ts +2 -1
- package/build/dex/generic-rfq/generic-rfq.js +9 -5
- package/build/dex/generic-rfq/generic-rfq.js.map +1 -1
- package/build/dex/generic-rfq/rate-fetcher.d.ts +1 -1
- package/build/dex/generic-rfq/rate-fetcher.js +2 -1
- package/build/dex/generic-rfq/rate-fetcher.js.map +1 -1
- package/build/dex/generic-rfq/types.d.ts +1 -0
- package/build/dex/generic-rfq/types.js.map +1 -1
- package/build/dex/hashflow/hashflow.d.ts +1 -0
- package/build/dex/hashflow/hashflow.js +1 -0
- package/build/dex/hashflow/hashflow.js.map +1 -1
- package/build/dex/idex.d.ts +1 -0
- package/build/dex/index.d.ts +1 -0
- package/build/dex/index.js +21 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/maverick-v1/config.js +9 -0
- package/build/dex/maverick-v1/config.js.map +1 -1
- package/build/dex/maverick-v1/maverick-v1.js +11 -2
- package/build/dex/maverick-v1/maverick-v1.js.map +1 -1
- package/build/dex/maverick-v1/scripts/event-sequence.d.ts +1 -0
- package/build/dex/maverick-v1/scripts/event-sequence.js +110 -0
- package/build/dex/maverick-v1/scripts/event-sequence.js.map +1 -0
- package/build/dex/pancakeswap-v3/config.js +17 -0
- package/build/dex/pancakeswap-v3/config.js.map +1 -1
- package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.d.ts +26 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js +44 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3-factory.js.map +1 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3.d.ts +3 -0
- package/build/dex/pancakeswap-v3/pancakeswap-v3.js +26 -2
- package/build/dex/pancakeswap-v3/pancakeswap-v3.js.map +1 -1
- package/build/dex/quick-perps/config.d.ts +11 -0
- package/build/dex/quick-perps/config.js +27 -0
- package/build/dex/quick-perps/config.js.map +1 -0
- package/build/dex/quick-perps/fast-price-feed.d.ts +26 -0
- package/build/dex/quick-perps/fast-price-feed.js +176 -0
- package/build/dex/quick-perps/fast-price-feed.js.map +1 -0
- package/build/dex/quick-perps/pool.d.ts +21 -0
- package/build/dex/quick-perps/pool.js +225 -0
- package/build/dex/quick-perps/pool.js.map +1 -0
- package/build/dex/quick-perps/quick-perps.d.ts +52 -0
- package/build/dex/quick-perps/quick-perps.js +211 -0
- package/build/dex/quick-perps/quick-perps.js.map +1 -0
- package/build/dex/quick-perps/types.d.ts +98 -0
- package/build/dex/quick-perps/types.js +3 -0
- package/build/dex/quick-perps/types.js.map +1 -0
- package/build/dex/quick-perps/usdq.d.ts +15 -0
- package/build/dex/quick-perps/usdq.js +61 -0
- package/build/dex/quick-perps/usdq.js.map +1 -0
- package/build/dex/quick-perps/vault-price-feed.d.ts +43 -0
- package/build/dex/quick-perps/vault-price-feed.js +194 -0
- package/build/dex/quick-perps/vault-price-feed.js.map +1 -0
- package/build/dex/quick-perps/vault-utils.d.ts +8 -0
- package/build/dex/quick-perps/vault-utils.js +41 -0
- package/build/dex/quick-perps/vault-utils.js.map +1 -0
- package/build/dex/quick-perps/vault.d.ts +46 -0
- package/build/dex/quick-perps/vault.js +166 -0
- package/build/dex/quick-perps/vault.js.map +1 -0
- package/build/dex/solidly/config.js +52 -2
- package/build/dex/solidly/config.js.map +1 -1
- package/build/dex/solidly/forks-override/aerodrome.d.ts +14 -0
- package/build/dex/solidly/forks-override/aerodrome.js +48 -0
- package/build/dex/solidly/forks-override/aerodrome.js.map +1 -0
- package/build/dex/solidly/forks-override/equalizer.d.ts +20 -0
- package/build/dex/solidly/forks-override/equalizer.js +46 -0
- package/build/dex/solidly/forks-override/equalizer.js.map +1 -0
- package/build/dex/solidly/forks-override/ramses.d.ts +44 -0
- package/build/dex/solidly/forks-override/ramses.js +144 -0
- package/build/dex/solidly/forks-override/ramses.js.map +1 -0
- package/build/dex/solidly/forks-override/velodromeV2.d.ts +20 -0
- package/build/dex/solidly/forks-override/velodromeV2.js +50 -0
- package/build/dex/solidly/forks-override/velodromeV2.js.map +1 -0
- package/build/dex/solidly/solidly.js +4 -0
- package/build/dex/solidly/solidly.js.map +1 -1
- package/build/dex/uniswap-v2/nomiswap-v2.d.ts +24 -0
- package/build/dex/uniswap-v2/nomiswap-v2.js +44 -0
- package/build/dex/uniswap-v2/nomiswap-v2.js.map +1 -0
- package/build/dex/uniswap-v3/config.js +166 -0
- package/build/dex/uniswap-v3/config.js.map +1 -1
- package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.d.ts +19 -0
- package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.js +99 -0
- package/build/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.js.map +1 -0
- package/build/dex/uniswap-v3/forks/ramses-v2/utils.d.ts +4 -0
- package/build/dex/uniswap-v3/forks/ramses-v2/utils.js +63 -0
- package/build/dex/uniswap-v3/forks/ramses-v2/utils.js.map +1 -0
- package/build/dex/uniswap-v3/types.d.ts +10 -1
- package/build/dex/uniswap-v3/types.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3-factory.d.ts +26 -0
- package/build/dex/uniswap-v3/uniswap-v3-factory.js +44 -0
- package/build/dex/uniswap-v3/uniswap-v3-factory.js.map +1 -0
- package/build/dex/uniswap-v3/uniswap-v3-pool.d.ts +8 -6
- package/build/dex/uniswap-v3/uniswap-v3-pool.js +5 -2
- package/build/dex/uniswap-v3/uniswap-v3-pool.js.map +1 -1
- package/build/dex/uniswap-v3/uniswap-v3.d.ts +7 -4
- package/build/dex/uniswap-v3/uniswap-v3.js +51 -10
- package/build/dex/uniswap-v3/uniswap-v3.js.map +1 -1
- package/build/dex/weth/config.js +3 -0
- package/build/dex/weth/config.js.map +1 -1
- package/build/dex/woo-fi-v2/config.js +13 -0
- package/build/dex/woo-fi-v2/config.js.map +1 -1
- package/build/dex-helper/dummy-dex-helper.js +7 -1
- package/build/dex-helper/dummy-dex-helper.js.map +1 -1
- package/build/dex-helper/icache.d.ts +1 -0
- package/build/lib/api3-feed.d.ts +30 -0
- package/build/lib/api3-feed.js +100 -0
- package/build/lib/api3-feed.js.map +1 -0
- package/build/lib/decoders.d.ts +3 -0
- package/build/lib/decoders.js +9 -1
- package/build/lib/decoders.js.map +1 -1
- package/build/stateful-event-subscriber.d.ts +1 -0
- package/build/stateful-event-subscriber.js +6 -0
- package/build/stateful-event-subscriber.js.map +1 -1
- package/build/types.d.ts +2 -0
- package/build/workers.d.ts +0 -0
- package/build/workers.js +2 -0
- package/build/workers.js.map +1 -0
- package/package.json +1 -1
- package/src/abi/RamsesV2Pool.abi.json +1554 -0
- package/src/abi/RamsesV2Quoter.abi.json +274 -0
- package/src/abi/RamsesV2StateMulticall.abi.json +891 -0
- package/src/abi/aerodrome/aerodrome-pool-factory.json +586 -0
- package/src/abi/algebra/AlgebraFactory-v1_1.abi.json +250 -0
- package/src/abi/api3-proxy.json +53 -0
- package/src/abi/api3-server-v1.json +463 -0
- package/src/abi/nomiswap-v2/nomiswap-v2-pool.json +773 -0
- package/src/abi/pancakeswap-v3/PancakeswapV3Factory.abi.json +300 -0
- package/src/abi/quick-perps/fast-price-events.json +70 -0
- package/src/abi/quick-perps/fast-price-feed.json +741 -0
- package/src/abi/quick-perps/reader.json +313 -0
- package/src/abi/quick-perps/vault-price-feed.json +323 -0
- package/src/abi/quick-perps/vault.json +1953 -0
- package/src/abi/ramses-v2/RamsesV2Pool.abi.json +1599 -0
- package/src/composed-event-subscriber.ts +16 -11
- package/src/config.ts +80 -14
- package/src/constants.ts +1 -0
- package/src/dex/algebra/algebra-factory.ts +70 -0
- package/src/dex/algebra/algebra-integration.test.ts +316 -16
- package/src/dex/algebra/algebra-pool-v1_1.ts +259 -8
- package/src/dex/algebra/algebra.ts +73 -22
- package/src/dex/algebra/config.ts +1 -0
- package/src/dex/algebra/lib/TickTable.ts +75 -74
- package/src/dex/algebra/types.ts +6 -2
- package/src/dex/algebra/utils.ts +83 -2
- package/src/dex/balancer-v2/balancer-v2-e2e.test.ts +133 -4
- package/src/dex/balancer-v2/balancer-v2.ts +87 -6
- package/src/dex/balancer-v2/config.ts +11 -2
- package/src/dex/balancer-v2/optimizer.ts +49 -62
- package/src/dex/balancer-v2/types.ts +0 -4
- package/src/dex/curve-v1/config.ts +40 -38
- package/src/dex/curve-v1-factory/config.ts +17 -9
- package/src/dex/curve-v1-factory/curve-v1-factory-e2e.test.ts +19 -0
- package/src/dex/curve-v1-factory/curve-v1-factory-integration.test.ts +165 -45
- package/src/dex/curve-v1-factory/curve-v1-factory.ts +477 -415
- package/src/dex/curve-v1-factory/curve-v1-pool-manager.ts +15 -2
- package/src/dex/curve-v1-factory/price-handlers/functions/_calc_withdraw_one_coin.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_dynamic_fee.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_rates.ts +2 -1
- package/src/dex/curve-v1-factory/price-handlers/functions/_xp.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/_xp_mem.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/calc_token_amount.ts +71 -13
- package/src/dex/curve-v1-factory/price-handlers/functions/calc_withdraw_one_coin.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/constants.ts +11 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_D.ts +2 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_D_mem.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_D_precisions.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_dy.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_dy_underlying.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_y.ts +1 -0
- package/src/dex/curve-v1-factory/price-handlers/functions/get_y_D.ts +1 -0
- package/src/dex/curve-v1-factory/state-polling-pools/custom-pool-polling.ts +13 -5
- package/src/dex/curve-v1-factory/state-polling-pools/factory-pool-polling.ts +2 -1
- package/src/dex/curve-v1-factory/types.ts +3 -1
- package/src/dex/generic-rfq/example-api.test.ts +1 -1
- package/src/dex/generic-rfq/generic-rfq.ts +12 -4
- package/src/dex/generic-rfq/rate-fetcher.ts +4 -2
- package/src/dex/generic-rfq/types.ts +1 -0
- package/src/dex/hashflow/hashflow-e2e.test.ts +36 -3
- package/src/dex/hashflow/hashflow.ts +2 -1
- package/src/dex/idex.ts +1 -0
- package/src/dex/index.ts +21 -0
- package/src/dex/maverick-v1/config.ts +10 -0
- package/src/dex/maverick-v1/maverick-v1-e2e.test.ts +115 -1
- package/src/dex/maverick-v1/maverick-v1.ts +12 -2
- package/src/dex/pancakeswap-v3/config.ts +19 -0
- package/src/dex/pancakeswap-v3/pancakeswap-v3-e2e.test.ts +114 -0
- package/src/dex/pancakeswap-v3/pancakeswap-v3-factory.ts +73 -0
- package/src/dex/pancakeswap-v3/pancakeswap-v3.ts +50 -2
- package/src/dex/quick-perps/config.ts +31 -0
- package/src/dex/quick-perps/fast-price-feed.ts +279 -0
- package/src/dex/quick-perps/pool.ts +407 -0
- package/src/dex/quick-perps/quick-perps-e2e.test.ts +65 -0
- package/src/dex/quick-perps/quick-perps-events.test.ts +100 -0
- package/src/dex/quick-perps/quick-perps-integration.test.ts +153 -0
- package/src/dex/quick-perps/quick-perps.ts +302 -0
- package/src/dex/quick-perps/types.ts +97 -0
- package/src/dex/quick-perps/usdq.ts +83 -0
- package/src/dex/quick-perps/vault-price-feed.ts +322 -0
- package/src/dex/quick-perps/vault-utils.ts +53 -0
- package/src/dex/quick-perps/vault.ts +290 -0
- package/src/dex/solidly/config.ts +58 -2
- package/src/dex/solidly/forks-override/aerodrome.ts +53 -0
- package/src/dex/solidly/forks-override/equalizer.ts +58 -0
- package/src/dex/solidly/forks-override/ramses.ts +253 -0
- package/src/dex/solidly/forks-override/velodromeV2.ts +63 -0
- package/src/dex/solidly/solidly-e2e.test.ts +313 -1
- package/src/dex/solidly/solidly-integration.test.ts +540 -41
- package/src/dex/solidly/solidly.ts +5 -0
- package/src/dex/uniswap-v2/nomiswap-v2.ts +63 -0
- package/src/dex/uniswap-v2/uniswap-v2-e2e-bsc.test.ts +120 -1
- package/src/dex/uniswap-v3/config.ts +174 -0
- package/src/dex/uniswap-v3/forks/ramses-v2/ramses-v2-pool.ts +156 -0
- package/src/dex/uniswap-v3/forks/ramses-v2/utils.ts +72 -0
- package/src/dex/uniswap-v3/types.ts +14 -1
- package/src/dex/uniswap-v3/uniswap-v3-e2e.test.ts +1071 -346
- package/src/dex/uniswap-v3/uniswap-v3-factory.ts +73 -0
- package/src/dex/uniswap-v3/uniswap-v3-integration.test.ts +787 -14
- package/src/dex/uniswap-v3/uniswap-v3-pool.ts +13 -5
- package/src/dex/uniswap-v3/uniswap-v3.ts +87 -20
- package/src/dex/weth/config.ts +3 -0
- package/src/dex/woo-fi-v2/config.ts +13 -0
- package/src/dex/woo-fi-v2/woo-fi-v2-e2e.test.ts +64 -0
- package/src/dex-helper/dummy-dex-helper.ts +8 -1
- package/src/dex-helper/icache.ts +2 -0
- package/src/lib/api3-feed.ts +175 -0
- package/src/lib/decoders.ts +13 -0
- package/src/stateful-event-subscriber.ts +8 -0
- package/src/types.ts +2 -0
- package/tests/constants-e2e.ts +102 -6
- package/tests/tenderly-simulation.ts +48 -4
- package/tests/utils-e2e.ts +21 -11
package/tests/constants-e2e.ts
CHANGED
|
@@ -299,6 +299,18 @@ export const Tokens: {
|
|
|
299
299
|
address: '0xc411db5f5eb3f7d552f9b8454b2d74097ccde6e3',
|
|
300
300
|
decimals: 6,
|
|
301
301
|
},
|
|
302
|
+
GHO: {
|
|
303
|
+
address: '0x40d16fc0246ad3160ccc09b8d0d3a2cd28ae6c2f',
|
|
304
|
+
decimals: 18,
|
|
305
|
+
},
|
|
306
|
+
crvUSD: {
|
|
307
|
+
address: '0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E',
|
|
308
|
+
decimals: 18,
|
|
309
|
+
},
|
|
310
|
+
wibBTC: {
|
|
311
|
+
address: '0x8751d4196027d4e6da63716fa7786b5174f04c15',
|
|
312
|
+
decimals: 18,
|
|
313
|
+
},
|
|
302
314
|
},
|
|
303
315
|
[Network.ROPSTEN]: {
|
|
304
316
|
DAI: {
|
|
@@ -448,6 +460,10 @@ export const Tokens: {
|
|
|
448
460
|
address: '0x049d68029688eabf473097a2fc38ef61633a3c7a',
|
|
449
461
|
decimals: 6,
|
|
450
462
|
},
|
|
463
|
+
EQUAL: {
|
|
464
|
+
address: '0x3fd3a0c85b70754efc07ac9ac0cbbdce664865a6',
|
|
465
|
+
decimals: 18,
|
|
466
|
+
},
|
|
451
467
|
POPS: {
|
|
452
468
|
address: '0x9dE4b40bDcE50Ec6a1A668bF85997BbBD324069a',
|
|
453
469
|
decimals: 18,
|
|
@@ -785,14 +801,14 @@ export const Tokens: {
|
|
|
785
801
|
address: '0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f',
|
|
786
802
|
decimals: 8,
|
|
787
803
|
},
|
|
788
|
-
USDCe: {
|
|
789
|
-
address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
|
|
790
|
-
decimals: 6,
|
|
791
|
-
},
|
|
792
804
|
LEX: {
|
|
793
805
|
address: '0x6bB7A17AcC227fd1F6781D1EEDEAE01B42047eE0',
|
|
794
806
|
decimals: 18,
|
|
795
807
|
},
|
|
808
|
+
GRAIL: {
|
|
809
|
+
address: '0x3d9907f9a368ad0a51be60f7da3b97cf940982d8',
|
|
810
|
+
decimals: 18,
|
|
811
|
+
},
|
|
796
812
|
},
|
|
797
813
|
[Network.OPTIMISM]: {
|
|
798
814
|
DAI: {
|
|
@@ -845,6 +861,63 @@ export const Tokens: {
|
|
|
845
861
|
decimals: 8,
|
|
846
862
|
},
|
|
847
863
|
},
|
|
864
|
+
[Network.ZKEVM]: {
|
|
865
|
+
ETH: {
|
|
866
|
+
address: ETHER_ADDRESS,
|
|
867
|
+
decimals: 18,
|
|
868
|
+
},
|
|
869
|
+
WETH: {
|
|
870
|
+
address: '0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9',
|
|
871
|
+
decimals: 18,
|
|
872
|
+
},
|
|
873
|
+
MATIC: {
|
|
874
|
+
address: '0xa2036f0538221a77a3937f1379699f44945018d0',
|
|
875
|
+
decimals: 18,
|
|
876
|
+
},
|
|
877
|
+
WBTC: {
|
|
878
|
+
address: '0xea034fb02eb1808c2cc3adbc15f447b93cbe08e1',
|
|
879
|
+
decimals: 8,
|
|
880
|
+
},
|
|
881
|
+
USDC: {
|
|
882
|
+
address: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035',
|
|
883
|
+
decimals: 6,
|
|
884
|
+
},
|
|
885
|
+
},
|
|
886
|
+
[Network.BASE]: {
|
|
887
|
+
PRIME: {
|
|
888
|
+
address: '0xfA980cEd6895AC314E7dE34Ef1bFAE90a5AdD21b',
|
|
889
|
+
decimals: 18,
|
|
890
|
+
},
|
|
891
|
+
WETH: {
|
|
892
|
+
address: '0x4200000000000000000000000000000000000006',
|
|
893
|
+
decimals: 18,
|
|
894
|
+
},
|
|
895
|
+
MAV: {
|
|
896
|
+
address: '0x64b88c73A5DfA78D1713fE1b4c69a22d7E0faAa7',
|
|
897
|
+
decimals: 18,
|
|
898
|
+
},
|
|
899
|
+
USDC: {
|
|
900
|
+
address: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913',
|
|
901
|
+
decimals: 6,
|
|
902
|
+
},
|
|
903
|
+
USDbC: {
|
|
904
|
+
address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
|
|
905
|
+
decimals: 6,
|
|
906
|
+
},
|
|
907
|
+
DAI: {
|
|
908
|
+
address: '0x50c5725949a6f0c72e6c4a641f24049a917db0cb',
|
|
909
|
+
decimals: 18,
|
|
910
|
+
},
|
|
911
|
+
BAL: {
|
|
912
|
+
address: '0x4158734d47fc9692176b5085e0f52ee0da5d47f1',
|
|
913
|
+
decimals: 18,
|
|
914
|
+
},
|
|
915
|
+
GOLD: {
|
|
916
|
+
address: '0xbeFD5C25A59ef2C1316c5A4944931171F30Cd3E4',
|
|
917
|
+
decimals: 18,
|
|
918
|
+
},
|
|
919
|
+
ETH: { address: ETHER_ADDRESS, decimals: 18 },
|
|
920
|
+
},
|
|
848
921
|
};
|
|
849
922
|
|
|
850
923
|
export const Holders: {
|
|
@@ -908,6 +981,9 @@ export const Holders: {
|
|
|
908
981
|
aEthWETH: '0x645C4c0c95C1Aa6EF25d12f4a25038cA9b0C6Cc7',
|
|
909
982
|
dUSDC: '0x2FC2F705110A7F46Ce85F701d7217EF1018f01A3',
|
|
910
983
|
PSP: '0xE5E5440a1CE69C5cf67BFFA74d185e57c31b43E5',
|
|
984
|
+
crvUSD: '0xA920De414eA4Ab66b97dA1bFE9e6EcA7d4219635',
|
|
985
|
+
GHO: '0x844Dc85EdD8492A56228D293cfEbb823EF3E10EC',
|
|
986
|
+
wibBTC: '0xFbdCA68601f835b27790D98bbb8eC7f05FDEaA9B',
|
|
911
987
|
},
|
|
912
988
|
[Network.ROPSTEN]: {
|
|
913
989
|
ETH: '0x43262A12d8610AA70C15DbaeAC321d51613c9071',
|
|
@@ -948,7 +1024,7 @@ export const Holders: {
|
|
|
948
1024
|
DAI: '0x370f4b2dcf75c94d8d4450b493661a9c6170d0b5',
|
|
949
1025
|
FTM: '0x431e81E5dfB5A24541b5Ff8762bDEF3f32F96354',
|
|
950
1026
|
WFTM: '0x3e923747ca2675e096d812c3b24846ac39aed645',
|
|
951
|
-
USDC: '
|
|
1027
|
+
USDC: '0xf53feaeb035361c046e5669745695e450ebb4028',
|
|
952
1028
|
FUSDT: '0x9ade1c17d25246c405604344f89E8F23F8c1c632',
|
|
953
1029
|
POPS: '0x4b78b52e7de4d8b7d367297cb8a87c1875a9d591',
|
|
954
1030
|
aFanUSDT: '0x8EBc96fF91A30059E447bFC7C0a7394f8A5793E6',
|
|
@@ -964,6 +1040,7 @@ export const Holders: {
|
|
|
964
1040
|
ETH: '0xf48883940b4056801de30f12b934dcea90133ee6',
|
|
965
1041
|
GUSDC: '0x894d774a293f8aa3d23d67815d4cadb5319c1094',
|
|
966
1042
|
GDAI: '0x0e2ed73f9c1409e2b36fe6c46e60d4557b7c2ac0',
|
|
1043
|
+
EQUAL: '0x8b187ea19c93091a4d6b426b71871648182b5fac',
|
|
967
1044
|
},
|
|
968
1045
|
[Network.BSC]: {
|
|
969
1046
|
DAI: '0xf68a4b64162906eff0ff6ae34e2bb1cd42fef62d',
|
|
@@ -1020,7 +1097,7 @@ export const Holders: {
|
|
|
1020
1097
|
USDCe: '0x62383739d68dd0f844103db8dfb05a7eded5bbe6',
|
|
1021
1098
|
USDC: '0xa843392198862f98d17e3aa1421b08f2c2020cff',
|
|
1022
1099
|
OHM: '0xebce5f29ff5ca9aa330ebdf7ec6b5f474bff271e',
|
|
1023
|
-
USDT: '
|
|
1100
|
+
USDT: '0x5ff47d4ab75bcaff6807c81f1367abb53439883c',
|
|
1024
1101
|
POPS: '0x4b78b52e7de4d8b7d367297cb8a87c1875a9d591',
|
|
1025
1102
|
FRAX: '0x59bf0545fca0e5ad48e13da269facd2e8c886ba4',
|
|
1026
1103
|
nUSD: '0x9dd329f5411466d9e0c488ff72519ca9fef0cb40',
|
|
@@ -1053,6 +1130,24 @@ export const Holders: {
|
|
|
1053
1130
|
rETH: '0x4c2e69e58b14de9afedfb94319519ce34e087283',
|
|
1054
1131
|
WBTC: '0xb9c8f0d3254007ee4b98970b94544e473cd610ec',
|
|
1055
1132
|
},
|
|
1133
|
+
[Network.ZKEVM]: {
|
|
1134
|
+
ETH: '0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9',
|
|
1135
|
+
WETH: '0xc44ad482f24fd750caeba387d2726d8653f8c4bb',
|
|
1136
|
+
MATIC: '0x8f2a1450c040b3c19efe9676165d8f30d8280019',
|
|
1137
|
+
WBTC: '0x99b31498b0a1dae01fc3433e3cb60f095340935c',
|
|
1138
|
+
USDC: '0x99b31498b0a1dae01fc3433e3cb60f095340935c',
|
|
1139
|
+
},
|
|
1140
|
+
[Network.BASE]: {
|
|
1141
|
+
WETH: '0x4bb6b2efe7036020ba6f02a05602546c9f25bf28',
|
|
1142
|
+
PRIME: '0x956bcc6b56c99db382d9d97a30ba5f1402144b3e',
|
|
1143
|
+
ETH: '0xdd9176ea3e7559d6b68b537ef555d3e89403f742',
|
|
1144
|
+
MAV: '0x7499785aa5d1bdf0a0ac862c1ef3698d3cba6568',
|
|
1145
|
+
USDC: '0xaac391f166f33cdaefaa4afa6616a3bea66b694d',
|
|
1146
|
+
USDbC: '0xc9d05a1c3c8e01dcb701d6185cdc21a5bb94becb',
|
|
1147
|
+
DAI: '0x20f03e26968b179025f65c1f4afadfd3959c8d03',
|
|
1148
|
+
BAL: '0x854b004700885a61107b458f11ecc169a019b764',
|
|
1149
|
+
GOLD: '0x1374c25b3710758c326ee0c70ec48b595d5ccf8c',
|
|
1150
|
+
},
|
|
1056
1151
|
};
|
|
1057
1152
|
|
|
1058
1153
|
export const SmartTokens = Object.keys(Tokens).reduce((acc, _network) => {
|
|
@@ -1077,4 +1172,5 @@ export const NativeTokenSymbols: { [network: number]: string } = {
|
|
|
1077
1172
|
[Network.FANTOM]: 'FTM',
|
|
1078
1173
|
[Network.ARBITRUM]: 'ETH',
|
|
1079
1174
|
[Network.OPTIMISM]: 'ETH',
|
|
1175
|
+
[Network.BASE]: 'ETH',
|
|
1080
1176
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
1
2
|
import axios from 'axios';
|
|
2
3
|
import { Address } from '@paraswap/core';
|
|
4
|
+
import { Provider } from '@ethersproject/providers';
|
|
3
5
|
import { TxObject } from '../src/types';
|
|
4
6
|
import { StateOverrides, StateSimulateApiOverride } from './smart-tokens';
|
|
5
7
|
|
|
@@ -9,7 +11,50 @@ const TENDERLY_PROJECT = process.env.TENDERLY_PROJECT;
|
|
|
9
11
|
const TENDERLY_FORK_ID = process.env.TENDERLY_FORK_ID;
|
|
10
12
|
const TENDERLY_FORK_LAST_TX_ID = process.env.TENDERLY_FORK_LAST_TX_ID;
|
|
11
13
|
|
|
12
|
-
export
|
|
14
|
+
export type SimulationResult = {
|
|
15
|
+
success: boolean;
|
|
16
|
+
gasUsed?: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
transaction?: any;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export interface TransactionSimulator {
|
|
22
|
+
forkId: string;
|
|
23
|
+
setup(): Promise<void>;
|
|
24
|
+
|
|
25
|
+
simulate(
|
|
26
|
+
params: TxObject,
|
|
27
|
+
stateOverrides?: StateOverrides,
|
|
28
|
+
): Promise<SimulationResult>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class EstimateGasSimulation implements TransactionSimulator {
|
|
32
|
+
forkId: string = '0';
|
|
33
|
+
|
|
34
|
+
constructor(private provider: Provider) {}
|
|
35
|
+
|
|
36
|
+
async setup() {}
|
|
37
|
+
|
|
38
|
+
async simulate(
|
|
39
|
+
params: TxObject,
|
|
40
|
+
_: StateOverrides,
|
|
41
|
+
): Promise<SimulationResult> {
|
|
42
|
+
try {
|
|
43
|
+
const result = await this.provider.estimateGas(params);
|
|
44
|
+
return {
|
|
45
|
+
success: true,
|
|
46
|
+
gasUsed: result.toNumber().toString(),
|
|
47
|
+
};
|
|
48
|
+
} catch (e) {
|
|
49
|
+
console.error(`Estimate gas simulation failed:`, e);
|
|
50
|
+
return {
|
|
51
|
+
success: false,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export class TenderlySimulation implements TransactionSimulator {
|
|
13
58
|
lastTx: string = '';
|
|
14
59
|
forkId: string = '';
|
|
15
60
|
maxGasLimit = 80000000;
|
|
@@ -104,13 +149,13 @@ export class TenderlySimulation {
|
|
|
104
149
|
return {
|
|
105
150
|
success: true,
|
|
106
151
|
gasUsed: data.transaction.gas_used,
|
|
107
|
-
|
|
152
|
+
url: `https://dashboard.tenderly.co/${TENDERLY_ACCOUNT_ID}/${TENDERLY_PROJECT}/fork/${this.forkId}/simulation/${lastTx}`,
|
|
108
153
|
transaction: data.transaction,
|
|
109
154
|
};
|
|
110
155
|
} else {
|
|
111
156
|
return {
|
|
112
157
|
success: false,
|
|
113
|
-
|
|
158
|
+
url: `https://dashboard.tenderly.co/${TENDERLY_ACCOUNT_ID}/${TENDERLY_PROJECT}/fork/${this.forkId}/simulation/${lastTx}`,
|
|
114
159
|
error: `Simulation failed: ${data.transaction.error_info.error_message} at ${data.transaction.error_info.address}`,
|
|
115
160
|
};
|
|
116
161
|
}
|
|
@@ -118,7 +163,6 @@ export class TenderlySimulation {
|
|
|
118
163
|
console.error(`TenderlySimulation_simulate:`, e);
|
|
119
164
|
return {
|
|
120
165
|
success: false,
|
|
121
|
-
tenderlyUrl: '',
|
|
122
166
|
};
|
|
123
167
|
}
|
|
124
168
|
}
|
package/tests/utils-e2e.ts
CHANGED
|
@@ -5,7 +5,11 @@ import {
|
|
|
5
5
|
IParaSwapSDK,
|
|
6
6
|
LocalParaswapSDK,
|
|
7
7
|
} from '../src/implementations/local-paraswap-sdk';
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
EstimateGasSimulation,
|
|
10
|
+
TenderlySimulation,
|
|
11
|
+
TransactionSimulator,
|
|
12
|
+
} from './tenderly-simulation';
|
|
9
13
|
import {
|
|
10
14
|
SwapSide,
|
|
11
15
|
ETHER_ADDRESS,
|
|
@@ -24,7 +28,7 @@ import {
|
|
|
24
28
|
import Erc20ABI from '../src/abi/erc20.json';
|
|
25
29
|
import AugustusABI from '../src/abi/augustus.json';
|
|
26
30
|
import { generateConfig } from '../src/config';
|
|
27
|
-
import { DummyLimitOrderProvider } from '../src/dex-helper';
|
|
31
|
+
import { DummyDexHelper, DummyLimitOrderProvider } from '../src/dex-helper';
|
|
28
32
|
import { constructSimpleSDK, SimpleFetchSDK } from '@paraswap/sdk';
|
|
29
33
|
import axios from 'axios';
|
|
30
34
|
import { SmartToken, StateOverrides } from './smart-tokens';
|
|
@@ -82,6 +86,7 @@ const MULTISIG: { [nid: number]: string } = {
|
|
|
82
86
|
[Network.AVALANCHE]: '0x1e2ECA5e812D08D2A7F8664D69035163ff5BfEC2',
|
|
83
87
|
[Network.OPTIMISM]: '0xf01121e808F782d7F34E857c27dA31AD1f151b39',
|
|
84
88
|
[Network.ARBITRUM]: '0x90DfD8a6454CFE19be39EaB42ac93CD850c7f339',
|
|
89
|
+
[Network.BASE]: '0x6C674c8Df1aC663b822c4B6A56B4E5e889379AE0',
|
|
85
90
|
};
|
|
86
91
|
|
|
87
92
|
class APIParaswapSDK implements IParaSwapSDK {
|
|
@@ -268,16 +273,20 @@ export async function testE2E(
|
|
|
268
273
|
// Specified in BPS: part of 10000
|
|
269
274
|
slippage?: number,
|
|
270
275
|
sleepMs?: number,
|
|
276
|
+
replaceTenderlyWithEstimateGas?: boolean,
|
|
271
277
|
) {
|
|
272
278
|
const amount = BigInt(_amount);
|
|
273
|
-
|
|
279
|
+
|
|
280
|
+
const ts: TransactionSimulator = replaceTenderlyWithEstimateGas
|
|
281
|
+
? new EstimateGasSimulation(new DummyDexHelper(network).provider)
|
|
282
|
+
: new TenderlySimulation(network);
|
|
274
283
|
await ts.setup();
|
|
275
284
|
|
|
276
285
|
if (srcToken.address.toLowerCase() !== ETHER_ADDRESS.toLowerCase()) {
|
|
277
286
|
const allowanceTx = await ts.simulate(
|
|
278
287
|
allowTokenTransferProxyParams(srcToken.address, senderAddress, network),
|
|
279
288
|
);
|
|
280
|
-
if (!allowanceTx.success) console.log(allowanceTx.
|
|
289
|
+
if (!allowanceTx.success) console.log(allowanceTx.url);
|
|
281
290
|
expect(allowanceTx!.success).toEqual(true);
|
|
282
291
|
}
|
|
283
292
|
|
|
@@ -290,6 +299,7 @@ export async function testE2E(
|
|
|
290
299
|
),
|
|
291
300
|
);
|
|
292
301
|
expect(whitelistTx.success).toEqual(true);
|
|
302
|
+
console.log(`Successfully whitelisted ${deployedTestContractAddress}`);
|
|
293
303
|
|
|
294
304
|
if (testContractType === 'router') {
|
|
295
305
|
const setImplementationTx = await ts.simulate(
|
|
@@ -309,7 +319,7 @@ export async function testE2E(
|
|
|
309
319
|
expect(deployTx.success).toEqual(true);
|
|
310
320
|
|
|
311
321
|
const contractAddress =
|
|
312
|
-
deployTx.transaction
|
|
322
|
+
deployTx.transaction?.transaction_info.contract_address;
|
|
313
323
|
console.log(
|
|
314
324
|
formatDeployMessage(
|
|
315
325
|
'adapter',
|
|
@@ -384,15 +394,15 @@ export async function testE2E(
|
|
|
384
394
|
|
|
385
395
|
const swapTx = await ts.simulate(swapParams);
|
|
386
396
|
// Only log gas estimate if testing against API
|
|
387
|
-
if (useAPI)
|
|
397
|
+
if (useAPI) {
|
|
398
|
+
const gasUsed = swapTx.gasUsed || '0';
|
|
388
399
|
console.log(
|
|
389
400
|
`Gas Estimate API: ${priceRoute.gasCost}, Simulated: ${
|
|
390
401
|
swapTx!.gasUsed
|
|
391
|
-
}, Difference: ${
|
|
392
|
-
parseInt(priceRoute.gasCost) - parseInt(swapTx!.gasUsed)
|
|
393
|
-
}`,
|
|
402
|
+
}, Difference: ${parseInt(priceRoute.gasCost) - parseInt(gasUsed)}`,
|
|
394
403
|
);
|
|
395
|
-
|
|
404
|
+
}
|
|
405
|
+
console.log(`Tenderly URL: ${swapTx!.url}`);
|
|
396
406
|
expect(swapTx!.success).toEqual(true);
|
|
397
407
|
} finally {
|
|
398
408
|
if (paraswap.releaseResources) {
|
|
@@ -614,7 +624,7 @@ export async function newTestE2E({
|
|
|
614
624
|
parseInt(priceRoute.gasCost) - parseInt(swapTx!.gasUsed)
|
|
615
625
|
}`,
|
|
616
626
|
);
|
|
617
|
-
console.log(`Tenderly URL: ${swapTx!.
|
|
627
|
+
console.log(`Tenderly URL: ${swapTx!.url}`);
|
|
618
628
|
expect(swapTx!.success).toEqual(true);
|
|
619
629
|
}
|
|
620
630
|
} finally {
|