@pendle/core-v2 3.0.0-beta-2 → 3.0.0-beta-3
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/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- 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/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleExternalRewardDistributor.sol/PendleExternalRewardDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleExternalRewardDistributor.sol/PendleExternalRewardDistributor.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
- package/build/artifacts/contracts/core/Market/v2/PendleMarketFactoryV2.sol/PendleMarketFactoryV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/v2/PendleMarketFactoryV2.sol/PendleMarketFactoryV2.json +2 -2
- package/build/artifacts/contracts/core/Market/v2/PendleMarketV2.sol/PendleMarketV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/v2/PendleMarketV2.sol/PendleMarketV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol/PendleAnkrBNBSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ankr/PendleAnkrBNBSY.sol/PendleAnkrBNBSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Ape/sAPE.sol/sAPE.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraEthxBbAWethSY.sol/AuraEthxBbAWethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraEthxBbAWethSY.sol/AuraEthxBbAWethSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraSwEthBbAWethSYV2.sol/AuraSwEthBbAWethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/AuraSwEthBbAWethSYV2.sol/AuraSwEthBbAWethSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraBbAWethSwethSY.sol/PendleAuraBbAWethSwethSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethAnkrethSYV2.sol/PendleAuraWethAnkrethSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethRocketEthSYV2.sol/PendleAuraWethRocketEthSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethStafiEthSY.sol/PendleAuraWethStafiEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethVethSY.sol/PendleAuraWethVethSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethVethSY.sol/PendleAuraWethVethSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWethWstethSYV2.sol/PendleAuraWethWstethSYV2.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/PendleAuraWstethAnkreth.sol/PendleAuraWstethAnkreth.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BalancerStable/base/PendleAuraBalancerStableLPSYV2.sol/PendleAuraBalancerStableLPSYV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/CamelotV1Volatile/PendleCamelotV1VolatileSY.sol/PendleCamelotV1VolatileSY.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/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Flux/FluxTokenLib.sol/FluxTokenLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Flux/FluxTokenLib.sol/FluxTokenLib.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Flux/PendleFluxLendingSY.sol/PendleFluxLendingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Flux/PendleFluxLendingSY.sol/PendleFluxLendingSY.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/GLP/PendleGlpSY.sol/PendleGlpSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/HMX/PendleHlpSY.sol/PendleHlpSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/HMX/PendleHlpSY.sol/PendleHlpSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleMantleStakedEthSY.sol/PendleMantleStakedEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleMantleStakedEthSY.sol/PendleMantleStakedEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleOracleForSyProxy.sol/PendleOracleForSyProxy.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/MantleStakedEth/PendleOracleForSyProxy.sol/PendleOracleForSyProxy.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleArbitrumStakedEthSY.sol/PendleArbitrumStakedEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleArbitrumStakedEthSY.sol/PendleArbitrumStakedEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleBridgedLSDSY.sol/PendleBridgedLSDSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleBridgedLSDSY.sol/PendleBridgedLSDSY.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/PendleEUSDSY.sol/PendleEUSDSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleEUSDSY.sol/PendleEUSDSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleGdaiSY.sol/PendleGDaiSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +2 -2
- 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/PendleStargateLPSY.sol/PendleStargateLPSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleStargateLPSY.sol/PendleStargateLPSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWbEthSY.sol/PendleWbEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWbEthSY.sol/PendleWbEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Stader/PendleETHXSY.sol/PendleETHXSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Stader/PendleETHXSY.sol/PendleETHXSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol/SwETHSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Swell/PendleSwETH.sol/SwETHSY.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol/PendleThenaSY.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Thena/PendleThenaSY.sol/PendleThenaSY.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
- package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendlePrincipalTokenV2.sol/PendlePrincipalTokenV2.json +2 -2
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldContractFactoryV2.sol/PendleYieldContractFactoryV2.json +2 -2
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContractsV2/PendleYieldTokenV2.sol/PendleYieldTokenV2.json +2 -2
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +2 -50
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +61 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMisc.sol/IPActionMisc.json +94 -20
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +40 -0
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +40 -0
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +235 -21
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/ILimitOrderCallee.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.json +43 -139
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPOrderMixin.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPOrderMixin.json +33 -139
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPOrderMixinType.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterHelper.sol/IPRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.json +2 -2
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +2 -2
- package/build/artifacts/contracts/limit/PendleOrderMixin.sol/PendleOrderMixin.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleOrderMixin.sol/PendleOrderMixin.json +47 -153
- package/build/artifacts/contracts/offchain-helpers/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketExchangeRateLib.sol/MarketExchangeRateLib.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PtAndLpToAsset.sol/PtAndLpToAsset.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PtAndLpToAsset.sol/PtAndLpToAsset.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 +2 -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/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendleLpOracleLib.sol/PendleLpOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendlePtOracle.sol/PendlePtOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PendlePtOracleLib.sol/PendlePtOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/PendleLpGlpOracle.sol/PendleLpGlpOracle.json +2 -2
- package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/samples/PendlePtGlpOracle.sol/PendlePtGlpOracle.json +2 -2
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +63 -3
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +18 -22
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +2 -2
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/PendleRouterHelper.json +2 -2
- package/build/artifacts/contracts/router/PendleRouterHelper.sol/RouterV2InterfaceForRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBaseCallback.sol/ActionBaseCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/base/SimulateHelper.sol/SimulateHelper.dbg.json +4 -0
- package/build/artifacts/contracts/router/base/SimulateHelper.sol/SimulateHelper.json +69 -0
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +2 -2
- package/build/artifacts/contracts/router/swap-aggregator/oneinch/OneInchAggregationRouterHelper.sol/OneInchAggregationRouterHelper.dbg.json +1 -1
- package/contracts/core/libraries/Errors.sol +0 -3
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +1 -1
- package/contracts/interfaces/IPActionMisc.sol +9 -2
- package/contracts/interfaces/IPLimitRouter.sol +15 -30
- package/contracts/limit/LimitMathCore.sol +54 -31
- package/contracts/limit/PendleLimitRouter.sol +3 -3
- package/contracts/limit/PendleOrderMixin.sol +172 -182
- package/contracts/router/ActionAddRemoveLiq.sol +3 -3
- package/contracts/router/ActionMisc.sol +16 -22
- package/contracts/router/PendleRouter.sol +84 -74
- package/contracts/router/base/MarketApproxLib.sol +1 -1
- package/contracts/router/base/SimulateHelper.sol +33 -0
- package/package.json +1 -1
- package/typechain-types/ActionAddRemoveLiq.ts +13 -10
- package/typechain-types/ActionMisc.ts +40 -14
- package/typechain-types/ActionSwapPT.ts +7 -4
- package/typechain-types/ActionSwapYT.ts +7 -4
- package/typechain-types/IPActionAddRemoveLiq.ts +13 -10
- package/typechain-types/IPActionMisc.ts +84 -14
- package/typechain-types/IPActionSwapPT.ts +7 -4
- package/typechain-types/IPActionSwapYT.ts +7 -4
- package/typechain-types/IPAllAction.ts +105 -32
- package/typechain-types/IPLimitRouter.ts +46 -176
- package/typechain-types/IPOrderMixin.ts +44 -174
- package/typechain-types/PendleLimitRouter.ts +47 -177
- package/typechain-types/PendleOrderMixin.ts +45 -175
- package/typechain-types/SimulateHelper.ts +146 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +62 -2
- 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/ActionMisc__factory.ts +17 -21
- package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPT__factory.ts +41 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +41 -1
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
- package/typechain-types/factories/AuraEthxBbAWethSY__factory.ts +1 -1
- package/typechain-types/factories/AuraSwEthBbAWethSYV2__factory.ts +1 -1
- package/typechain-types/factories/Broadcaster__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +1 -49
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +61 -1
- package/typechain-types/factories/IPActionMisc__factory.ts +94 -20
- package/typechain-types/factories/IPActionSwapPT__factory.ts +40 -0
- package/typechain-types/factories/IPActionSwapYT__factory.ts +40 -0
- package/typechain-types/factories/IPAllAction__factory.ts +235 -21
- package/typechain-types/factories/IPLimitRouter__factory.ts +43 -139
- package/typechain-types/factories/IPOrderMixin__factory.ts +33 -139
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleAnkrBNBSY__factory.ts +1 -1
- package/typechain-types/factories/PendleArbitrumStakedEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraBbAWethSwethSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethAnkrethSYV2__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethRocketEthSYV2__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethStafiEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethVethSY__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWethWstethSYV2__factory.ts +1 -1
- package/typechain-types/factories/PendleAuraWstethAnkreth__factory.ts +1 -1
- package/typechain-types/factories/PendleBridgedLSDSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCamelotV1VolatileSY__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkReceiver__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
- package/typechain-types/factories/PendleERC4626SY__factory.ts +1 -1
- package/typechain-types/factories/PendleETHXSY__factory.ts +1 -1
- package/typechain-types/factories/PendleEUSDSY__factory.ts +1 -1
- package/typechain-types/factories/PendleExternalRewardDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorV2__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleFluxLendingSY__factory.ts +1 -1
- package/typechain-types/factories/PendleGDaiSY__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGlpSY__factory.ts +1 -1
- package/typechain-types/factories/PendleHlpSY__factory.ts +1 -1
- package/typechain-types/factories/PendleLimitRouter__factory.ts +58 -154
- package/typechain-types/factories/PendleLooksStakingSY__factory.ts +1 -1
- package/typechain-types/factories/PendleLpGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleMantleStakedEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactoryV2__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketV2__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__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/PendleOracleForSyProxy__factory.ts +1 -1
- package/typechain-types/factories/PendleOrderMixin__factory.ts +47 -153
- package/typechain-types/factories/PendlePrincipalTokenV2__factory.ts +1 -1
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendlePtGlpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendlePtOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleSfrxEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleStargateLPSY__factory.ts +1 -1
- package/typechain-types/factories/PendleSwap__factory.ts +1 -1
- package/typechain-types/factories/PendleThenaSY__factory.ts +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWbEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactoryV2__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldTokenV2__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/PtAndLpToAsset__factory.ts +1 -1
- package/typechain-types/factories/SAPE__factory.ts +1 -1
- package/typechain-types/factories/SimulateHelper__factory.ts +84 -0
- package/typechain-types/factories/SwETHSY__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +9 -9
- package/typechain-types/index.ts +2 -2
|
@@ -33,7 +33,7 @@ abstract contract PendleOrderMixin is
|
|
|
33
33
|
using Address for address payable;
|
|
34
34
|
|
|
35
35
|
bytes32 internal constant LIMIT_ORDER_TYPEHASH = keccak256(
|
|
36
|
-
"Order(uint256 salt,uint256 expiry,uint256 nonce,uint8 orderType,address token,address YT,address maker,address receiver,uint256 makingAmount,uint256 lnImpliedRate,bytes permit)"
|
|
36
|
+
"Order(uint256 salt,uint256 expiry,uint256 nonce,uint8 orderType,address token,address YT,address maker,address receiver,uint256 makingAmount,uint256 lnImpliedRate,uint256 failSafeRate,bytes permit)"
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
uint256 internal constant _ORDER_DOES_NOT_EXIST = 0;
|
|
@@ -50,6 +50,7 @@ abstract contract PendleOrderMixin is
|
|
|
50
50
|
WNATIVE = _WNATIVE;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
+
// solhint-disable-next-line no-empty-blocks
|
|
53
54
|
receive() external payable {}
|
|
54
55
|
|
|
55
56
|
function initialize(address _feeRecipient, uint96 _lnFeeRateRoot) external initializer {
|
|
@@ -62,12 +63,12 @@ abstract contract PendleOrderMixin is
|
|
|
62
63
|
external
|
|
63
64
|
returns (uint256 actualMaking, uint256 actualTaking, uint256 totalFee)
|
|
64
65
|
{
|
|
65
|
-
OrderType orderType = params[0].order.orderType;
|
|
66
66
|
_validateOrdersSkipSig(params);
|
|
67
|
+
OrderType orderType = params[0].order.orderType;
|
|
67
68
|
if (orderType == OrderType.SY_FOR_PT || orderType == OrderType.SY_FOR_YT) {
|
|
68
|
-
return normalFillTokenForPY(params, receiver, maxTaking, callback);
|
|
69
|
+
return normalFillTokenForPY(Args(orderType, params, receiver, maxTaking, callback));
|
|
69
70
|
} else {
|
|
70
|
-
return normalFillPYForToken(params, receiver, maxTaking, callback);
|
|
71
|
+
return normalFillPYForToken(Args(orderType, params, receiver, maxTaking, callback));
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
74
|
|
|
@@ -75,38 +76,37 @@ abstract contract PendleOrderMixin is
|
|
|
75
76
|
external
|
|
76
77
|
returns (uint256 netOutputToTaker, uint256 netInputFromTaker, uint256 totalFee)
|
|
77
78
|
{
|
|
78
|
-
OrderType orderType = params[0].order.orderType;
|
|
79
79
|
_validateOrdersSkipSig(params);
|
|
80
|
+
OrderType orderType = params[0].order.orderType;
|
|
80
81
|
if (orderType == OrderType.SY_FOR_PT || orderType == OrderType.SY_FOR_YT) {
|
|
81
|
-
return flashFillTokenForPY(params, receiver, maxInput, callback);
|
|
82
|
+
return flashFillTokenForPY(Args(orderType, params, receiver, maxInput, callback));
|
|
82
83
|
} else {
|
|
83
|
-
return flashFillPYForToken(params, receiver, maxInput, callback);
|
|
84
|
+
return flashFillPYForToken(Args(orderType, params, receiver, maxInput, callback));
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
// ----------------- Core logic -----------------
|
|
88
89
|
|
|
90
|
+
// solhint-disable-next-line
|
|
89
91
|
struct Args {
|
|
92
|
+
OrderType orderType;
|
|
90
93
|
FillOrderParams[] params;
|
|
91
94
|
address receiver;
|
|
92
95
|
uint256 maxTaking; // or maxInput
|
|
93
96
|
bytes callback;
|
|
94
97
|
}
|
|
95
98
|
|
|
96
|
-
function normalFillTokenForPY(
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
Args memory a = Args(_params, _receiver, _maxTaking, _callback);
|
|
103
|
-
|
|
104
|
-
OrderType orderType = a.params[0].order.orderType;
|
|
99
|
+
function normalFillTokenForPY(Args memory a)
|
|
100
|
+
internal
|
|
101
|
+
returns (uint256 actualMaking, uint256 actualTaking, uint256 totalFee)
|
|
102
|
+
{
|
|
103
|
+
(address SY, address PT, address YT, bytes32[] memory orderHashes) =
|
|
104
|
+
_checkSig_doPermit_updMakingAndRemaining(a.params);
|
|
105
105
|
|
|
106
106
|
// Token => This
|
|
107
|
-
|
|
107
|
+
uint256[] memory fromMakers = _transferFromMakers_mintSy_updMakings(SY, a.params);
|
|
108
108
|
|
|
109
|
-
NormalResults memory out = LimitMath.calcNormalBatch(a.params,
|
|
109
|
+
NormalResults memory out = LimitMath.calcNormalBatch(a.params, YT, lnFeeRateRoot);
|
|
110
110
|
(actualMaking, actualTaking, totalFee) = (out.totalMaking - out.totalFee, out.totalTaking, out.totalFee);
|
|
111
111
|
|
|
112
112
|
require(actualTaking <= a.maxTaking, "LOP: maxTaking exceeded");
|
|
@@ -116,85 +116,75 @@ abstract contract PendleOrderMixin is
|
|
|
116
116
|
|
|
117
117
|
// callback to Taker
|
|
118
118
|
if (a.callback.length > 0) {
|
|
119
|
-
ILimitOrderCallee(msg.sender).normalFillCall(orderType, actualMaking, actualTaking, totalFee, a.callback);
|
|
119
|
+
ILimitOrderCallee(msg.sender).normalFillCall(a.orderType, actualMaking, actualTaking, totalFee, a.callback);
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
// Taker => Makers
|
|
123
|
-
address pyToMaker = (orderType == OrderType.SY_FOR_PT) ? PT : YT;
|
|
124
|
-
|
|
123
|
+
address pyToMaker = (a.orderType == OrderType.SY_FOR_PT) ? PT : YT;
|
|
124
|
+
_transferToMakers(IERC20(pyToMaker), msg.sender, a.params, out.netTakings);
|
|
125
125
|
|
|
126
126
|
// This => Fee
|
|
127
|
-
_transferOut(SY,
|
|
127
|
+
_transferOut(SY, feeRecipient, totalFee);
|
|
128
128
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
);
|
|
129
|
+
// toMakers == netTakings
|
|
130
|
+
_checkSafety_emitEvents(a.params, orderHashes, fromMakers, out.netTakings, out.netFees, out.notionalVolumes);
|
|
132
131
|
}
|
|
133
132
|
|
|
134
|
-
function normalFillPYForToken(
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
Args memory a = Args(_params, _receiver, _maxTaking, _callback);
|
|
141
|
-
|
|
142
|
-
OrderType orderType = a.params[0].order.orderType;
|
|
143
|
-
|
|
144
|
-
(address SY, address PT, address YT, OnchainParams memory onchain) = _prep(a.params, false);
|
|
133
|
+
function normalFillPYForToken(Args memory a)
|
|
134
|
+
internal
|
|
135
|
+
returns (uint256 actualMaking, uint256 actualTaking, uint256 totalFee)
|
|
136
|
+
{
|
|
137
|
+
(address SY, address PT, address YT, bytes32[] memory orderHashes) =
|
|
138
|
+
_checkSig_doPermit_updMakingAndRemaining(a.params);
|
|
145
139
|
|
|
146
|
-
NormalResults memory out = LimitMath.calcNormalBatch(a.params,
|
|
140
|
+
NormalResults memory out = LimitMath.calcNormalBatch(a.params, YT, lnFeeRateRoot);
|
|
147
141
|
(actualMaking, actualTaking, totalFee) = (out.totalMaking, out.totalTaking + out.totalFee, out.totalFee);
|
|
148
142
|
|
|
149
143
|
require(actualTaking <= a.maxTaking, "LOP: maxTaking exceeded");
|
|
150
144
|
|
|
151
145
|
// Makers => Taker
|
|
152
|
-
address pyFromMaker = (orderType == OrderType.PT_FOR_SY) ? PT : YT;
|
|
153
|
-
|
|
146
|
+
address pyFromMaker = (a.orderType == OrderType.PT_FOR_SY) ? PT : YT;
|
|
147
|
+
_transferFromMakers(IERC20(pyFromMaker), a.params, a.receiver, out.netMakings);
|
|
154
148
|
|
|
155
149
|
// callback to Taker
|
|
156
150
|
if (a.callback.length > 0) {
|
|
157
|
-
ILimitOrderCallee(msg.sender).normalFillCall(orderType, actualMaking, actualTaking, totalFee, a.callback);
|
|
151
|
+
ILimitOrderCallee(msg.sender).normalFillCall(a.orderType, actualMaking, actualTaking, totalFee, a.callback);
|
|
158
152
|
}
|
|
159
153
|
|
|
160
154
|
// Taker => This
|
|
161
155
|
_transferFrom(IERC20(SY), msg.sender, address(this), actualTaking);
|
|
162
156
|
|
|
163
157
|
// This => Makers
|
|
164
|
-
|
|
158
|
+
uint256[] memory toMakers = _redeemSy_transferToMakers(SY, a.params, out.netTakings);
|
|
165
159
|
|
|
166
160
|
// This => Fee
|
|
167
|
-
_transferOut(SY,
|
|
161
|
+
_transferOut(SY, feeRecipient, totalFee);
|
|
168
162
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
);
|
|
163
|
+
// fromMakers == netMakings
|
|
164
|
+
_checkSafety_emitEvents(a.params, orderHashes, out.netMakings, toMakers, out.netFees, out.notionalVolumes);
|
|
172
165
|
}
|
|
173
166
|
|
|
174
167
|
// ----------------- Flash functions -----------------
|
|
175
168
|
|
|
176
|
-
function flashFillTokenForPY(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
Args memory a = Args(_params, _receiver, _maxInput, _callback);
|
|
183
|
-
|
|
184
|
-
OrderType orderType = a.params[0].order.orderType;
|
|
169
|
+
function flashFillTokenForPY(Args memory a)
|
|
170
|
+
internal
|
|
171
|
+
returns (uint256 totalPYToTaker, uint256 totalSyFromTaker, uint256 totalFee)
|
|
172
|
+
{
|
|
173
|
+
(address SY, address PT, address YT, bytes32[] memory orderHashes) =
|
|
174
|
+
_checkSig_doPermit_updMakingAndRemaining(a.params);
|
|
185
175
|
|
|
186
176
|
// Token => This
|
|
187
|
-
|
|
177
|
+
uint256[] memory fromMakers = _transferFromMakers_mintSy_updMakings(SY, a.params);
|
|
188
178
|
|
|
189
179
|
NormalResults memory out;
|
|
190
|
-
(totalSyFromTaker, totalPYToTaker, totalFee, out) = LimitMath.calcFlashBatch(a.params,
|
|
180
|
+
(totalSyFromTaker, totalPYToTaker, totalFee, out) = LimitMath.calcFlashBatch(a.params, YT, lnFeeRateRoot);
|
|
191
181
|
|
|
192
182
|
require(totalSyFromTaker <= a.maxTaking, "LOP: maxInput exceeded");
|
|
193
183
|
|
|
194
184
|
// callback to Taker
|
|
195
185
|
if (a.callback.length > 0) {
|
|
196
186
|
ILimitOrderCallee(msg.sender).flashFillCall(
|
|
197
|
-
orderType, totalPYToTaker, totalSyFromTaker, totalFee, a.callback
|
|
187
|
+
a.orderType, totalPYToTaker, totalSyFromTaker, totalFee, a.callback
|
|
198
188
|
);
|
|
199
189
|
}
|
|
200
190
|
|
|
@@ -204,7 +194,7 @@ abstract contract PendleOrderMixin is
|
|
|
204
194
|
// This => YT
|
|
205
195
|
_transferOut(SY, YT, totalSyFromTaker + out.totalMaking - out.totalFee);
|
|
206
196
|
|
|
207
|
-
bool isPtToMaker = (orderType == OrderType.SY_FOR_PT);
|
|
197
|
+
bool isPtToMaker = (a.orderType == OrderType.SY_FOR_PT);
|
|
208
198
|
address pyToMaker = isPtToMaker ? PT : YT;
|
|
209
199
|
{
|
|
210
200
|
address receiverPt = isPtToMaker ? address(this) : a.receiver;
|
|
@@ -215,48 +205,42 @@ abstract contract PendleOrderMixin is
|
|
|
215
205
|
}
|
|
216
206
|
|
|
217
207
|
// This => Makers
|
|
218
|
-
|
|
208
|
+
_transferToMakers(IERC20(pyToMaker), address(this), a.params, out.netTakings);
|
|
219
209
|
|
|
220
210
|
// This => Fee
|
|
221
|
-
_transferOut(SY,
|
|
211
|
+
_transferOut(SY, feeRecipient, totalFee);
|
|
222
212
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
);
|
|
213
|
+
// toMakers == netTakings
|
|
214
|
+
_checkSafety_emitEvents(a.params, orderHashes, fromMakers, out.netTakings, out.netFees, out.notionalVolumes);
|
|
226
215
|
}
|
|
227
216
|
|
|
228
|
-
function flashFillPYForToken(
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
Args memory a = Args(_params, _receiver, _maxInput, _callback);
|
|
235
|
-
|
|
236
|
-
OrderType orderType = a.params[0].order.orderType;
|
|
237
|
-
|
|
238
|
-
(address SY, address PT, address YT, OnchainParams memory onchain) = _prep(a.params, false);
|
|
217
|
+
function flashFillPYForToken(Args memory a)
|
|
218
|
+
internal
|
|
219
|
+
returns (uint256 totalSyToTaker, uint256 totalPYFromTaker, uint256 totalFee)
|
|
220
|
+
{
|
|
221
|
+
(address SY, address PT, address YT, bytes32[] memory orderHashes) =
|
|
222
|
+
_checkSig_doPermit_updMakingAndRemaining(a.params);
|
|
239
223
|
|
|
240
224
|
NormalResults memory out;
|
|
241
|
-
(totalPYFromTaker, totalSyToTaker, totalFee, out) = LimitMath.calcFlashBatch(a.params,
|
|
225
|
+
(totalPYFromTaker, totalSyToTaker, totalFee, out) = LimitMath.calcFlashBatch(a.params, YT, lnFeeRateRoot);
|
|
242
226
|
|
|
243
227
|
require(totalPYFromTaker <= a.maxTaking, "LOP: maxInput exceeded");
|
|
244
228
|
|
|
245
229
|
// callback to Taker
|
|
246
230
|
if (a.callback.length > 0) {
|
|
247
231
|
ILimitOrderCallee(msg.sender).flashFillCall(
|
|
248
|
-
orderType, totalSyToTaker, totalPYFromTaker, totalFee, a.callback
|
|
232
|
+
a.orderType, totalSyToTaker, totalPYFromTaker, totalFee, a.callback
|
|
249
233
|
);
|
|
250
234
|
}
|
|
251
235
|
|
|
252
|
-
bool ptFromTaker = (orderType == OrderType.YT_FOR_SY);
|
|
236
|
+
bool ptFromTaker = (a.orderType == OrderType.YT_FOR_SY);
|
|
253
237
|
address pyFromTaker = ptFromTaker ? PT : YT;
|
|
254
238
|
address pyFromMaker = ptFromTaker ? YT : PT;
|
|
255
239
|
|
|
256
240
|
// Taker => YT
|
|
257
241
|
_transferFrom(IERC20(pyFromTaker), msg.sender, YT, totalPYFromTaker);
|
|
258
242
|
// Maker => YT
|
|
259
|
-
|
|
243
|
+
_transferFromMakers(IERC20(pyFromMaker), a.params, YT, out.netMakings);
|
|
260
244
|
|
|
261
245
|
// YT => This
|
|
262
246
|
IPYieldToken(YT).redeemPY(address(this));
|
|
@@ -265,24 +249,21 @@ abstract contract PendleOrderMixin is
|
|
|
265
249
|
_transferOut(SY, a.receiver, totalSyToTaker);
|
|
266
250
|
|
|
267
251
|
// This => Makers
|
|
268
|
-
|
|
252
|
+
uint256[] memory toMakers = _redeemSy_transferToMakers(SY, a.params, out.netTakings);
|
|
269
253
|
|
|
270
254
|
// This => Fee
|
|
271
|
-
_transferOut(SY,
|
|
255
|
+
_transferOut(SY, feeRecipient, totalFee);
|
|
272
256
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
);
|
|
257
|
+
// fromMakers == netMakings
|
|
258
|
+
_checkSafety_emitEvents(a.params, orderHashes, out.netMakings, toMakers, out.netFees, out.notionalVolumes);
|
|
276
259
|
}
|
|
277
260
|
|
|
278
261
|
// ----------------- verify & convert functions -----------------
|
|
279
|
-
|
|
280
262
|
function _validateOrdersSkipSig(FillOrderParams[] memory params) internal view {
|
|
281
263
|
uint256 len = params.length;
|
|
282
264
|
require(len != 0, "LOP: empty batch");
|
|
283
265
|
|
|
284
266
|
(address YT, OrderType orderType) = (params[0].order.YT, params[0].order.orderType);
|
|
285
|
-
bool isTokenOut = (orderType == OrderType.PT_FOR_SY || orderType == OrderType.YT_FOR_SY);
|
|
286
267
|
|
|
287
268
|
uint256 expiry = IPYieldToken(YT).expiry();
|
|
288
269
|
require(block.timestamp < expiry, "LOP: PY expired");
|
|
@@ -294,31 +275,16 @@ abstract contract PendleOrderMixin is
|
|
|
294
275
|
require(order.YT == YT, "LOP: not same YT");
|
|
295
276
|
require(block.timestamp < order.expiry, "LOP: order expired");
|
|
296
277
|
require(order.nonce >= nonce[order.maker], "LOP: order invalidated");
|
|
297
|
-
|
|
298
|
-
if (isTokenOut) require(order.token != WNATIVE, "LOP: invalid tokenOut");
|
|
299
|
-
// else assert(order.token!=NATIVE) // always true
|
|
300
278
|
}
|
|
301
279
|
}
|
|
302
280
|
|
|
303
|
-
function
|
|
281
|
+
function _checkSig_doPermit_updMakingAndRemaining(FillOrderParams[] memory params)
|
|
304
282
|
internal
|
|
305
|
-
returns (address SY, address PT, address YT,
|
|
283
|
+
returns (address SY, address PT, address YT, bytes32[] memory orderHashes)
|
|
306
284
|
{
|
|
307
|
-
_checkSig_doPermit_updMakingAndRemaining(params); // state changes to avoid reentrancy
|
|
308
|
-
|
|
309
|
-
YT = params[0].order.YT;
|
|
310
|
-
SY = IPYieldToken(YT).SY();
|
|
311
|
-
PT = IPYieldToken(YT).PT();
|
|
312
|
-
|
|
313
|
-
if (tokenToSy) {
|
|
314
|
-
_transferIn_mintSy(SY, params);
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
onchain = getOnchainParams(YT);
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
function _checkSig_doPermit_updMakingAndRemaining(FillOrderParams[] memory params) internal {
|
|
321
285
|
uint256 len = params.length;
|
|
286
|
+
orderHashes = new bytes32[](len);
|
|
287
|
+
|
|
322
288
|
for (uint256 i = 0; i < len; i = _inc1(i)) {
|
|
323
289
|
FillOrderParams memory param = params[i];
|
|
324
290
|
|
|
@@ -328,11 +294,44 @@ abstract contract PendleOrderMixin is
|
|
|
328
294
|
unchecked {
|
|
329
295
|
remainingMakerAmount = remainingMakerAmount - netMaking;
|
|
330
296
|
_remaining[orderHash] = remainingMakerAmount + 1;
|
|
331
|
-
|
|
332
|
-
emit OrderRemainingUpdated(orderHash, remainingMakerAmount);
|
|
333
297
|
}
|
|
334
298
|
|
|
335
299
|
param.makingAmount = netMaking;
|
|
300
|
+
|
|
301
|
+
orderHashes[i] = orderHash;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
YT = params[0].order.YT;
|
|
305
|
+
SY = IPYieldToken(YT).SY();
|
|
306
|
+
PT = IPYieldToken(YT).PT();
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function _checkSafety_emitEvents(
|
|
310
|
+
FillOrderParams[] memory params,
|
|
311
|
+
bytes32[] memory hashes,
|
|
312
|
+
uint256[] memory fromMakers,
|
|
313
|
+
uint256[] memory toMakers,
|
|
314
|
+
uint256[] memory netFees,
|
|
315
|
+
uint256[] memory notionalVolumes
|
|
316
|
+
) internal {
|
|
317
|
+
uint256 len = hashes.length;
|
|
318
|
+
|
|
319
|
+
for (uint256 i = 0; i < len; i = _inc1(i)) {
|
|
320
|
+
require(fromMakers[i].mulDown(params[i].order.failSafeRate) <= toMakers[i], "LOP: fail safe");
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
for (uint256 i = 0; i < len; i = _inc1(i)) {
|
|
324
|
+
Order memory order = params[i].order;
|
|
325
|
+
emit OrderFilled(
|
|
326
|
+
hashes[i],
|
|
327
|
+
order.orderType,
|
|
328
|
+
order.YT,
|
|
329
|
+
order.token,
|
|
330
|
+
fromMakers[i],
|
|
331
|
+
toMakers[i],
|
|
332
|
+
netFees[i],
|
|
333
|
+
notionalVolumes[i]
|
|
334
|
+
);
|
|
336
335
|
}
|
|
337
336
|
}
|
|
338
337
|
|
|
@@ -368,30 +367,27 @@ abstract contract PendleOrderMixin is
|
|
|
368
367
|
|
|
369
368
|
// ----------------- simple helper functions functions -----------------
|
|
370
369
|
|
|
371
|
-
function
|
|
370
|
+
function _transferFromMakers_mintSy_updMakings(address SY, FillOrderParams[] memory params)
|
|
371
|
+
internal
|
|
372
|
+
returns (uint256[] memory fromMakers)
|
|
373
|
+
{
|
|
372
374
|
uint256 len = params.length;
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
375
|
+
fromMakers = new uint256[](len);
|
|
376
|
+
|
|
377
|
+
for ((uint256 l, uint256 r) = (0, 0); l < len; l = r) {
|
|
378
|
+
address sharedToken = params[l].order.token;
|
|
379
|
+
uint256 totalMaking = 0;
|
|
380
|
+
for (; r < len && params[r].order.token == sharedToken; r = _inc1(r)) {
|
|
381
|
+
_transferIn(sharedToken, params[r].order.maker, params[r].makingAmount);
|
|
382
|
+
totalMaking += params[r].makingAmount;
|
|
383
|
+
fromMakers[r] = params[r].makingAmount;
|
|
384
|
+
}
|
|
379
385
|
|
|
380
|
-
|
|
381
|
-
if (isSame) totalMakingCommon += param.makingAmount;
|
|
382
|
-
}
|
|
386
|
+
if (sharedToken == SY || totalMaking == 0) continue;
|
|
383
387
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
for (uint256 i = 0; i < len; i = _inc1(i)) {
|
|
388
|
-
params[i].makingAmount = params[i].makingAmount * totalSy / totalMakingCommon;
|
|
389
|
-
}
|
|
390
|
-
} else {
|
|
391
|
-
for (uint256 i = 0; i < len; i = _inc1(i)) {
|
|
392
|
-
FillOrderParams memory param = params[i];
|
|
393
|
-
if (param.makingAmount == 0 || param.order.token == SY) continue;
|
|
394
|
-
param.makingAmount = __mintSy_Single(SY, param.order.token, param.makingAmount);
|
|
388
|
+
uint256 totalSy = __mintSy_Single(SY, sharedToken, totalMaking);
|
|
389
|
+
for (uint256 i = l; i < r; i = _inc1(i)) {
|
|
390
|
+
params[i].makingAmount = params[i].makingAmount * totalSy / totalMaking;
|
|
395
391
|
}
|
|
396
392
|
}
|
|
397
393
|
}
|
|
@@ -405,77 +401,82 @@ abstract contract PendleOrderMixin is
|
|
|
405
401
|
IStandardizedYield(SY).deposit{value: token == NATIVE ? netTokenIn : 0}(address(this), token, netTokenIn, 0);
|
|
406
402
|
}
|
|
407
403
|
|
|
408
|
-
function
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
404
|
+
function _redeemSy_transferToMakers(address SY, FillOrderParams[] memory params, uint256[] memory netSyOuts)
|
|
405
|
+
internal
|
|
406
|
+
returns (uint256[] memory toMakers)
|
|
407
|
+
{
|
|
408
|
+
// netSyOuts all > 0, guarantee in LimitMath
|
|
409
|
+
|
|
414
410
|
uint256 len = params.length;
|
|
415
|
-
|
|
411
|
+
toMakers = new uint256[](len);
|
|
412
|
+
|
|
413
|
+
for ((uint256 l, uint256 r) = (0, 0); l < len; l = r) {
|
|
414
|
+
address sharedToken = params[l].order.token;
|
|
415
|
+
uint256 totalSy = 0;
|
|
416
416
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
_transferFromMulti(IERC20(SY), address(this), params, netSyOuts);
|
|
420
|
-
return;
|
|
417
|
+
for (; r < len && __stillShared(sharedToken, params[r].order.token); r = _inc1(r)) {
|
|
418
|
+
totalSy += netSyOuts[r];
|
|
421
419
|
}
|
|
422
420
|
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
421
|
+
if (sharedToken == SY) {
|
|
422
|
+
for (uint256 i = l; i < r; i = _inc1(i)) {
|
|
423
|
+
_transferOut(SY, params[i].order.receiver, netSyOuts[i]);
|
|
424
|
+
toMakers[i] = netSyOuts[i];
|
|
425
|
+
}
|
|
426
|
+
continue;
|
|
429
427
|
}
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
428
|
+
|
|
429
|
+
if (r - l == 1) {
|
|
430
|
+
toMakers[l] = __redeemSy_Single(params[l].order.receiver, SY, sharedToken, netSyOuts[l]);
|
|
431
|
+
} else {
|
|
432
|
+
uint256 totalToken = __redeemSy_Single(address(this), SY, sharedToken, totalSy);
|
|
433
|
+
for (uint256 i = l; i < r; i = _inc1(i)) {
|
|
434
|
+
address token = params[i].order.token;
|
|
435
|
+
toMakers[i] = netSyOuts[i] * totalToken / totalSy;
|
|
436
|
+
if (sharedToken != token) {
|
|
437
|
+
// WNATIVE case
|
|
438
|
+
_wrap_unwrap_ETH(sharedToken, token, toMakers[i]);
|
|
439
|
+
}
|
|
440
|
+
_transferOut(token, params[i].order.receiver, toMakers[i]);
|
|
437
441
|
}
|
|
438
442
|
}
|
|
439
443
|
}
|
|
440
444
|
}
|
|
441
445
|
|
|
446
|
+
function __stillShared(address currentShared, address nextToken) private view returns (bool) {
|
|
447
|
+
return (currentShared == nextToken) || (currentShared == NATIVE && nextToken == WNATIVE)
|
|
448
|
+
|| (currentShared == WNATIVE && nextToken == NATIVE);
|
|
449
|
+
}
|
|
450
|
+
|
|
442
451
|
function __redeemSy_Single(address receiver, address SY, address tokenOut, uint256 netSyIn)
|
|
443
452
|
private
|
|
444
453
|
returns (uint256 netTokenOut)
|
|
445
454
|
{
|
|
446
|
-
if (tokenOut == NATIVE) {
|
|
447
|
-
address
|
|
455
|
+
if (tokenOut == NATIVE || tokenOut == WNATIVE) {
|
|
456
|
+
address otherToken = tokenOut == NATIVE ? WNATIVE : NATIVE;
|
|
457
|
+
address tokenRedeemSy = IStandardizedYield(SY).isValidTokenOut(tokenOut) ? tokenOut : otherToken;
|
|
458
|
+
|
|
448
459
|
netTokenOut = IStandardizedYield(SY).redeem(address(this), netSyIn, tokenRedeemSy, 0, false);
|
|
449
460
|
|
|
450
|
-
if (
|
|
451
|
-
_wrap_unwrap_ETH(
|
|
461
|
+
if (tokenOut != tokenRedeemSy) {
|
|
462
|
+
_wrap_unwrap_ETH(tokenRedeemSy, tokenOut, netTokenOut);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (receiver != address(this)) {
|
|
466
|
+
_transferOut(tokenOut, receiver, netTokenOut);
|
|
452
467
|
}
|
|
453
|
-
payable(receiver).sendValue(netTokenOut);
|
|
454
468
|
} else {
|
|
455
469
|
return IStandardizedYield(SY).redeem(receiver, netSyIn, tokenOut, 0, false);
|
|
456
470
|
}
|
|
457
471
|
}
|
|
458
472
|
|
|
459
|
-
function _isSameTokens(FillOrderParams[] memory params)
|
|
460
|
-
internal
|
|
461
|
-
pure
|
|
462
|
-
returns (bool, /*isSame*/ address /*commonToken*/ )
|
|
463
|
-
{
|
|
464
|
-
uint256 len = params.length;
|
|
465
|
-
address commonToken = params[0].order.token;
|
|
466
|
-
for (uint256 i = 1; i < len; i = _inc1(i)) {
|
|
467
|
-
if (params[i].order.token != commonToken) return (false, address(0));
|
|
468
|
-
}
|
|
469
|
-
return (true, commonToken);
|
|
470
|
-
}
|
|
471
|
-
|
|
472
473
|
function _inc1(uint256 i) internal pure returns (uint256) {
|
|
473
474
|
unchecked {
|
|
474
475
|
return i + 1;
|
|
475
476
|
}
|
|
476
477
|
}
|
|
477
478
|
|
|
478
|
-
function
|
|
479
|
+
function _transferFromMakers(IERC20 token, FillOrderParams[] memory params, address to, uint256[] memory netIn)
|
|
479
480
|
internal
|
|
480
481
|
{
|
|
481
482
|
uint256 len = params.length;
|
|
@@ -484,7 +485,7 @@ abstract contract PendleOrderMixin is
|
|
|
484
485
|
}
|
|
485
486
|
}
|
|
486
487
|
|
|
487
|
-
function
|
|
488
|
+
function _transferToMakers(IERC20 token, address payer, FillOrderParams[] memory params, uint256[] memory netOut)
|
|
488
489
|
internal
|
|
489
490
|
{
|
|
490
491
|
uint256 len = params.length;
|
|
@@ -499,17 +500,6 @@ abstract contract PendleOrderMixin is
|
|
|
499
500
|
}
|
|
500
501
|
}
|
|
501
502
|
|
|
502
|
-
// ----------------- Getters -----------------
|
|
503
|
-
function getOnchainParams(address YT) public returns (OnchainParams memory) {
|
|
504
|
-
uint256 timeToExpiry = IPYieldToken(YT).expiry() - block.timestamp;
|
|
505
|
-
return OnchainParams({
|
|
506
|
-
timeToExpiry: timeToExpiry,
|
|
507
|
-
pyIndex: IPYieldToken(YT).pyIndexCurrent(),
|
|
508
|
-
feeRecipient: feeRecipient,
|
|
509
|
-
lnFeeRateRoot: lnFeeRateRoot
|
|
510
|
-
});
|
|
511
|
-
}
|
|
512
|
-
|
|
513
503
|
function hashOrder(Order memory order) public view returns (bytes32) {
|
|
514
504
|
StaticOrder memory staticOrder;
|
|
515
505
|
assembly {
|
|
@@ -82,7 +82,7 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBase {
|
|
|
82
82
|
uint256 netSyReceived;
|
|
83
83
|
|
|
84
84
|
if (!_isEmptyLimit(limit)) {
|
|
85
|
-
(netPtLeft, netSyReceived, netSyFee,) = _fillLimit(
|
|
85
|
+
(netPtLeft, netSyReceived, netSyFee,) = _fillLimit(market, netPtLeft, limit);
|
|
86
86
|
_transferOut(address(PT), market, netPtLeft);
|
|
87
87
|
}
|
|
88
88
|
|
|
@@ -166,7 +166,7 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBase {
|
|
|
166
166
|
uint256 netPtReceived;
|
|
167
167
|
|
|
168
168
|
if (!_isEmptyLimit(limit)) {
|
|
169
|
-
(netSyLeft, netPtReceived, netSyFee,) = _fillLimit(
|
|
169
|
+
(netSyLeft, netPtReceived, netSyFee,) = _fillLimit(market, netSyLeft, limit);
|
|
170
170
|
_transferOut(address(SY), market, netSyLeft);
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -194,7 +194,7 @@ contract ActionAddRemoveLiq is IPActionAddRemoveLiq, ActionBase {
|
|
|
194
194
|
uint256 minLpOut,
|
|
195
195
|
uint256 minYtOut,
|
|
196
196
|
TokenInput calldata input
|
|
197
|
-
) external returns (uint256 netLpOut, uint256 netYtOut) {
|
|
197
|
+
) external payable returns (uint256 netLpOut, uint256 netYtOut) {
|
|
198
198
|
(IStandardizedYield SY,, IPYieldToken YT) = IPMarket(market).readTokens();
|
|
199
199
|
|
|
200
200
|
uint256 netSyUsed = _mintSyFromToken(address(this), address(SY), 1, input);
|