@paraswap/dex-lib 4.7.27-1 → 4.7.27-ekubo-v3.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/PendleRouterStatic.json +19 -0
- package/build/abi/apex-defi/ApexDefiFactory.abi.json +1749 -0
- package/build/abi/apex-defi/ApexDefiRouter.abi.json +1120 -0
- package/build/abi/apex-defi/ApexDefiToken.abi.json +229 -0
- package/build/abi/apex-defi/ApexDefiWrapper.abi.json +92 -0
- package/build/abi/apex-defi/ApexDefiWrapperFactory.abi.json +1107 -0
- package/build/abi/ekubo-v3/core.json +797 -0
- package/build/abi/ekubo-v3/mev-capture-router.json +936 -0
- package/build/abi/ekubo-v3/quote-data-fetcher.json +161 -0
- package/build/abi/ekubo-v3/twamm-data-fetcher.json +216 -0
- package/build/abi/ekubo-v3/twamm.json +613 -0
- package/build/abi/idle-dao/idle-cdo-factory.json +38 -0
- package/build/abi/idle-dao/idle-cdo.json +1245 -0
- package/build/abi/infusion/InfusionFactory.json +147 -0
- package/build/abi/infusion/InfusionPair.json +658 -0
- package/build/abi/infusion/InfusionRouter.json +442 -0
- package/build/abi/maker-psm/pot.json +322 -0
- package/build/abi/maker-psm/psm.json +243 -0
- package/build/abi/maker-psm/vat.json +363 -0
- package/build/abi/nomiswap-v2/nomiswap-v2-pool.json +773 -0
- package/build/abi/pangolin-v3/PangolinV3StateMulticall.abi.json +796 -0
- package/build/abi/pendle/pendle-deployer.abi.json +520 -0
- package/build/abi/pendle/pendle-oracle.abi.json +413 -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/ring-v2/few-wrapped-token.json +587 -0
- package/build/abi/ring-v2/ring-v2-factory.json +125 -0
- package/build/abi/ring-v2/ring-v2-pool.json +461 -0
- package/build/abi/ring-v2/ring-v2-router.json +332 -0
- package/build/abi/stabull/stabull-curve.json +738 -0
- package/build/abi/stabull/stabull-router.json +76 -0
- package/build/abi/uniswap-v2/excalibur-pool.json +881 -0
- package/build/abi/uniswap-v2/mdex-factory.json +759 -0
- package/build/abi/uniswap-v4/hooks/SpotDynamicFeeManager.json +26 -0
- package/build/abi/uniswap-v4/hooks/SpotHook.json +54 -0
- package/build/abi/uniswap-v4/hooks/SpotPolicyManager.json +45 -0
- package/build/abi/uniswap-v4/hooks/cabalcoin-hook.abi.json +682 -0
- package/build/abi/uniswap-v4/hooks/fee-hook.abi.json +1335 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.d.ts +29 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js +153 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js.map +1 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.d.ts +40 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js +323 -0
- package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js.map +1 -0
- package/build/dex/aave-pt-to-underlying/config.d.ts +3 -0
- package/build/dex/aave-pt-to-underlying/config.js +24 -0
- package/build/dex/aave-pt-to-underlying/config.js.map +1 -0
- package/build/dex/aave-pt-to-underlying/constants.d.ts +2 -0
- package/build/dex/aave-pt-to-underlying/constants.js +6 -0
- package/build/dex/aave-pt-to-underlying/constants.js.map +1 -0
- package/build/dex/aave-pt-to-underlying/types.d.ts +24 -0
- package/build/dex/aave-pt-to-underlying/types.js +3 -0
- package/build/dex/aave-pt-to-underlying/types.js.map +1 -0
- package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.d.ts +39 -0
- package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js +244 -0
- package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js.map +1 -0
- package/build/dex/aave-pt-to-usdc/config.d.ts +3 -0
- package/build/dex/aave-pt-to-usdc/config.js +47 -0
- package/build/dex/aave-pt-to-usdc/config.js.map +1 -0
- package/build/dex/aave-pt-to-usdc/constants.d.ts +2 -0
- package/build/dex/aave-pt-to-usdc/constants.js +6 -0
- package/build/dex/aave-pt-to-usdc/constants.js.map +1 -0
- package/build/dex/aave-pt-to-usdc/types.d.ts +22 -0
- package/build/dex/aave-pt-to-usdc/types.js +3 -0
- package/build/dex/aave-pt-to-usdc/types.js.map +1 -0
- package/build/dex/algebra-integral/algebra-integral-factory.d.ts +1 -3
- package/build/dex/algebra-integral/algebra-integral-factory.js +1 -59
- package/build/dex/algebra-integral/algebra-integral-factory.js.map +1 -1
- package/build/dex/algebra-integral/algebra-integral.d.ts +0 -3
- package/build/dex/algebra-integral/algebra-integral.js +4 -112
- package/build/dex/algebra-integral/algebra-integral.js.map +1 -1
- package/build/dex/algebra-integral/constants.d.ts +0 -2
- package/build/dex/algebra-integral/constants.js +1 -5
- package/build/dex/algebra-integral/constants.js.map +1 -1
- package/build/dex/apex-defi/apex-defi-factory.d.ts +26 -0
- package/build/dex/apex-defi/apex-defi-factory.js +53 -0
- package/build/dex/apex-defi/apex-defi-factory.js.map +1 -0
- package/build/dex/apex-defi/apex-defi-pool.d.ts +55 -0
- package/build/dex/apex-defi/apex-defi-pool.js +247 -0
- package/build/dex/apex-defi/apex-defi-pool.js.map +1 -0
- package/build/dex/apex-defi/apex-defi-wrapper-factory.d.ts +57 -0
- package/build/dex/apex-defi/apex-defi-wrapper-factory.js +250 -0
- package/build/dex/apex-defi/apex-defi-wrapper-factory.js.map +1 -0
- package/build/dex/apex-defi/apex-defi.d.ts +97 -0
- package/build/dex/apex-defi/apex-defi.js +1021 -0
- package/build/dex/apex-defi/apex-defi.js.map +1 -0
- package/build/dex/apex-defi/config.d.ts +4 -0
- package/build/dex/apex-defi/config.js +138 -0
- package/build/dex/apex-defi/config.js.map +1 -0
- package/build/dex/apex-defi/types.d.ts +32 -0
- package/build/dex/apex-defi/types.js +3 -0
- package/build/dex/apex-defi/types.js.map +1 -0
- package/build/dex/apex-defi/utils.d.ts +46 -0
- package/build/dex/apex-defi/utils.js +133 -0
- package/build/dex/apex-defi/utils.js.map +1 -0
- package/build/dex/ekubo/pools/base-pool.d.ts +47 -0
- package/build/dex/ekubo/pools/base-pool.js +184 -0
- package/build/dex/ekubo/pools/base-pool.js.map +1 -0
- package/build/dex/ekubo/pools/iface.d.ts +46 -0
- package/build/dex/ekubo/pools/iface.js +75 -0
- package/build/dex/ekubo/pools/iface.js.map +1 -0
- package/build/dex/ekubo/pools/math/price.d.ts +7 -0
- package/build/dex/ekubo/pools/math/price.js +112 -0
- package/build/dex/ekubo/pools/math/price.js.map +1 -0
- package/build/dex/ekubo/pools/oracle-pool.d.ts +10 -0
- package/build/dex/ekubo/pools/oracle-pool.js +19 -0
- package/build/dex/ekubo/pools/oracle-pool.js.map +1 -0
- package/build/dex/ekubo/pools/pool-utils.d.ts +44 -0
- package/build/dex/ekubo/pools/pool-utils.js +240 -0
- package/build/dex/ekubo/pools/pool-utils.js.map +1 -0
- package/build/dex/ekubo-v3/config.d.ts +13 -0
- package/build/dex/ekubo-v3/config.js +23 -0
- package/build/dex/ekubo-v3/config.js.map +1 -0
- package/build/dex/ekubo-v3/ekubo-v3-pool-manager.d.ts +34 -0
- package/build/dex/ekubo-v3/ekubo-v3-pool-manager.js +421 -0
- package/build/dex/ekubo-v3/ekubo-v3-pool-manager.js.map +1 -0
- package/build/dex/ekubo-v3/ekubo-v3.d.ts +38 -0
- package/build/dex/ekubo-v3/ekubo-v3.js +315 -0
- package/build/dex/ekubo-v3/ekubo-v3.js.map +1 -0
- package/build/dex/ekubo-v3/pools/base.d.ts +42 -0
- package/build/dex/ekubo-v3/pools/base.js +307 -0
- package/build/dex/ekubo-v3/pools/base.js.map +1 -0
- package/build/dex/ekubo-v3/pools/full-range.d.ts +25 -0
- package/build/dex/ekubo-v3/pools/full-range.js +105 -0
- package/build/dex/ekubo-v3/pools/full-range.js.map +1 -0
- package/build/dex/ekubo-v3/pools/math/constants.d.ts +12 -0
- package/build/dex/ekubo-v3/pools/math/constants.js +16 -0
- package/build/dex/ekubo-v3/pools/math/constants.js.map +1 -0
- package/build/dex/ekubo-v3/pools/math/delta.d.ts +2 -0
- package/build/dex/ekubo-v3/pools/math/delta.js +51 -0
- package/build/dex/ekubo-v3/pools/math/delta.js.map +1 -0
- package/build/dex/ekubo-v3/pools/math/sqrt-ratio.d.ts +8 -0
- package/build/dex/ekubo-v3/pools/math/sqrt-ratio.js +113 -0
- package/build/dex/ekubo-v3/pools/math/sqrt-ratio.js.map +1 -0
- package/build/dex/ekubo-v3/pools/math/swap.d.ts +18 -0
- package/build/dex/ekubo-v3/pools/math/swap.js +128 -0
- package/build/dex/ekubo-v3/pools/math/swap.js.map +1 -0
- package/build/dex/ekubo-v3/pools/math/tick.d.ts +8 -0
- package/build/dex/ekubo-v3/pools/math/tick.js +129 -0
- package/build/dex/ekubo-v3/pools/math/tick.js.map +1 -0
- package/build/dex/ekubo-v3/pools/math/twamm/exp2.d.ts +1 -0
- package/build/dex/ekubo-v3/pools/math/twamm/exp2.js +86 -0
- package/build/dex/ekubo-v3/pools/math/twamm/exp2.js.map +1 -0
- package/build/dex/ekubo-v3/pools/math/twamm/sqrt-ratio.d.ts +1 -0
- package/build/dex/ekubo-v3/pools/math/twamm/sqrt-ratio.js +56 -0
- package/build/dex/ekubo-v3/pools/math/twamm/sqrt-ratio.js.map +1 -0
- package/build/dex/ekubo-v3/pools/mev-capture.d.ts +8 -0
- package/build/dex/ekubo-v3/pools/mev-capture.js +42 -0
- package/build/dex/ekubo-v3/pools/mev-capture.js.map +1 -0
- package/build/dex/ekubo-v3/pools/oracle.d.ts +8 -0
- package/build/dex/ekubo-v3/pools/oracle.js +18 -0
- package/build/dex/ekubo-v3/pools/oracle.js.map +1 -0
- package/build/dex/ekubo-v3/pools/pool.d.ts +56 -0
- package/build/dex/ekubo-v3/pools/pool.js +88 -0
- package/build/dex/ekubo-v3/pools/pool.js.map +1 -0
- package/build/dex/ekubo-v3/pools/stableswap.d.ts +22 -0
- package/build/dex/ekubo-v3/pools/stableswap.js +123 -0
- package/build/dex/ekubo-v3/pools/stableswap.js.map +1 -0
- package/build/dex/ekubo-v3/pools/twamm.d.ts +40 -0
- package/build/dex/ekubo-v3/pools/twamm.js +265 -0
- package/build/dex/ekubo-v3/pools/twamm.js.map +1 -0
- package/build/dex/ekubo-v3/pools/utils.d.ts +62 -0
- package/build/dex/ekubo-v3/pools/utils.js +160 -0
- package/build/dex/ekubo-v3/pools/utils.js.map +1 -0
- package/build/dex/ekubo-v3/types.d.ts +58 -0
- package/build/dex/ekubo-v3/types.js +3 -0
- package/build/dex/ekubo-v3/types.js.map +1 -0
- package/build/dex/ekubo-v3/utils.d.ts +10 -0
- package/build/dex/ekubo-v3/utils.js +54 -0
- package/build/dex/ekubo-v3/utils.js.map +1 -0
- package/build/dex/idle-dao/config.d.ts +5 -0
- package/build/dex/idle-dao/config.js +24 -0
- package/build/dex/idle-dao/config.js.map +1 -0
- package/build/dex/idle-dao/idle-dao.d.ts +42 -0
- package/build/dex/idle-dao/idle-dao.js +279 -0
- package/build/dex/idle-dao/idle-dao.js.map +1 -0
- package/build/dex/idle-dao/token_list.d.ts +4 -0
- package/build/dex/idle-dao/token_list.js +289 -0
- package/build/dex/idle-dao/token_list.js.map +1 -0
- package/build/dex/idle-dao/tokens.d.ts +9 -0
- package/build/dex/idle-dao/tokens.js +68 -0
- package/build/dex/idle-dao/tokens.js.map +1 -0
- package/build/dex/idle-dao/types.d.ts +35 -0
- package/build/dex/idle-dao/types.js +11 -0
- package/build/dex/idle-dao/types.js.map +1 -0
- package/build/dex/idle-dao/utils.d.ts +8 -0
- package/build/dex/idle-dao/utils.js +149 -0
- package/build/dex/idle-dao/utils.js.map +1 -0
- package/build/dex/index.js +2 -0
- package/build/dex/index.js.map +1 -1
- package/build/dex/infusion/config.d.ts +3 -0
- package/build/dex/infusion/config.js +20 -0
- package/build/dex/infusion/config.js.map +1 -0
- package/build/dex/infusion/infusion-stable-pool.d.ts +4 -0
- package/build/dex/infusion/infusion-stable-pool.js +74 -0
- package/build/dex/infusion/infusion-stable-pool.js.map +1 -0
- package/build/dex/infusion/infusion.d.ts +51 -0
- package/build/dex/infusion/infusion.js +461 -0
- package/build/dex/infusion/infusion.js.map +1 -0
- package/build/dex/infusion/types.d.ts +45 -0
- package/build/dex/infusion/types.js +3 -0
- package/build/dex/infusion/types.js.map +1 -0
- package/build/dex/infusion/utils/isStablePair.d.ts +2 -0
- package/build/dex/infusion/utils/isStablePair.js +18 -0
- package/build/dex/infusion/utils/isStablePair.js.map +1 -0
- package/build/dex/maker-psm/config.d.ts +11 -0
- package/build/dex/maker-psm/config.js +53 -0
- package/build/dex/maker-psm/config.js.map +1 -0
- package/build/dex/maker-psm/maker-psm-event-pool.d.ts +43 -0
- package/build/dex/maker-psm/maker-psm-event-pool.js +132 -0
- package/build/dex/maker-psm/maker-psm-event-pool.js.map +1 -0
- package/build/dex/maker-psm/maker-psm.d.ts +103 -0
- package/build/dex/maker-psm/maker-psm.js +493 -0
- package/build/dex/maker-psm/maker-psm.js.map +1 -0
- package/build/dex/maker-psm/types.d.ts +39 -0
- package/build/dex/maker-psm/types.js +3 -0
- package/build/dex/maker-psm/types.js.map +1 -0
- package/build/dex/miro-migrator/miro-migrator-state.d.ts +27 -0
- package/build/dex/miro-migrator/miro-migrator-state.js +89 -0
- package/build/dex/miro-migrator/miro-migrator-state.js.map +1 -0
- 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 +184 -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 +229 -0
- package/build/dex/quick-perps/pool.js.map +1 -0
- package/build/dex/quick-perps/quick-perps.d.ts +53 -0
- package/build/dex/quick-perps/quick-perps.js +247 -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 +62 -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 +203 -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 +42 -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 +182 -0
- package/build/dex/quick-perps/vault.js.map +1 -0
- package/build/dex/solidly/forks-override/aerodrome.d.ts +14 -0
- package/build/dex/solidly/forks-override/aerodrome.js +50 -0
- package/build/dex/solidly/forks-override/aerodrome.js.map +1 -0
- package/build/dex/solidly/forks-override/chronos.d.ts +23 -0
- package/build/dex/solidly/forks-override/chronos.js +141 -0
- package/build/dex/solidly/forks-override/chronos.js.map +1 -0
- package/build/dex/solidly/forks-override/usdfi.d.ts +8 -0
- package/build/dex/solidly/forks-override/usdfi.js +15 -0
- package/build/dex/solidly/forks-override/usdfi.js.map +1 -0
- package/build/dex/solidly/forks-override/velocimeter.d.ts +23 -0
- package/build/dex/solidly/forks-override/velocimeter.js +77 -0
- package/build/dex/solidly/forks-override/velocimeter.js.map +1 -0
- package/build/dex/stabull/config.d.ts +3 -0
- package/build/dex/stabull/config.js +177 -0
- package/build/dex/stabull/config.js.map +1 -0
- package/build/dex/stabull/stabull-pool.d.ts +46 -0
- package/build/dex/stabull/stabull-pool.js +113 -0
- package/build/dex/stabull/stabull-pool.js.map +1 -0
- package/build/dex/stabull/stabull.d.ts +55 -0
- package/build/dex/stabull/stabull.js +286 -0
- package/build/dex/stabull/stabull.js.map +1 -0
- package/build/dex/stabull/types.d.ts +21 -0
- package/build/dex/stabull/types.js +3 -0
- package/build/dex/stabull/types.js.map +1 -0
- package/build/dex/uniswap-v2/dfyn.d.ts +19 -0
- package/build/dex/uniswap-v2/dfyn.js +61 -0
- package/build/dex/uniswap-v2/dfyn.js.map +1 -0
- package/build/dex/uniswap-v2/excalibur.d.ts +24 -0
- package/build/dex/uniswap-v2/excalibur.js +47 -0
- package/build/dex/uniswap-v2/excalibur.js.map +1 -0
- package/build/dex/uniswap-v2/mdex.d.ts +24 -0
- package/build/dex/uniswap-v2/mdex.js +50 -0
- package/build/dex/uniswap-v2/mdex.js.map +1 -0
- package/build/dex/uniswap-v2/nomiswap-v2.d.ts +24 -0
- package/build/dex/uniswap-v2/nomiswap-v2.js +57 -0
- package/build/dex/uniswap-v2/nomiswap-v2.js.map +1 -0
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.d.ts +4 -0
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js +56 -0
- package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js.map +1 -0
- package/build/dex/uniswap-v4/contract-math/Position.d.ts +9 -0
- package/build/dex/uniswap-v4/contract-math/Position.js +39 -0
- package/build/dex/uniswap-v4/contract-math/Position.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/arena.d.ts +6 -0
- package/build/dex/uniswap-v4/hooks/arena.js +10 -0
- package/build/dex/uniswap-v4/hooks/arena.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/base-fee/base-fee-hook.d.ts +0 -0
- package/build/dex/uniswap-v4/hooks/base-fee/base-fee-hook.js +2 -0
- package/build/dex/uniswap-v4/hooks/base-fee/base-fee-hook.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.d.ts +7 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js +28 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.d.ts +0 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js +2 -0
- package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.d.ts +7 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js +28 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/types.d.ts +0 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/types.js +2 -0
- package/build/dex/uniswap-v4/hooks/fee-hook/types.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/index.d.ts +1 -0
- package/build/dex/uniswap-v4/hooks/index.js +18 -0
- package/build/dex/uniswap-v4/hooks/index.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/spot.d.ts +15 -0
- package/build/dex/uniswap-v4/hooks/spot.js +109 -0
- package/build/dex/uniswap-v4/hooks/spot.js.map +1 -0
- package/build/dex/uniswap-v4/hooks/template.d.ts +150 -0
- package/build/dex/uniswap-v4/hooks/template.js +104 -0
- package/build/dex/uniswap-v4/hooks/template.js.map +1 -0
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.d.ts +26 -0
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.js +75 -0
- package/build/dex/usdc-transmuter/usdc-transmuter-pool.js.map +1 -0
- package/build/dex/usual/usual-usdc-usdc.d.ts +17 -0
- package/build/dex/usual/usual-usdc-usdc.js +59 -0
- package/build/dex/usual/usual-usdc-usdc.js.map +1 -0
- package/build/dex/yo/config.d.ts +3 -0
- package/build/dex/yo/config.js +21 -0
- package/build/dex/yo/config.js.map +1 -0
- package/build/dex/yo/types.d.ts +13 -0
- package/build/dex/yo/types.js +3 -0
- package/build/dex/yo/types.js.map +1 -0
- package/build/dex/yo/yo-pool.d.ts +13 -0
- package/build/dex/yo/yo-pool.js +26 -0
- package/build/dex/yo/yo-pool.js.map +1 -0
- package/build/dex/yo/yo.d.ts +39 -0
- package/build/dex/yo/yo.js +248 -0
- package/build/dex/yo/yo.js.map +1 -0
- package/build/implementations/api-paraswap-sdk.d.ts +25 -0
- package/build/implementations/api-paraswap-sdk.js +102 -0
- package/build/implementations/api-paraswap-sdk.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DeepReadonly } from 'ts-essentials';
|
|
2
|
+
import { Address, Log, Logger } from '../../types';
|
|
3
|
+
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
4
|
+
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
5
|
+
import { PoolState, PoolConfig } from './types';
|
|
6
|
+
export declare class MakerPsmEventPool extends StatefulEventSubscriber<PoolState> {
|
|
7
|
+
protected network: number;
|
|
8
|
+
protected dexHelper: IDexHelper;
|
|
9
|
+
poolConfig: PoolConfig;
|
|
10
|
+
protected vatAddress: Address;
|
|
11
|
+
handlers: {
|
|
12
|
+
[event: string]: (event: any, pool: PoolState, log: Log) => PoolState;
|
|
13
|
+
};
|
|
14
|
+
logDecoder: (log: Log) => any;
|
|
15
|
+
to18ConversionFactor: bigint;
|
|
16
|
+
bytes32Tout: string;
|
|
17
|
+
bytes32Tin: string;
|
|
18
|
+
constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, poolConfig: PoolConfig, vatAddress: Address);
|
|
19
|
+
handleFile(event: any, pool: PoolState, log: Log): PoolState;
|
|
20
|
+
handleSellGem(event: any, pool: PoolState, log: Log): PoolState;
|
|
21
|
+
handleBuyGem(event: any, pool: PoolState, log: Log): PoolState;
|
|
22
|
+
getIdentifier(): string;
|
|
23
|
+
/**
|
|
24
|
+
* The function is called every time any of the subscribed
|
|
25
|
+
* addresses release log. The function accepts the current
|
|
26
|
+
* state, updates the state according to the log, and returns
|
|
27
|
+
* the updated state.
|
|
28
|
+
* @param state - Current state of event subscriber
|
|
29
|
+
* @param log - Log released by one of the subscribed addresses
|
|
30
|
+
* @returns Updates state of the event subscriber after the log
|
|
31
|
+
*/
|
|
32
|
+
protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
33
|
+
/**
|
|
34
|
+
* The function generates state using on-chain calls. This
|
|
35
|
+
* function is called to regenerate state if the event based
|
|
36
|
+
* system fails to fetch events and the local state is no
|
|
37
|
+
* more correct.
|
|
38
|
+
* @param blockNumber - Blocknumber for which the state should
|
|
39
|
+
* should be generated
|
|
40
|
+
* @returns state of the event subscriber at blocknumber
|
|
41
|
+
*/
|
|
42
|
+
generateState(blockNumber: number): Promise<Readonly<PoolState>>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MakerPsmEventPool = void 0;
|
|
7
|
+
const abi_1 = require("@ethersproject/abi");
|
|
8
|
+
const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
|
|
9
|
+
const utils_1 = require("../../utils");
|
|
10
|
+
const psm_json_1 = __importDefault(require("../../abi/maker-psm/psm.json"));
|
|
11
|
+
const vat_json_1 = __importDefault(require("../../abi/maker-psm/vat.json"));
|
|
12
|
+
const vatInterface = new abi_1.Interface(vat_json_1.default);
|
|
13
|
+
const psmInterface = new abi_1.Interface(psm_json_1.default);
|
|
14
|
+
const bigIntify = (b) => BigInt(b.toString());
|
|
15
|
+
async function getOnChainState(multiContract, poolConfigs, vatAddress, blockNumber) {
|
|
16
|
+
const callData = poolConfigs
|
|
17
|
+
.map(c => [
|
|
18
|
+
{
|
|
19
|
+
target: c.psmAddress,
|
|
20
|
+
callData: psmInterface.encodeFunctionData('tin', []),
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
target: c.psmAddress,
|
|
24
|
+
callData: psmInterface.encodeFunctionData('tout', []),
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
target: vatAddress,
|
|
28
|
+
callData: vatInterface.encodeFunctionData('ilks', [c.identifier]),
|
|
29
|
+
},
|
|
30
|
+
])
|
|
31
|
+
.flat();
|
|
32
|
+
const res = await multiContract.methods
|
|
33
|
+
.aggregate(callData)
|
|
34
|
+
.call({}, blockNumber);
|
|
35
|
+
let i = 0;
|
|
36
|
+
return poolConfigs.map(c => {
|
|
37
|
+
const tin = bigIntify(psmInterface.decodeFunctionResult('tin', res.returnData[i++])[0]);
|
|
38
|
+
const tout = bigIntify(psmInterface.decodeFunctionResult('tout', res.returnData[i++])[0]);
|
|
39
|
+
const ilks = vatInterface.decodeFunctionResult('ilks', res.returnData[i++]);
|
|
40
|
+
const Art = bigIntify(ilks.Art);
|
|
41
|
+
const line = bigIntify(ilks.line);
|
|
42
|
+
const rate = bigIntify(ilks.rate);
|
|
43
|
+
return {
|
|
44
|
+
tin,
|
|
45
|
+
tout,
|
|
46
|
+
Art,
|
|
47
|
+
line,
|
|
48
|
+
rate,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
class MakerPsmEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
|
|
53
|
+
network;
|
|
54
|
+
dexHelper;
|
|
55
|
+
poolConfig;
|
|
56
|
+
vatAddress;
|
|
57
|
+
handlers = {};
|
|
58
|
+
logDecoder;
|
|
59
|
+
to18ConversionFactor;
|
|
60
|
+
bytes32Tout = '0x746f757400000000000000000000000000000000000000000000000000000000'; // bytes32('tout')
|
|
61
|
+
bytes32Tin = '0x74696e0000000000000000000000000000000000000000000000000000000000'; // bytes32('tin')
|
|
62
|
+
constructor(parentName, network, dexHelper, logger, poolConfig, vatAddress) {
|
|
63
|
+
super(parentName, poolConfig.identifier, dexHelper, logger);
|
|
64
|
+
this.network = network;
|
|
65
|
+
this.dexHelper = dexHelper;
|
|
66
|
+
this.poolConfig = poolConfig;
|
|
67
|
+
this.vatAddress = vatAddress;
|
|
68
|
+
this.logDecoder = (log) => psmInterface.parseLog(log);
|
|
69
|
+
this.addressesSubscribed = [poolConfig.psmAddress];
|
|
70
|
+
this.to18ConversionFactor = (0, utils_1.getBigIntPow)(18 - poolConfig.gem.decimals);
|
|
71
|
+
// Add handlers
|
|
72
|
+
this.handlers['File'] = this.handleFile.bind(this);
|
|
73
|
+
this.handlers['SellGem'] = this.handleSellGem.bind(this);
|
|
74
|
+
this.handlers['BuyGem'] = this.handleBuyGem.bind(this);
|
|
75
|
+
}
|
|
76
|
+
handleFile(event, pool, log) {
|
|
77
|
+
if (event.args.what === this.bytes32Tin) {
|
|
78
|
+
pool.tin = bigIntify(event.args.data);
|
|
79
|
+
}
|
|
80
|
+
else if (event.args.what === this.bytes32Tout) {
|
|
81
|
+
pool.tout = bigIntify(event.args.data);
|
|
82
|
+
}
|
|
83
|
+
return pool;
|
|
84
|
+
}
|
|
85
|
+
handleSellGem(event, pool, log) {
|
|
86
|
+
pool.Art += bigIntify(event.args.value) * this.to18ConversionFactor;
|
|
87
|
+
return pool;
|
|
88
|
+
}
|
|
89
|
+
handleBuyGem(event, pool, log) {
|
|
90
|
+
pool.Art -= bigIntify(event.args.value) * this.to18ConversionFactor;
|
|
91
|
+
return pool;
|
|
92
|
+
}
|
|
93
|
+
getIdentifier() {
|
|
94
|
+
return `${this.parentName}_${this.poolConfig.psmAddress}`.toLowerCase();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The function is called every time any of the subscribed
|
|
98
|
+
* addresses release log. The function accepts the current
|
|
99
|
+
* state, updates the state according to the log, and returns
|
|
100
|
+
* the updated state.
|
|
101
|
+
* @param state - Current state of event subscriber
|
|
102
|
+
* @param log - Log released by one of the subscribed addresses
|
|
103
|
+
* @returns Updates state of the event subscriber after the log
|
|
104
|
+
*/
|
|
105
|
+
processLog(state, log) {
|
|
106
|
+
try {
|
|
107
|
+
const event = this.logDecoder(log);
|
|
108
|
+
if (event.name in this.handlers) {
|
|
109
|
+
return this.handlers[event.name](event, state, log);
|
|
110
|
+
}
|
|
111
|
+
return state;
|
|
112
|
+
}
|
|
113
|
+
catch (e) {
|
|
114
|
+
this.logger.error(`Error_${this.parentName}_processLog could not parse the log with topic ${log.topics}:`, e);
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The function generates state using on-chain calls. This
|
|
120
|
+
* function is called to regenerate state if the event based
|
|
121
|
+
* system fails to fetch events and the local state is no
|
|
122
|
+
* more correct.
|
|
123
|
+
* @param blockNumber - Blocknumber for which the state should
|
|
124
|
+
* should be generated
|
|
125
|
+
* @returns state of the event subscriber at blocknumber
|
|
126
|
+
*/
|
|
127
|
+
async generateState(blockNumber) {
|
|
128
|
+
return (await getOnChainState(this.dexHelper.multiContract, [this.poolConfig], this.vatAddress, blockNumber))[0];
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
exports.MakerPsmEventPool = MakerPsmEventPool;
|
|
132
|
+
//# sourceMappingURL=maker-psm-event-pool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maker-psm-event-pool.js","sourceRoot":"","sources":["../../../src/dex/maker-psm/maker-psm-event-pool.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAI/C,+EAA0E;AAC1E,uCAA2C;AAG3C,4EAAkD;AAClD,4EAAkD;AAElD,MAAM,YAAY,GAAG,IAAI,eAAS,CAAC,kBAAM,CAAC,CAAC;AAC3C,MAAM,YAAY,GAAG,IAAI,eAAS,CAAC,kBAAM,CAAC,CAAC;AAE3C,MAAM,SAAS,GAAG,CAAC,CAAM,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AAEnD,KAA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C,CAAC;YACnC,IAAI,KAAK,CAAC,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAChC,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;YACtD,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,MAAM,CAAC,KAAK,CACf,SAAS,IAAI,CAAC,UAAU,kDAAkD,GAAG,CAAC,MAAM,GAAG,EACvF,CAAC,CACF,CAAC;YACF,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,aAAa,CAAC,WAAmB;QACrC,OAAO,CACL,MAAM,eAAe,CACnB,IAAI,CAAC,SAAS,CAAC,aAAa,EAC5B,CAAC,IAAI,CAAC,UAAU,CAAC,EACjB,IAAI,CAAC,UAAU,EACf,WAAW,CACZ,CACF,CAAC,CAAC,CAAC,CAAC;IACP,CAAC;CACF;AAvGD,8CAuGC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { DeepReadonly } from 'ts-essentials';
|
|
2
|
+
import { Token, Address, ExchangePrices, PoolPrices, Log, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger, NumberAsString, DexExchangeParam, ExchangeTxInfo, PreprocessTransactionOptions } from '../../types';
|
|
3
|
+
import { SwapSide, Network } from '../../constants';
|
|
4
|
+
import { StatefulEventSubscriber } from '../../stateful-event-subscriber';
|
|
5
|
+
import { IDex } from '../../dex/idex';
|
|
6
|
+
import { IDexHelper } from '../../dex-helper/idex-helper';
|
|
7
|
+
import { MakerPsmData, PoolState, PoolConfig, MakerPsmDirectPayload } from './types';
|
|
8
|
+
import { SimpleExchange } from '../simple-exchange';
|
|
9
|
+
import { OptimalSwapExchange } from '@paraswap/core';
|
|
10
|
+
export declare class MakerPsmEventPool extends StatefulEventSubscriber<PoolState> {
|
|
11
|
+
protected network: number;
|
|
12
|
+
protected dexHelper: IDexHelper;
|
|
13
|
+
poolConfig: PoolConfig;
|
|
14
|
+
protected vatAddress: Address;
|
|
15
|
+
handlers: {
|
|
16
|
+
[event: string]: (event: any, pool: PoolState, log: Log) => PoolState;
|
|
17
|
+
};
|
|
18
|
+
logDecoder: (log: Log) => any;
|
|
19
|
+
to18ConversionFactor: bigint;
|
|
20
|
+
bytes32Tout: string;
|
|
21
|
+
bytes32Tin: string;
|
|
22
|
+
constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, poolConfig: PoolConfig, vatAddress: Address);
|
|
23
|
+
handleFile(event: any, pool: PoolState, log: Log): PoolState;
|
|
24
|
+
handleSellGem(event: any, pool: PoolState, log: Log): PoolState;
|
|
25
|
+
handleBuyGem(event: any, pool: PoolState, log: Log): PoolState;
|
|
26
|
+
getIdentifier(): string;
|
|
27
|
+
/**
|
|
28
|
+
* The function is called every time any of the subscribed
|
|
29
|
+
* addresses release log. The function accepts the current
|
|
30
|
+
* state, updates the state according to the log, and returns
|
|
31
|
+
* the updated state.
|
|
32
|
+
* @param state - Current state of event subscriber
|
|
33
|
+
* @param log - Log released by one of the subscribed addresses
|
|
34
|
+
* @returns Updates state of the event subscriber after the log
|
|
35
|
+
*/
|
|
36
|
+
protected processLog(state: DeepReadonly<PoolState>, log: Readonly<Log>): DeepReadonly<PoolState> | null;
|
|
37
|
+
/**
|
|
38
|
+
* The function generates state using on-chain calls. This
|
|
39
|
+
* function is called to regenerate state if the event based
|
|
40
|
+
* system fails to fetch events and the local state is no
|
|
41
|
+
* more correct.
|
|
42
|
+
* @param blockNumber - Blocknumber for which the state should
|
|
43
|
+
* should be generated
|
|
44
|
+
* @returns state of the event subscriber at blocknumber
|
|
45
|
+
*/
|
|
46
|
+
generateState(blockNumber: number): Promise<Readonly<PoolState>>;
|
|
47
|
+
}
|
|
48
|
+
export declare class MakerPsm extends SimpleExchange implements IDex<MakerPsmData, MakerPsmDirectPayload> {
|
|
49
|
+
protected network: Network;
|
|
50
|
+
protected dexHelper: IDexHelper;
|
|
51
|
+
protected adapters: {
|
|
52
|
+
[side: string]: {
|
|
53
|
+
name: string;
|
|
54
|
+
index: number;
|
|
55
|
+
}[] | null;
|
|
56
|
+
};
|
|
57
|
+
protected dai: Token;
|
|
58
|
+
protected vatAddress: Address;
|
|
59
|
+
protected poolConfigs: PoolConfig[];
|
|
60
|
+
protected eventPools: {
|
|
61
|
+
[gemAddress: string]: MakerPsmEventPool;
|
|
62
|
+
};
|
|
63
|
+
readonly hasConstantPriceLargeAmounts = true;
|
|
64
|
+
readonly isFeeOnTransferSupported = false;
|
|
65
|
+
static dexKeysWithNetwork: {
|
|
66
|
+
key: string;
|
|
67
|
+
networks: Network[];
|
|
68
|
+
}[];
|
|
69
|
+
logger: Logger;
|
|
70
|
+
constructor(network: Network, dexKey: string, dexHelper: IDexHelper, adapters?: {
|
|
71
|
+
[side: string]: {
|
|
72
|
+
name: string;
|
|
73
|
+
index: number;
|
|
74
|
+
}[] | null;
|
|
75
|
+
}, dai?: Token, vatAddress?: Address, poolConfigs?: PoolConfig[]);
|
|
76
|
+
static getDirectFunctionNameV6(): string[];
|
|
77
|
+
initializePricing(blockNumber: number): Promise<void>;
|
|
78
|
+
getAdapters(side: SwapSide): {
|
|
79
|
+
name: string;
|
|
80
|
+
index: number;
|
|
81
|
+
}[] | null;
|
|
82
|
+
getEventPool(srcToken: Token, destToken: Token): MakerPsmEventPool | null;
|
|
83
|
+
getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
|
|
84
|
+
getPoolState(pool: MakerPsmEventPool, blockNumber: number): Promise<PoolState>;
|
|
85
|
+
computePrices(isSrcDai: boolean, to18ConversionFactor: bigint, side: SwapSide, amounts: bigint[], poolState: PoolState): bigint[];
|
|
86
|
+
getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<MakerPsmData>>;
|
|
87
|
+
getCalldataGasCost(poolPrices: PoolPrices<MakerPsmData>): number | number[];
|
|
88
|
+
getPsmParams(srcToken: string, srcAmount: string, destAmount: string, data: MakerPsmData, side: SwapSide): {
|
|
89
|
+
isGemSell: boolean;
|
|
90
|
+
gemAmount: string;
|
|
91
|
+
};
|
|
92
|
+
getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: MakerPsmData, side: SwapSide): AdapterExchangeParam;
|
|
93
|
+
getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: MakerPsmData, side: SwapSide): Promise<SimpleExchangeParam>;
|
|
94
|
+
getTokenFromAddress(address: Address): Token;
|
|
95
|
+
preProcessTransaction?(optimalSwapExchange: OptimalSwapExchange<MakerPsmData>, srcToken: Token, destToken: Token, side: SwapSide, options: PreprocessTransactionOptions): Promise<[OptimalSwapExchange<MakerPsmData>, ExchangeTxInfo]>;
|
|
96
|
+
getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: MakerPsmData, side: SwapSide): DexExchangeParam;
|
|
97
|
+
getDirectParamV6(srcToken: Address, destToken: Address, fromAmount: NumberAsString, toAmount: NumberAsString, quotedAmount: NumberAsString, data: MakerPsmData, side: SwapSide, permit: string, uuid: string, partnerAndFee: string, beneficiary: string, blockNumber: number, contractMethod: string): {
|
|
98
|
+
params: MakerPsmDirectPayload;
|
|
99
|
+
encoder: (...params: (string | MakerPsmDirectPayload)[]) => string;
|
|
100
|
+
networkFee: string;
|
|
101
|
+
};
|
|
102
|
+
getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
|
|
103
|
+
}
|