@pendle/core-v2 5.2.0 → 5.2.1-beta-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/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleSENASY.sol/PendleSENASY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleSENASY.sol/PendleSENASY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleSUSDESY.sol/PendleSUSDESY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ethena/PendleSUSDESY.sol/PendleSUSDESY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Gains/PendleGTokenSY.sol/PendleGTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Gains/PendleGTokenSY.sol/PendleGTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Gains/PendleGUSDCSY.sol/PendleGUSDCSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Gains/PendleGUSDCSY.sol/PendleGUSDCSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Gains/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Gains/PendleGdaiSY.sol/PendleGDaiSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultERC20SY.sol/PendleKarakVaultERC20SY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultERC20SY.sol/PendleKarakVaultERC20SY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultEzETHSY.sol/PendleKarakVaultEzETHSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultEzETHSY.sol/PendleKarakVaultEzETHSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultSUSDESY.sol/PendleKarakVaultSUSDESY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultSUSDESY.sol/PendleKarakVaultSUSDESY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultSYBaseUpg.sol/PendleKarakVaultSYBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultUSDESY.sol/PendleKarakVaultUSDESY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultUSDESY.sol/PendleKarakVaultUSDESY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultWEETHSY.sol/PendleKarakVaultWEETHSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Karak/PendleKarakVaultWEETHSY.sol/PendleKarakVaultWEETHSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/KelpDAO/PendleAgETHSY.sol/PendleAgETHSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/KelpDAO/PendleAgETHSY.sol/PendleAgETHSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Mellow/PendleAmphorWstETHVaultSY.sol/PendleAmphorWstETHVaultSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Mellow/PendleAmphorWstETHVaultSY.sol/PendleAmphorWstETHVaultSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Mellow/PendleMellowVaultERC4626SYUpg.sol/PendleMellowVaultERC4626SYUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Mellow/PendleMellowVaultERC4626SYUpg.sol/PendleMellowVaultERC4626SYUpg.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Morpho/PendleMorphoMetaVaultSY.sol/PendleMorphoMetaVaultSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Morpho/PendleMorphoMetaVaultSY.sol/PendleMorphoMetaVaultSY.json +1052 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626NotRedeemableToAssetSY.sol/PendleERC4626NotRedeemableToAssetSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626NotRedeemableToAssetSY.sol/PendleERC4626NotRedeemableToAssetSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626SY.sol/PendleERC4626SY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626SY.sol/PendleERC4626SY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626SYV2.sol/PendleERC4626SYV2.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626SYV2.sol/PendleERC4626SYV2.json +1026 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626UpgSY.sol/PendleERC4626SYUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626UpgSY.sol/PendleERC4626SYUpg.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626UpgSYV2.sol/PendleERC4626SYUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleERC4626UpgSYV2.sol/PendleERC4626SYUpg.json +1000 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleSfrxEthSY.sol/PendleSfrxEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PirexETH/PendleApxETHSY.sol/PendleApxETHSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PirexETH/PendleApxETHSY.sol/PendleApxETHSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Puffer/PendlePufStETHSY.sol/PendlePufStETHSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Puffer/PendlePufStETHSY.sol/PendlePufStETHSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Puffer/PendlePufWETHSY.sol/PendlePufWETHSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Puffer/PendlePufWETHSY.sol/PendlePufWETHSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Sky/PendleSUSDSSY.sol/PendleSUSDSSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Sky/PendleSUSDSSY.sol/PendleSUSDSSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Syrup/PendleSyrupSY.sol/PendleSyrupSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Syrup/PendleSyrupSY.sol/PendleSyrupSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendEBTCSYUpg.sol/PendleZerolendEBTCSYUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendEBTCSYUpg.sol/PendleZerolendEBTCSYUpg.json +2 -2
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.json +19 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.json +196 -0
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.json +196 -78
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.json +196 -0
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.json +196 -0
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.json +196 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapLimitV3.sol/IPActionSwapLimitV3.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapLimitV3.sol/IPActionSwapLimitV3.json +2638 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.json +196 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.json +196 -0
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.json +1220 -48
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapLimitV3Events.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapLimitV3Events.json +207 -0
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.json +196 -0
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.json +196 -0
- package/build/artifacts/contracts/offchain-helpers/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +198 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.json +198 -2
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +198 -80
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +198 -2
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +198 -2
- package/build/artifacts/contracts/router/ActionSwapLimitV3.sol/ActionSwapLimitV3.dbg.json +4 -0
- package/build/artifacts/contracts/router/ActionSwapLimitV3.sol/ActionSwapLimitV3.json +2638 -0
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +198 -2
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +198 -2
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.json +2 -2
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.json +2 -2
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.json +2 -2
- package/contracts/core/StandardizedYield/implementations/Morpho/PendleMorphoMetaVaultSY.sol +21 -0
- package/contracts/core/StandardizedYield/implementations/PendleERC4626SY.sol +0 -1
- package/contracts/core/StandardizedYield/implementations/PendleERC4626SYV2.sol +88 -0
- package/contracts/core/StandardizedYield/implementations/PendleERC4626UpgSYV2.sol +83 -0
- package/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendEBTCSYUpg.sol +2 -1
- package/contracts/interfaces/IERC4626.sol +2 -0
- package/contracts/interfaces/IPActionAddRemoveLiqV3.sol +6 -6
- package/contracts/interfaces/IPActionMiscV3.sol +2 -8
- package/contracts/interfaces/IPActionSwapLimitV3.sol +42 -0
- package/contracts/interfaces/IPActionSwapPTV3.sol +4 -4
- package/contracts/interfaces/IPActionSwapYTV3.sol +4 -4
- package/contracts/interfaces/IPAllActionTypeV3.sol +4 -0
- package/contracts/interfaces/IPAllActionV3.sol +3 -1
- package/contracts/interfaces/IPAllEventsV3.sol +44 -1
- package/contracts/router/ActionAddRemoveLiqV3.sol +9 -9
- package/contracts/router/ActionMiscV3.sol +3 -17
- package/contracts/router/ActionSwapLimitV3.sol +126 -0
- package/contracts/router/ActionSwapPTV3.sol +4 -4
- package/contracts/router/ActionSwapYTV3.sol +4 -4
- package/contracts/router/base/ActionBase.sol +35 -12
- package/contracts/router/base/ActionDelegateBase.sol +1 -1
- package/deployments/1-core.json +1 -1
- package/deployments/1-markets/SUSDS-MAINNET-MAR2025-RELAUNCH.json +12 -0
- package/deployments/1-markets/USD0++-MAINNET-JUN2025.json +14 -0
- package/deployments/42161-markets/GUSDC-ARBITRUM-JUN2025.json +14 -0
- package/deployments/42161-markets/MUXLP-ARBITRUM-JUN2025.json +14 -0
- package/package.json +1 -1
- package/typechain-types/ActionAddRemoveLiqV3.ts +148 -0
- package/typechain-types/ActionMiscV3.ts +148 -44
- package/typechain-types/ActionSimple.ts +148 -0
- package/typechain-types/ActionStorageStatic.ts +148 -0
- package/typechain-types/ActionStorageV4.ts +148 -0
- package/typechain-types/ActionSwapPTV3.ts +148 -0
- package/typechain-types/ActionSwapYTV3.ts +148 -0
- package/typechain-types/IERC4626.ts +16 -0
- package/typechain-types/IPActionAddRemoveLiqV3.ts +148 -0
- package/typechain-types/IPActionMiscV3.ts +148 -44
- package/typechain-types/IPActionSimple.ts +148 -0
- package/typechain-types/IPActionStorageStatic.ts +148 -0
- package/typechain-types/IPActionStorageV4.ts +148 -0
- package/typechain-types/IPActionSwapPTV3.ts +148 -0
- package/typechain-types/IPActionSwapYTV3.ts +148 -0
- package/typechain-types/IPAllActionV3.ts +390 -20
- package/typechain-types/IPAllEventsV3.ts +148 -0
- package/typechain-types/IPRouterStatic.ts +148 -0
- package/typechain-types/PendleERC4626SYV2.ts +1281 -0
- package/typechain-types/PendleMorphoMetaVaultSY.ts +1323 -0
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +197 -1
- package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMiscV3__factory.ts +197 -79
- package/typechain-types/factories/ActionSimple__factory.ts +197 -1
- package/typechain-types/factories/ActionStorageStatic__factory.ts +197 -1
- package/typechain-types/factories/ActionStorageV4__factory.ts +197 -1
- package/typechain-types/factories/ActionSwapLimitV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTV3__factory.ts +197 -1
- package/typechain-types/factories/ActionSwapYTV3__factory.ts +197 -1
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
- package/typechain-types/factories/IERC4626__factory.ts +19 -0
- package/typechain-types/factories/IPActionAddRemoveLiqV3__factory.ts +196 -0
- package/typechain-types/factories/IPActionMiscV3__factory.ts +196 -78
- package/typechain-types/factories/IPActionSimple__factory.ts +196 -0
- package/typechain-types/factories/IPActionStorageStatic__factory.ts +196 -0
- package/typechain-types/factories/IPActionStorageV4__factory.ts +196 -0
- package/typechain-types/factories/IPActionSwapPTV3__factory.ts +196 -0
- package/typechain-types/factories/IPActionSwapYTV3__factory.ts +196 -0
- package/typechain-types/factories/IPAllActionV3__factory.ts +1220 -48
- package/typechain-types/factories/IPAllEventsV3__factory.ts +196 -0
- package/typechain-types/factories/IPRouterStatic__factory.ts +196 -0
- package/typechain-types/factories/PendleAgETHSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAmphorWstETHVaultSY__factory.ts +1 -1
- package/typechain-types/factories/PendleApxETHSY__factory.ts +1 -1
- package/typechain-types/factories/PendleERC4626NotRedeemableToAssetSY__factory.ts +1 -1
- package/typechain-types/factories/PendleERC4626SYUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleERC4626SYV2__factory.ts +1095 -0
- package/typechain-types/factories/PendleERC4626SY__factory.ts +1 -1
- package/typechain-types/factories/PendleGDaiSY__factory.ts +1 -1
- package/typechain-types/factories/PendleGTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleGUSDCSY__factory.ts +1 -1
- package/typechain-types/factories/PendleKarakVaultERC20SY__factory.ts +1 -1
- package/typechain-types/factories/PendleKarakVaultEzETHSY__factory.ts +1 -1
- package/typechain-types/factories/PendleKarakVaultSUSDESY__factory.ts +1 -1
- package/typechain-types/factories/PendleKarakVaultUSDESY__factory.ts +1 -1
- package/typechain-types/factories/PendleKarakVaultWEETHSY__factory.ts +1 -1
- package/typechain-types/factories/PendleMellowVaultERC4626SYUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMorphoMetaVaultSY__factory.ts +1125 -0
- package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
- package/typechain-types/factories/PendlePufStETHSY__factory.ts +1 -1
- package/typechain-types/factories/PendlePufWETHSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterV4__factory.ts +1 -1
- package/typechain-types/factories/PendleSENASY__factory.ts +1 -1
- package/typechain-types/factories/PendleSUSDESY__factory.ts +1 -1
- package/typechain-types/factories/PendleSUSDSSY__factory.ts +1 -1
- package/typechain-types/factories/PendleSfrxEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleSyrupSY__factory.ts +1 -1
- package/typechain-types/factories/PendleZerolendEBTCSYUpg__factory.ts +1 -1
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +54 -0
- package/typechain-types/index.ts +10 -0
|
@@ -13,7 +13,7 @@ interface IPActionSwapYTV3 is IPAllEventsV3 {
|
|
|
13
13
|
uint256 minYtOut,
|
|
14
14
|
ApproxParams calldata guessYtOut,
|
|
15
15
|
TokenInput calldata input,
|
|
16
|
-
LimitOrderData
|
|
16
|
+
LimitOrderData memory limit
|
|
17
17
|
) external payable returns (uint256 netYtOut, uint256 netSyFee, uint256 netSyInterm);
|
|
18
18
|
|
|
19
19
|
function swapExactSyForYt(
|
|
@@ -22,7 +22,7 @@ interface IPActionSwapYTV3 is IPAllEventsV3 {
|
|
|
22
22
|
uint256 exactSyIn,
|
|
23
23
|
uint256 minYtOut,
|
|
24
24
|
ApproxParams calldata guessYtOut,
|
|
25
|
-
LimitOrderData
|
|
25
|
+
LimitOrderData memory limit
|
|
26
26
|
) external returns (uint256 netYtOut, uint256 netSyFee);
|
|
27
27
|
|
|
28
28
|
function swapExactYtForToken(
|
|
@@ -30,7 +30,7 @@ interface IPActionSwapYTV3 is IPAllEventsV3 {
|
|
|
30
30
|
address market,
|
|
31
31
|
uint256 exactYtIn,
|
|
32
32
|
TokenOutput calldata output,
|
|
33
|
-
LimitOrderData
|
|
33
|
+
LimitOrderData memory limit
|
|
34
34
|
) external returns (uint256 netTokenOut, uint256 netSyFee, uint256 netSyInterm);
|
|
35
35
|
|
|
36
36
|
function swapExactYtForSy(
|
|
@@ -38,7 +38,7 @@ interface IPActionSwapYTV3 is IPAllEventsV3 {
|
|
|
38
38
|
address market,
|
|
39
39
|
uint256 exactYtIn,
|
|
40
40
|
uint256 minSyOut,
|
|
41
|
-
LimitOrderData
|
|
41
|
+
LimitOrderData memory limit
|
|
42
42
|
) external returns (uint256 netSyOut, uint256 netSyFee);
|
|
43
43
|
|
|
44
44
|
function swapExactPtForYt(
|
|
@@ -9,6 +9,7 @@ import "./IPActionMiscV3.sol";
|
|
|
9
9
|
import "./IPActionCallbackV3.sol";
|
|
10
10
|
import "./IPActionStorageV4.sol";
|
|
11
11
|
import "./IPActionSimple.sol";
|
|
12
|
+
import "./IPActionSwapLimitV3.sol";
|
|
12
13
|
|
|
13
14
|
interface IPAllActionV3 is
|
|
14
15
|
IPActionAddRemoveLiqV3,
|
|
@@ -17,5 +18,6 @@ interface IPAllActionV3 is
|
|
|
17
18
|
IPActionMiscV3,
|
|
18
19
|
IPActionCallbackV3,
|
|
19
20
|
IPActionStorageV4,
|
|
20
|
-
IPActionSimple
|
|
21
|
+
IPActionSimple,
|
|
22
|
+
IPActionSwapLimitV3
|
|
21
23
|
{}
|
|
@@ -265,10 +265,53 @@ interface IPActionStorageEvents {
|
|
|
265
265
|
event SelectorToFacetSet(bytes4 indexed selector, address indexed facet);
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
interface IPActionSwapLimitV3Events {
|
|
269
|
+
event SwapMaxPtForTokenLimitOnly(
|
|
270
|
+
address indexed caller,
|
|
271
|
+
address indexed market,
|
|
272
|
+
address indexed token,
|
|
273
|
+
address receiver,
|
|
274
|
+
uint256 maxPtIn,
|
|
275
|
+
uint256 netTokenOut,
|
|
276
|
+
uint256 netSyInterm,
|
|
277
|
+
uint256 netPtReturned
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
event SwapMaxPtForSyLimitOnly(
|
|
281
|
+
address indexed caller,
|
|
282
|
+
address indexed market,
|
|
283
|
+
address indexed receiver,
|
|
284
|
+
uint256 maxPtIn,
|
|
285
|
+
uint256 netSyOut,
|
|
286
|
+
uint256 netPtReturned
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
event SwapMaxTokenForYtLimitOnly(
|
|
290
|
+
address indexed caller,
|
|
291
|
+
address indexed market,
|
|
292
|
+
address indexed token,
|
|
293
|
+
address receiver,
|
|
294
|
+
uint256 maxTokenIn,
|
|
295
|
+
uint256 netYtOut,
|
|
296
|
+
uint256 netSyInterm,
|
|
297
|
+
uint256 netSyReturned
|
|
298
|
+
);
|
|
299
|
+
|
|
300
|
+
event SwapMaxSyForYtLimitOnly(
|
|
301
|
+
address indexed caller,
|
|
302
|
+
address indexed market,
|
|
303
|
+
address indexed receiver,
|
|
304
|
+
uint256 maxSyIn,
|
|
305
|
+
uint256 netYtOut,
|
|
306
|
+
uint256 netSyReturned
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
|
|
268
310
|
interface IPAllEventsV3 is
|
|
269
311
|
IPActionAddRemoveLiqV3Events,
|
|
270
312
|
IPActionSwapPTV3Events,
|
|
271
313
|
IPActionSwapYTV3Events,
|
|
272
314
|
IPActionMiscV3Events,
|
|
273
|
-
IPActionStorageEvents
|
|
315
|
+
IPActionStorageEvents,
|
|
316
|
+
IPActionSwapLimitV3Events
|
|
274
317
|
{}
|
|
@@ -88,7 +88,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
88
88
|
uint256 netPtIn,
|
|
89
89
|
uint256 minLpOut,
|
|
90
90
|
ApproxParams calldata guessPtSwapToSy,
|
|
91
|
-
LimitOrderData
|
|
91
|
+
LimitOrderData memory limit
|
|
92
92
|
) external returns (uint256 netLpOut, uint256 netSyFee) {
|
|
93
93
|
if (canUseOnchainApproximation(guessPtSwapToSy, limit)) {
|
|
94
94
|
return delegateToAddLiquiditySinglePtSimple(receiver, market, netPtIn, minLpOut);
|
|
@@ -140,7 +140,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
140
140
|
uint256 minLpOut,
|
|
141
141
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
142
142
|
TokenInput calldata input,
|
|
143
|
-
LimitOrderData
|
|
143
|
+
LimitOrderData memory limit
|
|
144
144
|
) external payable returns (uint256 netLpOut, uint256 netSyFee, uint256 netSyInterm) {
|
|
145
145
|
if (canUseOnchainApproximation(guessPtReceivedFromSy, limit)) {
|
|
146
146
|
return delegateToAddLiquiditySingleTokenSimple(receiver, market, minLpOut, input);
|
|
@@ -179,7 +179,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
179
179
|
uint256 netSyIn,
|
|
180
180
|
uint256 minLpOut,
|
|
181
181
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
182
|
-
LimitOrderData
|
|
182
|
+
LimitOrderData memory limit
|
|
183
183
|
) external returns (uint256 netLpOut, uint256 netSyFee) {
|
|
184
184
|
if (canUseOnchainApproximation(guessPtReceivedFromSy, limit)) {
|
|
185
185
|
return delegateToAddLiquiditySingleSySimple(receiver, market, netSyIn, minLpOut);
|
|
@@ -211,7 +211,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
211
211
|
uint256 netSyIn,
|
|
212
212
|
uint256 minLpOut,
|
|
213
213
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
214
|
-
LimitOrderData
|
|
214
|
+
LimitOrderData memory limit
|
|
215
215
|
) internal returns (uint256 netLpOut, uint256 netSyFee) {
|
|
216
216
|
uint256 netSyLeft = netSyIn;
|
|
217
217
|
uint256 netPtReceived;
|
|
@@ -397,7 +397,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
397
397
|
uint256 netLpToRemove,
|
|
398
398
|
uint256 minPtOut,
|
|
399
399
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
400
|
-
LimitOrderData
|
|
400
|
+
LimitOrderData memory limit
|
|
401
401
|
) external returns (uint256 netPtOut, uint256 netSyFee) {
|
|
402
402
|
if (canUseOnchainApproximation(guessPtReceivedFromSy, limit)) {
|
|
403
403
|
return delegateToRemoveLiquiditySinglePtSimple(receiver, market, netLpToRemove, minPtOut);
|
|
@@ -439,7 +439,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
439
439
|
address market,
|
|
440
440
|
uint256 netLpToRemove,
|
|
441
441
|
TokenOutput calldata output,
|
|
442
|
-
LimitOrderData
|
|
442
|
+
LimitOrderData memory limit
|
|
443
443
|
) external returns (uint256 netTokenOut, uint256 netSyFee, uint256 netSyInterm) {
|
|
444
444
|
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
445
445
|
|
|
@@ -466,7 +466,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
466
466
|
address market,
|
|
467
467
|
uint256 netLpToRemove,
|
|
468
468
|
uint256 minSyOut,
|
|
469
|
-
LimitOrderData
|
|
469
|
+
LimitOrderData memory limit
|
|
470
470
|
) external returns (uint256 netSyOut, uint256 netSyFee) {
|
|
471
471
|
_transferFrom(IERC20(market), msg.sender, market, netLpToRemove);
|
|
472
472
|
|
|
@@ -481,7 +481,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
481
481
|
address market,
|
|
482
482
|
uint256 netLpToRemove,
|
|
483
483
|
uint256 minSyOut,
|
|
484
|
-
LimitOrderData
|
|
484
|
+
LimitOrderData memory limit
|
|
485
485
|
) internal returns (uint256 netSyOut, uint256 netSyFee) {
|
|
486
486
|
if (IPMarket(market).isExpired()) {
|
|
487
487
|
netSyOut = __removeLpToSyAfterExpiry(receiver, market, netLpToRemove);
|
|
@@ -505,7 +505,7 @@ contract ActionAddRemoveLiqV3 is IPActionAddRemoveLiqV3, ActionBase, ActionDeleg
|
|
|
505
505
|
address receiver,
|
|
506
506
|
address market,
|
|
507
507
|
uint256 netLpToRemove,
|
|
508
|
-
LimitOrderData
|
|
508
|
+
LimitOrderData memory limit
|
|
509
509
|
) internal returns (uint256 netSyOut, uint256 netSyFee) {
|
|
510
510
|
uint256 netPtLeft;
|
|
511
511
|
|
|
@@ -205,20 +205,6 @@ contract ActionMiscV3 is IPActionMiscV3, ActionBase {
|
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
-
/// @dev Deprecated, please use swapTokensToTokens which support unwrapping ETH too
|
|
209
|
-
function swapTokenToToken(
|
|
210
|
-
address receiver,
|
|
211
|
-
uint256 minTokenOut,
|
|
212
|
-
TokenInput calldata inp
|
|
213
|
-
) external payable returns (uint256 netTokenOut) {
|
|
214
|
-
_swapTokenInput(inp);
|
|
215
|
-
|
|
216
|
-
netTokenOut = _selfBalance(inp.tokenMintSy);
|
|
217
|
-
if (netTokenOut < minTokenOut) revert("Slippage: INSUFFICIENT_TOKEN_OUT");
|
|
218
|
-
|
|
219
|
-
_transferOut(inp.tokenMintSy, receiver, netTokenOut);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
208
|
/// @dev The interface might change in the future, check with Pendle team before use
|
|
223
209
|
function swapTokenToTokenViaSy(
|
|
224
210
|
address receiver,
|
|
@@ -239,7 +225,7 @@ contract ActionMiscV3 is IPActionMiscV3, ActionBase {
|
|
|
239
225
|
uint256 netYtIn,
|
|
240
226
|
uint256 netLpIn,
|
|
241
227
|
TokenOutput calldata output,
|
|
242
|
-
LimitOrderData
|
|
228
|
+
LimitOrderData memory limit
|
|
243
229
|
) external returns (uint256 totalTokenOut, ExitPreExpReturnParams memory params) {
|
|
244
230
|
IStandardizedYield SY;
|
|
245
231
|
|
|
@@ -257,7 +243,7 @@ contract ActionMiscV3 is IPActionMiscV3, ActionBase {
|
|
|
257
243
|
uint256 netYtIn,
|
|
258
244
|
uint256 netLpIn,
|
|
259
245
|
uint256 minSyOut,
|
|
260
|
-
LimitOrderData
|
|
246
|
+
LimitOrderData memory limit
|
|
261
247
|
) external returns (ExitPreExpReturnParams memory params) {
|
|
262
248
|
(, params) = _exitPreExpToSy(false, receiver, market, netPtIn, netYtIn, netLpIn, limit);
|
|
263
249
|
require(params.totalSyOut >= minSyOut, "Slippage: INSUFFICIENT_SY_OUT");
|
|
@@ -272,7 +258,7 @@ contract ActionMiscV3 is IPActionMiscV3, ActionBase {
|
|
|
272
258
|
uint256 netPtIn,
|
|
273
259
|
uint256 netYtIn,
|
|
274
260
|
uint256 netLpIn,
|
|
275
|
-
LimitOrderData
|
|
261
|
+
LimitOrderData memory limit
|
|
276
262
|
) internal returns (IStandardizedYield SY, ExitPreExpReturnParams memory p) {
|
|
277
263
|
IPPrincipalToken PT;
|
|
278
264
|
IPYieldToken YT;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.17;
|
|
3
|
+
|
|
4
|
+
import "./base/ActionBase.sol";
|
|
5
|
+
import "../interfaces/IPActionSwapLimitV3.sol";
|
|
6
|
+
|
|
7
|
+
contract ActionSwapLimitV3 is IPActionSwapLimitV3, ActionBase {
|
|
8
|
+
using PMath for uint256;
|
|
9
|
+
|
|
10
|
+
function swapMaxPtForTokenLimitOnly(
|
|
11
|
+
address receiver,
|
|
12
|
+
address market,
|
|
13
|
+
uint256 maxPtIn,
|
|
14
|
+
uint256 minTokenPtRate,
|
|
15
|
+
TokenOutput calldata output,
|
|
16
|
+
LimitOrderData memory limit
|
|
17
|
+
) external returns (uint256 netTokenOut, uint256 netPtReturned, uint256 netSyFee, uint256 netSyInterm) {
|
|
18
|
+
(IStandardizedYield SY, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
|
|
19
|
+
_transferFrom(PT, msg.sender, address(this), maxPtIn);
|
|
20
|
+
|
|
21
|
+
(netSyInterm, netPtReturned, netSyFee) = _swapMaxPtForSyLimitOnly(address(SY), PT, maxPtIn, 0, limit);
|
|
22
|
+
|
|
23
|
+
netTokenOut = _redeemSyToToken(receiver, address(SY), netSyInterm, output, false);
|
|
24
|
+
|
|
25
|
+
uint256 netPtUsed = maxPtIn - netPtReturned;
|
|
26
|
+
if (netTokenOut.divDown(netPtUsed) < minTokenPtRate) revert("Slippage LO: INSUFFICIENT_TOKEN_OUT");
|
|
27
|
+
|
|
28
|
+
emit SwapMaxPtForTokenLimitOnly(
|
|
29
|
+
msg.sender,
|
|
30
|
+
market,
|
|
31
|
+
output.tokenOut,
|
|
32
|
+
receiver,
|
|
33
|
+
maxPtIn,
|
|
34
|
+
netTokenOut,
|
|
35
|
+
netSyInterm,
|
|
36
|
+
netPtReturned
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function swapMaxPtForSyLimitOnly(
|
|
41
|
+
address receiver,
|
|
42
|
+
address market,
|
|
43
|
+
uint256 maxPtIn,
|
|
44
|
+
uint256 minSyPtRate,
|
|
45
|
+
LimitOrderData memory limit
|
|
46
|
+
) external returns (uint256 netSyOut, uint256 netPtReturned, uint256 netSyFee) {
|
|
47
|
+
(, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
|
|
48
|
+
_transferFrom(PT, msg.sender, address(this), maxPtIn);
|
|
49
|
+
|
|
50
|
+
(netSyOut, netPtReturned, netSyFee) = _swapMaxPtForSyLimitOnly(receiver, PT, maxPtIn, minSyPtRate, limit);
|
|
51
|
+
|
|
52
|
+
emit SwapMaxPtForSyLimitOnly(msg.sender, market, receiver, maxPtIn, netSyOut, netPtReturned);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function swapMaxTokenForYtLimitOnly(
|
|
56
|
+
address receiver,
|
|
57
|
+
address market,
|
|
58
|
+
uint256 minSyInterm,
|
|
59
|
+
uint256 minYtSyRate,
|
|
60
|
+
TokenInput calldata input,
|
|
61
|
+
LimitOrderData memory limit
|
|
62
|
+
) external payable returns (uint256 netYtOut, uint256 netSyReturned, uint256 netSyFee, uint256 netSyInterm) {
|
|
63
|
+
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
64
|
+
|
|
65
|
+
netSyInterm = _mintSyFromToken(address(this), address(SY), minSyInterm, input);
|
|
66
|
+
(netYtOut, netSyReturned, netSyFee) = _swapMaxSyForYtLimitOnly(receiver, SY, netSyInterm, minYtSyRate, limit);
|
|
67
|
+
|
|
68
|
+
emit SwapMaxTokenForYtLimitOnly(
|
|
69
|
+
msg.sender,
|
|
70
|
+
market,
|
|
71
|
+
input.tokenIn,
|
|
72
|
+
receiver,
|
|
73
|
+
input.netTokenIn,
|
|
74
|
+
netYtOut,
|
|
75
|
+
netSyInterm,
|
|
76
|
+
netSyReturned
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function swapMaxSyForYtLimitOnly(
|
|
81
|
+
address receiver,
|
|
82
|
+
address market,
|
|
83
|
+
uint256 maxSyIn,
|
|
84
|
+
uint256 minYtSyRate,
|
|
85
|
+
LimitOrderData memory limit
|
|
86
|
+
) external returns (uint256 netYtOut, uint256 netSyReturned, uint256 netSyFee) {
|
|
87
|
+
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
88
|
+
|
|
89
|
+
_transferFrom(SY, msg.sender, address(this), maxSyIn);
|
|
90
|
+
(netYtOut, netSyReturned, netSyFee) = _swapMaxSyForYtLimitOnly(receiver, SY, maxSyIn, minYtSyRate, limit);
|
|
91
|
+
|
|
92
|
+
emit SwapMaxSyForYtLimitOnly(msg.sender, market, receiver, maxSyIn, netYtOut, netSyReturned);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function _swapMaxPtForSyLimitOnly(
|
|
96
|
+
address receiver,
|
|
97
|
+
IPPrincipalToken PT,
|
|
98
|
+
uint256 maxPtIn,
|
|
99
|
+
uint256 minSyPtRate,
|
|
100
|
+
LimitOrderData memory limit
|
|
101
|
+
) internal returns (uint256 netSyOut, uint256 netPtReturned, uint256 netSyFee) {
|
|
102
|
+
(netPtReturned, netSyOut, netSyFee, ) = _fillLimit(receiver, PT, maxPtIn, limit);
|
|
103
|
+
if (netSyOut == 0) revert("Slippage LO: NO_ORDER_FILLED");
|
|
104
|
+
|
|
105
|
+
uint256 netPtUsed = maxPtIn - netPtReturned;
|
|
106
|
+
if (netSyOut.divDown(netPtUsed) < minSyPtRate) revert("Slippage LO: INSUFFICIENT_SY_OUT");
|
|
107
|
+
|
|
108
|
+
_transferOut(address(PT), msg.sender, netPtReturned);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function _swapMaxSyForYtLimitOnly(
|
|
112
|
+
address receiver,
|
|
113
|
+
IStandardizedYield SY,
|
|
114
|
+
uint256 maxSyIn,
|
|
115
|
+
uint256 minYtSyRate,
|
|
116
|
+
LimitOrderData memory limit
|
|
117
|
+
) internal returns (uint256 netYtOut, uint256 netSyReturned, uint256 netSyFee) {
|
|
118
|
+
(netSyReturned, netYtOut, netSyFee, ) = _fillLimit(receiver, SY, maxSyIn, limit);
|
|
119
|
+
if (netYtOut == 0) revert("Slippage LO: NO_ORDER_FILLED");
|
|
120
|
+
|
|
121
|
+
uint256 netSyUsed = maxSyIn - netSyReturned;
|
|
122
|
+
if (netYtOut.divDown(netSyUsed) < minYtSyRate) revert("Slippage LO: INSUFFICIENT_YT_OUT");
|
|
123
|
+
|
|
124
|
+
_transferOut(address(SY), msg.sender, netSyReturned);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -16,7 +16,7 @@ contract ActionSwapPTV3 is IPActionSwapPTV3, ActionBase, ActionDelegateBase {
|
|
|
16
16
|
uint256 minPtOut,
|
|
17
17
|
ApproxParams calldata guessPtOut,
|
|
18
18
|
TokenInput calldata input,
|
|
19
|
-
LimitOrderData
|
|
19
|
+
LimitOrderData memory limit
|
|
20
20
|
) external payable returns (uint256 netPtOut, uint256 netSyFee, uint256 netSyInterm) {
|
|
21
21
|
if (canUseOnchainApproximation(guessPtOut, limit)) {
|
|
22
22
|
return delegateToSwapExactTokenForPtSimple(receiver, market, minPtOut, input);
|
|
@@ -44,7 +44,7 @@ contract ActionSwapPTV3 is IPActionSwapPTV3, ActionBase, ActionDelegateBase {
|
|
|
44
44
|
uint256 exactSyIn,
|
|
45
45
|
uint256 minPtOut,
|
|
46
46
|
ApproxParams calldata guessPtOut,
|
|
47
|
-
LimitOrderData
|
|
47
|
+
LimitOrderData memory limit
|
|
48
48
|
) external returns (uint256 netPtOut, uint256 netSyFee) {
|
|
49
49
|
if (canUseOnchainApproximation(guessPtOut, limit)) {
|
|
50
50
|
return delegateToSwapExactSyForPtSimple(receiver, market, exactSyIn, minPtOut);
|
|
@@ -63,7 +63,7 @@ contract ActionSwapPTV3 is IPActionSwapPTV3, ActionBase, ActionDelegateBase {
|
|
|
63
63
|
address market,
|
|
64
64
|
uint256 exactPtIn,
|
|
65
65
|
TokenOutput calldata output,
|
|
66
|
-
LimitOrderData
|
|
66
|
+
LimitOrderData memory limit
|
|
67
67
|
) external returns (uint256 netTokenOut, uint256 netSyFee, uint256 netSyInterm) {
|
|
68
68
|
(IStandardizedYield SY, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
|
|
69
69
|
_transferFrom(PT, msg.sender, _entry_swapExactPtForSy(market, limit), exactPtIn);
|
|
@@ -89,7 +89,7 @@ contract ActionSwapPTV3 is IPActionSwapPTV3, ActionBase, ActionDelegateBase {
|
|
|
89
89
|
address market,
|
|
90
90
|
uint256 exactPtIn,
|
|
91
91
|
uint256 minSyOut,
|
|
92
|
-
LimitOrderData
|
|
92
|
+
LimitOrderData memory limit
|
|
93
93
|
) external returns (uint256 netSyOut, uint256 netSyFee) {
|
|
94
94
|
(, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
|
|
95
95
|
_transferFrom(PT, msg.sender, _entry_swapExactPtForSy(market, limit), exactPtIn);
|
|
@@ -21,7 +21,7 @@ contract ActionSwapYTV3 is CallbackHelper, IPActionSwapYTV3, ActionBase, ActionD
|
|
|
21
21
|
uint256 minYtOut,
|
|
22
22
|
ApproxParams calldata guessYtOut,
|
|
23
23
|
TokenInput calldata input,
|
|
24
|
-
LimitOrderData
|
|
24
|
+
LimitOrderData memory limit
|
|
25
25
|
) external payable returns (uint256 netYtOut, uint256 netSyFee, uint256 netSyInterm) {
|
|
26
26
|
if (canUseOnchainApproximation(guessYtOut, limit)) {
|
|
27
27
|
return delegateToSwapExactTokenForYtSimple(receiver, market, minYtOut, input);
|
|
@@ -50,7 +50,7 @@ contract ActionSwapYTV3 is CallbackHelper, IPActionSwapYTV3, ActionBase, ActionD
|
|
|
50
50
|
uint256 exactSyIn,
|
|
51
51
|
uint256 minYtOut,
|
|
52
52
|
ApproxParams calldata guessYtOut,
|
|
53
|
-
LimitOrderData
|
|
53
|
+
LimitOrderData memory limit
|
|
54
54
|
) external returns (uint256 netYtOut, uint256 netSyFee) {
|
|
55
55
|
if (canUseOnchainApproximation(guessYtOut, limit)) {
|
|
56
56
|
return delegateToSwapExactSyForYtSimple(receiver, market, exactSyIn, minYtOut);
|
|
@@ -71,7 +71,7 @@ contract ActionSwapYTV3 is CallbackHelper, IPActionSwapYTV3, ActionBase, ActionD
|
|
|
71
71
|
address market,
|
|
72
72
|
uint256 exactYtIn,
|
|
73
73
|
TokenOutput calldata output,
|
|
74
|
-
LimitOrderData
|
|
74
|
+
LimitOrderData memory limit
|
|
75
75
|
) external returns (uint256 netTokenOut, uint256 netSyFee, uint256 netSyInterm) {
|
|
76
76
|
(IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
77
77
|
_transferFrom(YT, msg.sender, _entry_swapExactYtForSy(YT, limit), exactYtIn);
|
|
@@ -97,7 +97,7 @@ contract ActionSwapYTV3 is CallbackHelper, IPActionSwapYTV3, ActionBase, ActionD
|
|
|
97
97
|
address market,
|
|
98
98
|
uint256 exactYtIn,
|
|
99
99
|
uint256 minSyOut,
|
|
100
|
-
LimitOrderData
|
|
100
|
+
LimitOrderData memory limit
|
|
101
101
|
) external returns (uint256 netSyOut, uint256 netSyFee) {
|
|
102
102
|
(IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
103
103
|
_transferFrom(YT, msg.sender, _entry_swapExactYtForSy(YT, limit), exactYtIn);
|
|
@@ -161,7 +161,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
161
161
|
|
|
162
162
|
// ----------------- PT SWAP -----------------
|
|
163
163
|
|
|
164
|
-
function _entry_swapExactPtForSy(address market, LimitOrderData
|
|
164
|
+
function _entry_swapExactPtForSy(address market, LimitOrderData memory limit) internal view returns (address) {
|
|
165
165
|
return _entry_swapExactPtForSy(market, !_isEmptyLimit(limit));
|
|
166
166
|
}
|
|
167
167
|
|
|
@@ -174,7 +174,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
174
174
|
address market,
|
|
175
175
|
uint256 exactPtIn,
|
|
176
176
|
uint256 minSyOut,
|
|
177
|
-
LimitOrderData
|
|
177
|
+
LimitOrderData memory limit
|
|
178
178
|
) internal returns (uint256 netSyOut, uint256 netSyFee) {
|
|
179
179
|
(, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
|
|
180
180
|
|
|
@@ -202,7 +202,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
202
202
|
if (netSyOut < minSyOut) revert("Slippage: INSUFFICIENT_SY_OUT");
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
function _entry_swapExactSyForPt(address market, LimitOrderData
|
|
205
|
+
function _entry_swapExactSyForPt(address market, LimitOrderData memory limit) internal view returns (address) {
|
|
206
206
|
return _entry_swapExactSyForPt(market, !_isEmptyLimit(limit));
|
|
207
207
|
}
|
|
208
208
|
|
|
@@ -216,7 +216,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
216
216
|
uint256 exactSyIn,
|
|
217
217
|
uint256 minPtOut,
|
|
218
218
|
ApproxParams calldata guessPtOut,
|
|
219
|
-
LimitOrderData
|
|
219
|
+
LimitOrderData memory limit
|
|
220
220
|
) internal returns (uint256 netPtOut, uint256 netSyFee) {
|
|
221
221
|
(IStandardizedYield SY, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
222
222
|
uint256 netSyLeft = exactSyIn;
|
|
@@ -248,7 +248,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
248
248
|
|
|
249
249
|
// ----------------- YT SWAP -----------------
|
|
250
250
|
|
|
251
|
-
function _entry_swapExactYtForSy(IPYieldToken YT, LimitOrderData
|
|
251
|
+
function _entry_swapExactYtForSy(IPYieldToken YT, LimitOrderData memory limit) internal view returns (address) {
|
|
252
252
|
return _entry_swapExactYtForSy(YT, !_isEmptyLimit(limit));
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -263,7 +263,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
263
263
|
IPYieldToken YT,
|
|
264
264
|
uint256 exactYtIn,
|
|
265
265
|
uint256 minSyOut,
|
|
266
|
-
LimitOrderData
|
|
266
|
+
LimitOrderData memory limit
|
|
267
267
|
) internal returns (uint256 netSyOut, uint256 netSyFee) {
|
|
268
268
|
uint256 netYtLeft = exactYtIn;
|
|
269
269
|
bool doMarketOrder = true;
|
|
@@ -292,7 +292,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
292
292
|
if (netSyOut < minSyOut) revert("Slippage: INSUFFICIENT_SY_OUT");
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
function _entry_swapExactSyForYt(IPYieldToken YT, LimitOrderData
|
|
295
|
+
function _entry_swapExactSyForYt(IPYieldToken YT, LimitOrderData memory limit) internal view returns (address) {
|
|
296
296
|
return _entry_swapExactSyForYt(YT, !_isEmptyLimit(limit));
|
|
297
297
|
}
|
|
298
298
|
|
|
@@ -308,7 +308,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
308
308
|
uint256 exactSyIn,
|
|
309
309
|
uint256 minYtOut,
|
|
310
310
|
ApproxParams calldata guessYtOut,
|
|
311
|
-
LimitOrderData
|
|
311
|
+
LimitOrderData memory limit
|
|
312
312
|
) internal returns (uint256 netYtOut, uint256 netSyFee) {
|
|
313
313
|
uint256 netSyLeft = exactSyIn;
|
|
314
314
|
bool doMarketOrder = true;
|
|
@@ -346,8 +346,15 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
346
346
|
address receiver,
|
|
347
347
|
IERC20 tokenIn,
|
|
348
348
|
uint256 netInput,
|
|
349
|
-
LimitOrderData
|
|
349
|
+
LimitOrderData memory lim
|
|
350
350
|
) internal returns (uint256 netLeft, uint256 netOut, uint256 netSyFee, bool doMarketOrder) {
|
|
351
|
+
{
|
|
352
|
+
if (lim.optData.length != 0) {
|
|
353
|
+
LimitOrder_OptData_V1 memory optData = abi.decode(lim.optData, (LimitOrder_OptData_V1));
|
|
354
|
+
_scaleLimitOrderData(lim, netInput, optData.netOffchain);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
351
358
|
IPLimitRouter router = IPLimitRouter(lim.limitRouter);
|
|
352
359
|
netLeft = netInput;
|
|
353
360
|
|
|
@@ -386,13 +393,13 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
386
393
|
doMarketOrder = netLeft > netInput.mulDown(lim.epsSkipMarket);
|
|
387
394
|
}
|
|
388
395
|
|
|
389
|
-
function _isEmptyLimit(LimitOrderData
|
|
396
|
+
function _isEmptyLimit(LimitOrderData memory a) internal pure returns (bool) {
|
|
390
397
|
return a.normalFills.length == 0 && a.flashFills.length == 0;
|
|
391
398
|
}
|
|
392
399
|
|
|
393
400
|
// ----------------- ADD & REMOVE LIQUIDITY -----------------
|
|
394
401
|
|
|
395
|
-
function _entry_addLiquiditySinglePt(address market, LimitOrderData
|
|
402
|
+
function _entry_addLiquiditySinglePt(address market, LimitOrderData memory lim) internal view returns (address) {
|
|
396
403
|
return _entry_addLiquiditySinglePt(market, !_isEmptyLimit(lim));
|
|
397
404
|
}
|
|
398
405
|
|
|
@@ -400,7 +407,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
400
407
|
return hasLimitOrder ? address(this) : market;
|
|
401
408
|
}
|
|
402
409
|
|
|
403
|
-
function _entry_addLiquiditySingleSy(address market, LimitOrderData
|
|
410
|
+
function _entry_addLiquiditySingleSy(address market, LimitOrderData memory lim) internal view returns (address) {
|
|
404
411
|
return _entry_addLiquiditySingleSy(market, !_isEmptyLimit(lim));
|
|
405
412
|
}
|
|
406
413
|
|
|
@@ -423,4 +430,20 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
423
430
|
}
|
|
424
431
|
}
|
|
425
432
|
}
|
|
433
|
+
|
|
434
|
+
function _scaleLimitOrderData(
|
|
435
|
+
LimitOrderData memory limit,
|
|
436
|
+
uint256 onchainAmount,
|
|
437
|
+
uint256 offchainAmount
|
|
438
|
+
) private pure {
|
|
439
|
+
// we can't scale up. If it's equal, skip
|
|
440
|
+
if (onchainAmount >= offchainAmount) return;
|
|
441
|
+
|
|
442
|
+
for (uint256 i = 0; i < limit.normalFills.length; i++) {
|
|
443
|
+
limit.normalFills[i].makingAmount = (limit.normalFills[i].makingAmount * onchainAmount) / offchainAmount;
|
|
444
|
+
}
|
|
445
|
+
for (uint256 i = 0; i < limit.flashFills.length; i++) {
|
|
446
|
+
limit.flashFills[i].makingAmount = (limit.flashFills[i].makingAmount * onchainAmount) / offchainAmount;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
426
449
|
}
|
|
@@ -120,7 +120,7 @@ contract ActionDelegateBase is ActionBase {
|
|
|
120
120
|
|
|
121
121
|
function canUseOnchainApproximation(
|
|
122
122
|
ApproxParams calldata approx,
|
|
123
|
-
LimitOrderData
|
|
123
|
+
LimitOrderData memory limit
|
|
124
124
|
) internal pure returns (bool) {
|
|
125
125
|
return approx.guessOffchain == 0 && _isEmptyLimit(limit);
|
|
126
126
|
}
|
package/deployments/1-core.json
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"governanceProxy": "0x2aD631F72fB16d91c4953A7f4260A97C2fE2f31e",
|
|
21
21
|
"yieldContractFactory": "0x70ee0A6DB4F5a2Dc4d9c0b57bE97B9987e75BAFD",
|
|
22
22
|
"marketFactory": "0x27b1dAcd74688aF24a64BD3C9C1B143118740784",
|
|
23
|
-
"router": "
|
|
23
|
+
"router": "0xD0715C2bf65a6EE65876F30BAEEc8d57664DAB26",
|
|
24
24
|
"routerFacets": {
|
|
25
25
|
"ActionAddRemoveLiqV3": "0x07d16A6D334133039A84271d30b7317DCbd1170D",
|
|
26
26
|
"ActionSwapPTV3": "0xC3B17AbC54d6Ef30500630A776392b9aF1c5e0c0",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY sUSDS",
|
|
3
|
+
"SY": "0xBe3d4ec488A0a042BB86F9176C24f8CD54018BA7",
|
|
4
|
+
"YT": "0xe88580889A3F02a03e27f9b9c65dD43AD685fC8f",
|
|
5
|
+
"PT": "0x152b8629fee8105248bA3b7ba6afb94f7a468302",
|
|
6
|
+
"market": "0x21D85Ff3BEDFF031EF466C7d5295240C8AB2a2b8",
|
|
7
|
+
"expiry": 1743033600,
|
|
8
|
+
"scalarRoot": "66210056099000000000",
|
|
9
|
+
"initAnchor": "1028441141000000000",
|
|
10
|
+
"lnFeeRateRoot": "499875041000000",
|
|
11
|
+
"reversedFee": 0.04999999993486881
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY USD0++",
|
|
3
|
+
"SY": "0x52453825c287dDef62D647ce51C0979D27c461f7",
|
|
4
|
+
"YT": "0xEAD01319c2aB0dC2C690EfF5DfC5f465Cd38FC87",
|
|
5
|
+
"PT": "0xf696FE29Ef85E892b5926313897D178288faA07e",
|
|
6
|
+
"market": "0x048680F64d6DFf1748ba6D9a01F578433787e24B",
|
|
7
|
+
"expiry": 1750896000,
|
|
8
|
+
"scalarRoot": "25840344753000000000",
|
|
9
|
+
"initAnchor": "1094579386000000000",
|
|
10
|
+
"lnFeeRateRoot": "1998002662000000",
|
|
11
|
+
"deployTxHash": "0x84d55092d8c0a23fb5ee3801d2ed904685eb2cc289338a58aed49accac686ab9",
|
|
12
|
+
"deployBlockNumber": 21220847,
|
|
13
|
+
"reversedFee": 0.19999999993256523
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY gUSDC",
|
|
3
|
+
"SY": "0x0a9eD458E6c283D1E84237e3347333Aa08221d09",
|
|
4
|
+
"YT": "0xeb044f64aE0dFD5433726fC5418d6643897cbb6B",
|
|
5
|
+
"PT": "0x0b6121b4c00ca4FbBb6516C11eB4BF61722E0f8d",
|
|
6
|
+
"market": "0x22e0F26320aCE985e3CB2434095F18Bfe114E28e",
|
|
7
|
+
"expiry": 1750896000,
|
|
8
|
+
"scalarRoot": "21136461043000000000",
|
|
9
|
+
"initAnchor": "1094191809000000000",
|
|
10
|
+
"lnFeeRateRoot": "1998002662000000",
|
|
11
|
+
"deployTxHash": "0xab4a74917f0c839df3b13f6eb81e4286f2c3dcbf268ef51be4cf3a85f658c7ac",
|
|
12
|
+
"deployBlockNumber": 276038148,
|
|
13
|
+
"reversedFee": 0.19999999993256523
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY MUX",
|
|
3
|
+
"SY": "0x5220E1Ef8CE83Aa9fE0CCE1b8395cD698d04bc7E",
|
|
4
|
+
"YT": "0xa661223676633a701B3D1E51bd8c47e2Da07C1f6",
|
|
5
|
+
"PT": "0x9D8eADeb4e7311e340A5EE39DbF62d7694F1aa85",
|
|
6
|
+
"market": "0xF1De71573Ee482f13AE4DcF980e83bFAba8b233d",
|
|
7
|
+
"expiry": 1750896000,
|
|
8
|
+
"scalarRoot": "23175451492000000000",
|
|
9
|
+
"initAnchor": "1088578948000000000",
|
|
10
|
+
"lnFeeRateRoot": "1998002662000000",
|
|
11
|
+
"deployTxHash": "0x3500a5b6f2145e7172c6fe3a814a455b512be2b5822df332b0f4e90b2564168e",
|
|
12
|
+
"deployBlockNumber": 276038060,
|
|
13
|
+
"reversedFee": 0.19999999993256523
|
|
14
|
+
}
|