@pendle/core-v2 5.1.2-beta-2 → 5.2.0-base-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/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol/SYBaseWithoutPermitUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleAaveV3WithRewardsSYUpg.sol/PendleAaveV3WithRewardsSYUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleAaveV3WithRewardsSYUpg.sol/PendleAaveV3WithRewardsSYUpg.json +1169 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleStkGHOSY.sol/PendleStkGHOSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleStkGHOSY.sol/PendleStkGHOSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkReceiver.sol/PendleChainlinkReceiver.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkReceiver.sol/PendleChainlinkReceiver.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkRelayer.sol/PendleChainlinkRelayer.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/ChainlinkRelayer/PendleChainlinkRelayer.sol/PendleChainlinkRelayer.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/GLP/PendleGlpSY.sol/PendleGlpSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Mantle/PendleCMETHSY.sol/PendleCMETHSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Silo/PendleSiloWithIncentiveNonBorrowableSY.sol/PendleSiloWithIncentiveNonBorrowableSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendEBTCSYUpg.sol/PendleZerolendEBTCSYUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendEBTCSYUpg.sol/PendleZerolendEBTCSYUpg.json +1311 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendLBTCSYUpg.sol/PendleZerolendLBTCSYUpg.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendLBTCSYUpg.sol/PendleZerolendLBTCSYUpg.json +1226 -0
- package/build/artifacts/contracts/interfaces/AaveV3/IAaveStkGHO.sol/IAaveStkGHO.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Angle/IAngleDistributor.sol/IAngleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.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 +78 -196
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.json +0 -196
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.json +0 -196
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.json +16 -1188
- 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/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 +0 -196
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.json +0 -196
- 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/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
- 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 +2 -198
- 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 +2 -198
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +80 -198
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -198
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +2 -198
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -198
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -198
- 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/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +16 -10
- package/contracts/core/StandardizedYield/SYBaseWithoutPermitUpg.sol +7 -1
- package/contracts/core/StandardizedYield/implementations/AaveV3/{PendleAaveV3WithRewardsSY.sol → PendleAaveV3WithRewardsSYUpg.sol} +27 -45
- package/contracts/core/StandardizedYield/implementations/AaveV3/PendleStkGHOSY.sol +1 -1
- package/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendEBTCSYUpg.sol +88 -0
- package/contracts/core/StandardizedYield/implementations/Zerolend/PendleZerolendLBTCSYUpg.sol +32 -0
- package/contracts/interfaces/IPActionAddRemoveLiqV3.sol +6 -6
- package/contracts/interfaces/IPActionMiscV3.sol +8 -2
- package/contracts/interfaces/IPActionSwapPTV3.sol +4 -4
- package/contracts/interfaces/IPActionSwapYTV3.sol +4 -4
- package/contracts/interfaces/IPAllActionTypeV3.sol +0 -4
- package/contracts/interfaces/IPAllActionV3.sol +1 -3
- package/contracts/interfaces/IPAllEventsV3.sol +1 -44
- package/contracts/router/ActionAddRemoveLiqV3.sol +9 -9
- package/contracts/router/ActionMiscV3.sol +17 -3
- package/contracts/router/ActionSwapPTV3.sol +4 -4
- package/contracts/router/ActionSwapYTV3.sol +4 -4
- package/contracts/router/base/ActionBase.sol +12 -35
- package/contracts/router/base/ActionDelegateBase.sol +1 -1
- package/deployments/1-markets/ZEROLEND-EBTC-MAINNET-MAR2025.json +14 -0
- package/deployments/8453-core.json +40 -0
- package/deployments/8453-offchain-helper.json +6 -0
- package/package.json +1 -1
- package/typechain-types/ActionAddRemoveLiqV3.ts +0 -148
- package/typechain-types/ActionMiscV3.ts +44 -148
- package/typechain-types/ActionSimple.ts +0 -148
- package/typechain-types/ActionStorageStatic.ts +0 -148
- package/typechain-types/ActionStorageV4.ts +0 -148
- package/typechain-types/ActionSwapPTV3.ts +0 -148
- package/typechain-types/ActionSwapYTV3.ts +0 -148
- package/typechain-types/IPActionAddRemoveLiqV3.ts +0 -148
- package/typechain-types/IPActionMiscV3.ts +44 -148
- package/typechain-types/IPActionSimple.ts +0 -148
- package/typechain-types/IPActionStorageStatic.ts +0 -148
- package/typechain-types/IPActionStorageV4.ts +0 -148
- package/typechain-types/IPActionSwapPTV3.ts +0 -148
- package/typechain-types/IPActionSwapYTV3.ts +0 -148
- package/typechain-types/IPAllActionV3.ts +20 -390
- package/typechain-types/IPAllEventsV3.ts +0 -148
- package/typechain-types/IPRouterStatic.ts +0 -148
- package/typechain-types/PendleAaveV3WithRewardsSYUpg.ts +1498 -0
- package/typechain-types/PendleChainlinkOracle.ts +16 -16
- package/typechain-types/PendleChainlinkOracleFactory.ts +112 -33
- package/typechain-types/PendleChainlinkOracleWithQuote.ts +16 -16
- package/typechain-types/PendleZerolendEBTCSYUpg.ts +1712 -0
- package/typechain-types/PendleZerolendLBTCSYUpg.ts +1598 -0
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -197
- 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 +79 -197
- package/typechain-types/factories/ActionSimple__factory.ts +1 -197
- package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -197
- package/typechain-types/factories/ActionStorageV4__factory.ts +1 -197
- package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -197
- package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -197
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
- package/typechain-types/factories/IPActionAddRemoveLiqV3__factory.ts +0 -196
- package/typechain-types/factories/IPActionMiscV3__factory.ts +78 -196
- package/typechain-types/factories/IPActionSimple__factory.ts +0 -196
- package/typechain-types/factories/IPActionStorageStatic__factory.ts +0 -196
- package/typechain-types/factories/IPActionStorageV4__factory.ts +0 -196
- package/typechain-types/factories/IPActionSwapPTV3__factory.ts +0 -196
- package/typechain-types/factories/IPActionSwapYTV3__factory.ts +0 -196
- package/typechain-types/factories/IPAllActionV3__factory.ts +16 -1188
- package/typechain-types/factories/IPAllEventsV3__factory.ts +0 -196
- package/typechain-types/factories/IPRouterStatic__factory.ts +0 -196
- package/typechain-types/factories/PendleAaveV3WithRewardsSYUpg__factory.ts +1246 -0
- package/typechain-types/factories/PendleChainlinkOracleFactory__factory.ts +66 -23
- package/typechain-types/factories/PendleChainlinkOracleWithQuote__factory.ts +7 -12
- package/typechain-types/factories/PendleChainlinkOracle__factory.ts +7 -7
- package/typechain-types/factories/PendleChainlinkReceiver__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkRelayer__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendlePoolDeployHelper__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/PendleStkGHOSY__factory.ts +1 -1
- package/typechain-types/factories/PendleZerolendEBTCSYUpg__factory.ts +1368 -0
- package/typechain-types/factories/PendleZerolendLBTCSYUpg__factory.ts +1283 -0
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +90 -27
- package/typechain-types/index.ts +18 -6
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleAaveV3WithRewardsSY.sol/PendleAaveV3WithRewardsSY.dbg.json +0 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/AaveV3/PendleAaveV3WithRewardsSY.sol/PendleAaveV3WithRewardsSY.json +0 -1198
- package/build/artifacts/contracts/interfaces/IPActionSwapLimitV3.sol/IPActionSwapLimitV3.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPActionSwapLimitV3.sol/IPActionSwapLimitV3.json +0 -2638
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapLimitV3Events.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapLimitV3Events.json +0 -207
- package/build/artifacts/contracts/router/ActionSwapLimitV3.sol/ActionSwapLimitV3.dbg.json +0 -4
- package/build/artifacts/contracts/router/ActionSwapLimitV3.sol/ActionSwapLimitV3.json +0 -2638
- package/contracts/interfaces/IPActionSwapLimitV3.sol +0 -42
- package/contracts/router/ActionSwapLimitV3.sol +0 -126
|
@@ -29,7 +29,7 @@ interface IPActionAddRemoveLiqV3 is IPAllEventsV3 {
|
|
|
29
29
|
uint256 netPtIn,
|
|
30
30
|
uint256 minLpOut,
|
|
31
31
|
ApproxParams calldata guessPtSwapToSy,
|
|
32
|
-
LimitOrderData
|
|
32
|
+
LimitOrderData calldata limit
|
|
33
33
|
) external returns (uint256 netLpOut, uint256 netSyFee);
|
|
34
34
|
|
|
35
35
|
function addLiquiditySingleToken(
|
|
@@ -38,7 +38,7 @@ interface IPActionAddRemoveLiqV3 is IPAllEventsV3 {
|
|
|
38
38
|
uint256 minLpOut,
|
|
39
39
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
40
40
|
TokenInput calldata input,
|
|
41
|
-
LimitOrderData
|
|
41
|
+
LimitOrderData calldata limit
|
|
42
42
|
) external payable returns (uint256 netLpOut, uint256 netSyFee, uint256 netSyInterm);
|
|
43
43
|
|
|
44
44
|
function addLiquiditySingleSy(
|
|
@@ -47,7 +47,7 @@ interface IPActionAddRemoveLiqV3 is IPAllEventsV3 {
|
|
|
47
47
|
uint256 netSyIn,
|
|
48
48
|
uint256 minLpOut,
|
|
49
49
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
50
|
-
LimitOrderData
|
|
50
|
+
LimitOrderData calldata limit
|
|
51
51
|
) external returns (uint256 netLpOut, uint256 netSyFee);
|
|
52
52
|
|
|
53
53
|
function addLiquiditySingleTokenKeepYt(
|
|
@@ -88,7 +88,7 @@ interface IPActionAddRemoveLiqV3 is IPAllEventsV3 {
|
|
|
88
88
|
uint256 netLpToRemove,
|
|
89
89
|
uint256 minPtOut,
|
|
90
90
|
ApproxParams calldata guessPtReceivedFromSy,
|
|
91
|
-
LimitOrderData
|
|
91
|
+
LimitOrderData calldata limit
|
|
92
92
|
) external returns (uint256 netPtOut, uint256 netSyFee);
|
|
93
93
|
|
|
94
94
|
function removeLiquiditySingleToken(
|
|
@@ -96,7 +96,7 @@ interface IPActionAddRemoveLiqV3 is IPAllEventsV3 {
|
|
|
96
96
|
address market,
|
|
97
97
|
uint256 netLpToRemove,
|
|
98
98
|
TokenOutput calldata output,
|
|
99
|
-
LimitOrderData
|
|
99
|
+
LimitOrderData calldata limit
|
|
100
100
|
) external returns (uint256 netTokenOut, uint256 netSyFee, uint256 netSyInterm);
|
|
101
101
|
|
|
102
102
|
function removeLiquiditySingleSy(
|
|
@@ -104,6 +104,6 @@ interface IPActionAddRemoveLiqV3 is IPAllEventsV3 {
|
|
|
104
104
|
address market,
|
|
105
105
|
uint256 netLpToRemove,
|
|
106
106
|
uint256 minSyOut,
|
|
107
|
-
LimitOrderData
|
|
107
|
+
LimitOrderData calldata limit
|
|
108
108
|
) external returns (uint256 netSyOut, uint256 netSyFee);
|
|
109
109
|
}
|
|
@@ -82,6 +82,12 @@ interface IPActionMiscV3 is IPAllEventsV3 {
|
|
|
82
82
|
uint256[] calldata netSwaps
|
|
83
83
|
) external payable returns (uint256[] memory netOutFromSwaps);
|
|
84
84
|
|
|
85
|
+
function swapTokenToToken(
|
|
86
|
+
address receiver,
|
|
87
|
+
uint256 minTokenOut,
|
|
88
|
+
TokenInput calldata inp
|
|
89
|
+
) external payable returns (uint256 netTokenOut);
|
|
90
|
+
|
|
85
91
|
function swapTokenToTokenViaSy(
|
|
86
92
|
address receiver,
|
|
87
93
|
address SY,
|
|
@@ -97,7 +103,7 @@ interface IPActionMiscV3 is IPAllEventsV3 {
|
|
|
97
103
|
uint256 netYtIn,
|
|
98
104
|
uint256 netLpIn,
|
|
99
105
|
TokenOutput calldata output,
|
|
100
|
-
LimitOrderData
|
|
106
|
+
LimitOrderData calldata limit
|
|
101
107
|
) external returns (uint256 netTokenOut, ExitPreExpReturnParams memory params);
|
|
102
108
|
|
|
103
109
|
function exitPreExpToSy(
|
|
@@ -107,7 +113,7 @@ interface IPActionMiscV3 is IPAllEventsV3 {
|
|
|
107
113
|
uint256 netYtIn,
|
|
108
114
|
uint256 netLpIn,
|
|
109
115
|
uint256 minSyOut,
|
|
110
|
-
LimitOrderData
|
|
116
|
+
LimitOrderData calldata limit
|
|
111
117
|
) external returns (ExitPreExpReturnParams memory params);
|
|
112
118
|
|
|
113
119
|
function exitPostExpToToken(
|
|
@@ -13,7 +13,7 @@ interface IPActionSwapPTV3 is IPAllEventsV3 {
|
|
|
13
13
|
uint256 minPtOut,
|
|
14
14
|
ApproxParams calldata guessPtOut,
|
|
15
15
|
TokenInput calldata input,
|
|
16
|
-
LimitOrderData
|
|
16
|
+
LimitOrderData calldata limit
|
|
17
17
|
) external payable returns (uint256 netPtOut, uint256 netSyFee, uint256 netSyInterm);
|
|
18
18
|
|
|
19
19
|
function swapExactSyForPt(
|
|
@@ -22,7 +22,7 @@ interface IPActionSwapPTV3 is IPAllEventsV3 {
|
|
|
22
22
|
uint256 exactSyIn,
|
|
23
23
|
uint256 minPtOut,
|
|
24
24
|
ApproxParams calldata guessPtOut,
|
|
25
|
-
LimitOrderData
|
|
25
|
+
LimitOrderData calldata limit
|
|
26
26
|
) external returns (uint256 netPtOut, uint256 netSyFee);
|
|
27
27
|
|
|
28
28
|
function swapExactPtForToken(
|
|
@@ -30,7 +30,7 @@ interface IPActionSwapPTV3 is IPAllEventsV3 {
|
|
|
30
30
|
address market,
|
|
31
31
|
uint256 exactPtIn,
|
|
32
32
|
TokenOutput calldata output,
|
|
33
|
-
LimitOrderData
|
|
33
|
+
LimitOrderData calldata limit
|
|
34
34
|
) external returns (uint256 netTokenOut, uint256 netSyFee, uint256 netSyInterm);
|
|
35
35
|
|
|
36
36
|
function swapExactPtForSy(
|
|
@@ -38,6 +38,6 @@ interface IPActionSwapPTV3 is IPAllEventsV3 {
|
|
|
38
38
|
address market,
|
|
39
39
|
uint256 exactPtIn,
|
|
40
40
|
uint256 minSyOut,
|
|
41
|
-
LimitOrderData
|
|
41
|
+
LimitOrderData calldata limit
|
|
42
42
|
) external returns (uint256 netSyOut, uint256 netSyFee);
|
|
43
43
|
}
|
|
@@ -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 calldata 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 calldata 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 calldata 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 calldata limit
|
|
42
42
|
) external returns (uint256 netSyOut, uint256 netSyFee);
|
|
43
43
|
|
|
44
44
|
function swapExactPtForYt(
|
|
@@ -9,7 +9,6 @@ import "./IPActionMiscV3.sol";
|
|
|
9
9
|
import "./IPActionCallbackV3.sol";
|
|
10
10
|
import "./IPActionStorageV4.sol";
|
|
11
11
|
import "./IPActionSimple.sol";
|
|
12
|
-
import "./IPActionSwapLimitV3.sol";
|
|
13
12
|
|
|
14
13
|
interface IPAllActionV3 is
|
|
15
14
|
IPActionAddRemoveLiqV3,
|
|
@@ -18,6 +17,5 @@ interface IPAllActionV3 is
|
|
|
18
17
|
IPActionMiscV3,
|
|
19
18
|
IPActionCallbackV3,
|
|
20
19
|
IPActionStorageV4,
|
|
21
|
-
IPActionSimple
|
|
22
|
-
IPActionSwapLimitV3
|
|
20
|
+
IPActionSimple
|
|
23
21
|
{}
|
|
@@ -265,53 +265,10 @@ 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
|
-
|
|
310
268
|
interface IPAllEventsV3 is
|
|
311
269
|
IPActionAddRemoveLiqV3Events,
|
|
312
270
|
IPActionSwapPTV3Events,
|
|
313
271
|
IPActionSwapYTV3Events,
|
|
314
272
|
IPActionMiscV3Events,
|
|
315
|
-
IPActionStorageEvents
|
|
316
|
-
IPActionSwapLimitV3Events
|
|
273
|
+
IPActionStorageEvents
|
|
317
274
|
{}
|
|
@@ -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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata limit
|
|
509
509
|
) internal returns (uint256 netSyOut, uint256 netSyFee) {
|
|
510
510
|
uint256 netPtLeft;
|
|
511
511
|
|
|
@@ -205,6 +205,20 @@ 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
|
+
|
|
208
222
|
/// @dev The interface might change in the future, check with Pendle team before use
|
|
209
223
|
function swapTokenToTokenViaSy(
|
|
210
224
|
address receiver,
|
|
@@ -225,7 +239,7 @@ contract ActionMiscV3 is IPActionMiscV3, ActionBase {
|
|
|
225
239
|
uint256 netYtIn,
|
|
226
240
|
uint256 netLpIn,
|
|
227
241
|
TokenOutput calldata output,
|
|
228
|
-
LimitOrderData
|
|
242
|
+
LimitOrderData calldata limit
|
|
229
243
|
) external returns (uint256 totalTokenOut, ExitPreExpReturnParams memory params) {
|
|
230
244
|
IStandardizedYield SY;
|
|
231
245
|
|
|
@@ -243,7 +257,7 @@ contract ActionMiscV3 is IPActionMiscV3, ActionBase {
|
|
|
243
257
|
uint256 netYtIn,
|
|
244
258
|
uint256 netLpIn,
|
|
245
259
|
uint256 minSyOut,
|
|
246
|
-
LimitOrderData
|
|
260
|
+
LimitOrderData calldata limit
|
|
247
261
|
) external returns (ExitPreExpReturnParams memory params) {
|
|
248
262
|
(, params) = _exitPreExpToSy(false, receiver, market, netPtIn, netYtIn, netLpIn, limit);
|
|
249
263
|
require(params.totalSyOut >= minSyOut, "Slippage: INSUFFICIENT_SY_OUT");
|
|
@@ -258,7 +272,7 @@ contract ActionMiscV3 is IPActionMiscV3, ActionBase {
|
|
|
258
272
|
uint256 netPtIn,
|
|
259
273
|
uint256 netYtIn,
|
|
260
274
|
uint256 netLpIn,
|
|
261
|
-
LimitOrderData
|
|
275
|
+
LimitOrderData calldata limit
|
|
262
276
|
) internal returns (IStandardizedYield SY, ExitPreExpReturnParams memory p) {
|
|
263
277
|
IPPrincipalToken PT;
|
|
264
278
|
IPYieldToken YT;
|
|
@@ -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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata 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 calldata limit
|
|
312
312
|
) internal returns (uint256 netYtOut, uint256 netSyFee) {
|
|
313
313
|
uint256 netSyLeft = exactSyIn;
|
|
314
314
|
bool doMarketOrder = true;
|
|
@@ -346,15 +346,8 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
346
346
|
address receiver,
|
|
347
347
|
IERC20 tokenIn,
|
|
348
348
|
uint256 netInput,
|
|
349
|
-
LimitOrderData
|
|
349
|
+
LimitOrderData calldata 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
|
-
|
|
358
351
|
IPLimitRouter router = IPLimitRouter(lim.limitRouter);
|
|
359
352
|
netLeft = netInput;
|
|
360
353
|
|
|
@@ -393,13 +386,13 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
393
386
|
doMarketOrder = netLeft > netInput.mulDown(lim.epsSkipMarket);
|
|
394
387
|
}
|
|
395
388
|
|
|
396
|
-
function _isEmptyLimit(LimitOrderData
|
|
389
|
+
function _isEmptyLimit(LimitOrderData calldata a) internal pure returns (bool) {
|
|
397
390
|
return a.normalFills.length == 0 && a.flashFills.length == 0;
|
|
398
391
|
}
|
|
399
392
|
|
|
400
393
|
// ----------------- ADD & REMOVE LIQUIDITY -----------------
|
|
401
394
|
|
|
402
|
-
function _entry_addLiquiditySinglePt(address market, LimitOrderData
|
|
395
|
+
function _entry_addLiquiditySinglePt(address market, LimitOrderData calldata lim) internal view returns (address) {
|
|
403
396
|
return _entry_addLiquiditySinglePt(market, !_isEmptyLimit(lim));
|
|
404
397
|
}
|
|
405
398
|
|
|
@@ -407,7 +400,7 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
407
400
|
return hasLimitOrder ? address(this) : market;
|
|
408
401
|
}
|
|
409
402
|
|
|
410
|
-
function _entry_addLiquiditySingleSy(address market, LimitOrderData
|
|
403
|
+
function _entry_addLiquiditySingleSy(address market, LimitOrderData calldata lim) internal view returns (address) {
|
|
411
404
|
return _entry_addLiquiditySingleSy(market, !_isEmptyLimit(lim));
|
|
412
405
|
}
|
|
413
406
|
|
|
@@ -430,20 +423,4 @@ abstract contract ActionBase is TokenHelper, CallbackHelper, IPLimitOrderType {
|
|
|
430
423
|
}
|
|
431
424
|
}
|
|
432
425
|
}
|
|
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
|
-
}
|
|
449
426
|
}
|
|
@@ -120,7 +120,7 @@ contract ActionDelegateBase is ActionBase {
|
|
|
120
120
|
|
|
121
121
|
function canUseOnchainApproximation(
|
|
122
122
|
ApproxParams calldata approx,
|
|
123
|
-
LimitOrderData
|
|
123
|
+
LimitOrderData calldata limit
|
|
124
124
|
) internal pure returns (bool) {
|
|
125
125
|
return approx.guessOffchain == 0 && _isEmptyLimit(limit);
|
|
126
126
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY eBTC",
|
|
3
|
+
"SY": "0x96Af5d9e4d01FB892FD2D76bfC0e3C07AEcf8b6B",
|
|
4
|
+
"YT": "0x1477A353f248ac94b52F863E234755943a18b94c",
|
|
5
|
+
"PT": "0x8b89d5eA6C9ea52daB5834E9789aA10085c14858",
|
|
6
|
+
"market": "0x98ffeFd1a51D322c8DeF6d0Ba183e71547216F7f",
|
|
7
|
+
"expiry": 1743033600,
|
|
8
|
+
"scalarRoot": "60811184252000000000",
|
|
9
|
+
"initAnchor": "1023374949000000000",
|
|
10
|
+
"lnFeeRateRoot": "999500333000000",
|
|
11
|
+
"deployTxHash": "0xf504a5cb9f208483bce1f7b273c588d28da0fc04bda883177d0d50dbea3178a8",
|
|
12
|
+
"deployBlockNumber": 21175966,
|
|
13
|
+
"reversedFee": 0.09999999999164011
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"deployer": "0x1FcCC097db89A86Bfc474A1028F93958295b1Fb7",
|
|
3
|
+
"network": {
|
|
4
|
+
"chainId": 8453,
|
|
5
|
+
"treasury": "0xCbcb48e22622a3778b6F14C2f5d258Ba026b05e6",
|
|
6
|
+
"governance": "0x7877AdFaDEd756f3248a0EBfe8Ac2E2eF87b75Ac",
|
|
7
|
+
"devMultisig": "0x3c0f8F070E6400C1C4eD10CfF85dE4c643b66bd3",
|
|
8
|
+
"pendle": "0xA99F6e6785Da0F5d6fB42495Fe424BCE029Eeb3E",
|
|
9
|
+
"lzEndpoint": "0xb6319cC6c8c27A8F5dAF0dD3DF91EA35C4720dd7",
|
|
10
|
+
"wrappedNative": "0x4200000000000000000000000000000000000006",
|
|
11
|
+
"initialRewardFee": "30000000000000000",
|
|
12
|
+
"initialInterestFee": "30000000000000000",
|
|
13
|
+
"initialReserveFeePercent": "80",
|
|
14
|
+
"safeWaitTime": 15000,
|
|
15
|
+
"hardwareDeployer": "0xeea6F790F18563E91b18DF00B89d9f79b2E6761F"
|
|
16
|
+
},
|
|
17
|
+
"baseCodeSplitter": "0xf3f560164979fe7F8f3eb2b64669Eac00E7043A6",
|
|
18
|
+
"PENDLE": "0xA99F6e6785Da0F5d6fB42495Fe424BCE029Eeb3E",
|
|
19
|
+
"yieldContractFactoryV5": "0x963ddBB35c1AE44e2a159E3b5fb5177E0B32660d",
|
|
20
|
+
"marketFactoryV5": "0x59968008a703dC13E6beaECed644bdCe4ee45d13",
|
|
21
|
+
"router": "0x888888888889758F76e7103c6CbF23ABbF58F946",
|
|
22
|
+
"routerFacets": {
|
|
23
|
+
"ActionAddRemoveLiqV3": "0x07d16A6D334133039A84271d30b7317DCbd1170D",
|
|
24
|
+
"ActionSwapPTV3": "0xC3B17AbC54d6Ef30500630A776392b9aF1c5e0c0",
|
|
25
|
+
"ActionSwapYTV3": "0x9b1Fe315614C2888b5151B4C2efc53878f01652b",
|
|
26
|
+
"ActionMiscV3": "0x294965CEa8FECd76a910338D2CB2b75245BE5203",
|
|
27
|
+
"ActionSimple": "0x5eBD8cfDc82Fb95488eB16881a6dBc1feD598a7a",
|
|
28
|
+
"ActionCallbackV3": "0x997FBC511a8Ad11F84a400feACD66E2A3fa805d2",
|
|
29
|
+
"ActionStorageV4": "0x6a0Ed0A9193FCBe7ae9B0F3D90F88e365Cca64fC"
|
|
30
|
+
},
|
|
31
|
+
"routerStatic": "0xB4205a645c7e920BD8504181B1D7f2c5C955C3e7",
|
|
32
|
+
"pendleSwap": "0x2E6ffA05cd6920dcc0d169efce2F4C96E774eCd2",
|
|
33
|
+
"pyYtLpOracle": "0x9a9fa8338dd5e5b2188006f1cd2ef26d921650c2",
|
|
34
|
+
"reflector": "0x5039Da22E5126e7c4e9284376116716A91782faF",
|
|
35
|
+
"receiverEndpoint": "0xeE708FC793a02F1eDd5BB9DBD7fD13010D1F7136",
|
|
36
|
+
"limitRouter": "0x000000000000c9B3E2C3Ec88B1B4c0cD853f4321",
|
|
37
|
+
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
38
|
+
"vePendle": "0x051dcd6a80f11fE68F77Fb0EBdE03853FA96B1fD",
|
|
39
|
+
"gaugeController": "0x17F100fB4bE2707675c6439468d38249DD993d58"
|
|
40
|
+
}
|
package/package.json
CHANGED