@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
|
@@ -97,14 +97,21 @@ interface IPActionMisc {
|
|
|
97
97
|
address[] calldata markets
|
|
98
98
|
) external;
|
|
99
99
|
|
|
100
|
+
function swapTokenToToken(address receiver, uint256 minTokenOut, TokenInput calldata inp)
|
|
101
|
+
external
|
|
102
|
+
payable
|
|
103
|
+
returns (uint256 netTokenOut);
|
|
104
|
+
|
|
100
105
|
function approveInf(MultiApproval[] calldata) external;
|
|
101
106
|
|
|
107
|
+
function marketsBoost(address[] memory markets) external;
|
|
108
|
+
|
|
102
109
|
function multicall(Call3[] calldata calls) external payable returns (Result[] memory returnData);
|
|
103
110
|
|
|
104
|
-
function multicallRevert(uint256 gasLimit,
|
|
111
|
+
function multicallRevert(uint256 gasLimit, bytes[] calldata callDatas)
|
|
105
112
|
external
|
|
106
113
|
payable
|
|
107
114
|
returns (bytes[] memory res, uint256[] memory gasUsed);
|
|
108
115
|
|
|
109
|
-
function callThenRevert(
|
|
116
|
+
function callThenRevert(bytes memory callData) external payable;
|
|
110
117
|
}
|
|
@@ -23,22 +23,18 @@ interface IPOrderMixinType {
|
|
|
23
23
|
address receiver;
|
|
24
24
|
uint256 makingAmount;
|
|
25
25
|
uint256 lnImpliedRate;
|
|
26
|
+
uint256 failSafeRate;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
struct NormalResults {
|
|
29
30
|
uint256 totalMaking;
|
|
30
31
|
uint256 totalTaking;
|
|
31
32
|
uint256 totalFee;
|
|
33
|
+
uint256 totalNotionalVolume;
|
|
32
34
|
uint256[] netMakings;
|
|
33
35
|
uint256[] netTakings;
|
|
34
36
|
uint256[] netFees;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
struct OnchainParams {
|
|
38
|
-
uint256 timeToExpiry;
|
|
39
|
-
uint256 pyIndex;
|
|
40
|
-
address feeRecipient;
|
|
41
|
-
uint256 lnFeeRateRoot;
|
|
37
|
+
uint256[] notionalVolumes;
|
|
42
38
|
}
|
|
43
39
|
}
|
|
44
40
|
|
|
@@ -53,6 +49,7 @@ struct Order {
|
|
|
53
49
|
address receiver;
|
|
54
50
|
uint256 makingAmount;
|
|
55
51
|
uint256 lnImpliedRate;
|
|
52
|
+
uint256 failSafeRate;
|
|
56
53
|
bytes permit; // On first fill: permit.1.call(abi.encodePacked(permit.selector, permit.2))
|
|
57
54
|
}
|
|
58
55
|
|
|
@@ -63,30 +60,17 @@ struct FillOrderParams {
|
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
interface IPOrderMixin is IPOrderMixinType {
|
|
66
|
-
event OrderCanceled(address indexed maker, bytes32 indexed orderHash
|
|
63
|
+
event OrderCanceled(address indexed maker, bytes32 indexed orderHash);
|
|
67
64
|
|
|
68
|
-
event
|
|
69
|
-
|
|
70
|
-
event NormalFill(
|
|
65
|
+
event OrderFilled(
|
|
66
|
+
bytes32 indexed orderHash,
|
|
71
67
|
OrderType indexed orderType,
|
|
72
68
|
address indexed YT,
|
|
73
|
-
address
|
|
74
|
-
uint256
|
|
75
|
-
uint256
|
|
76
|
-
uint256
|
|
77
|
-
uint256
|
|
78
|
-
uint256 rawTotalTaking
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
event FlashFill(
|
|
82
|
-
OrderType indexed orderType,
|
|
83
|
-
address indexed YT,
|
|
84
|
-
address indexed taker,
|
|
85
|
-
uint256 netOutputToTaker,
|
|
86
|
-
uint256 netInputFromTaker,
|
|
87
|
-
uint256 totalFee,
|
|
88
|
-
uint256 rawTotalMaking,
|
|
89
|
-
uint256 rawTotalTaking
|
|
69
|
+
address token,
|
|
70
|
+
uint256 netInputFromMaker,
|
|
71
|
+
uint256 netOutputToMaker,
|
|
72
|
+
uint256 feeAmount,
|
|
73
|
+
uint256 notionalVolume
|
|
90
74
|
);
|
|
91
75
|
|
|
92
76
|
/**
|
|
@@ -96,6 +80,7 @@ interface IPOrderMixin is IPOrderMixinType {
|
|
|
96
80
|
* SY_FOR_YT: (SY, YT)
|
|
97
81
|
* YT_FOR_SY: (YT, SY)
|
|
98
82
|
*/
|
|
83
|
+
// @dev actualMaking, actualTaking are in the SY form
|
|
99
84
|
function normalFill(FillOrderParams[] memory params, address receiver, uint256 maxTaking, bytes calldata callback)
|
|
100
85
|
external
|
|
101
86
|
returns (uint256 actualMaking, uint256 actualTaking, uint256 totalFee);
|
|
@@ -107,6 +92,8 @@ interface IPOrderMixin is IPOrderMixinType {
|
|
|
107
92
|
* SY_FOR_YT: (PT, SY)
|
|
108
93
|
* YT_FOR_SY: (SY, PT)
|
|
109
94
|
*/
|
|
95
|
+
|
|
96
|
+
// @dev netOutputToTaker, netInputFromTaker are in the SY form
|
|
110
97
|
function flashFill(FillOrderParams[] memory params, address receiver, uint256 maxInput, bytes calldata callback)
|
|
111
98
|
external
|
|
112
99
|
returns (uint256 netOutputToTaker, uint256 netInputFromTaker, uint256 totalFee);
|
|
@@ -116,8 +103,6 @@ interface IPOrderMixin is IPOrderMixinType {
|
|
|
116
103
|
function lnFeeRateRoot() external view returns (uint96);
|
|
117
104
|
|
|
118
105
|
function hashOrder(Order memory order) external view returns (bytes32);
|
|
119
|
-
|
|
120
|
-
function getOnchainParams(address YT) external returns (OnchainParams memory);
|
|
121
106
|
}
|
|
122
107
|
|
|
123
108
|
interface ILimitOrderCallee is IPOrderMixinType {
|
|
@@ -12,107 +12,130 @@ library LimitMathCore {
|
|
|
12
12
|
using PMath for uint256;
|
|
13
13
|
using PMath for int256;
|
|
14
14
|
|
|
15
|
-
function calcNormalBatch(FillOrderParams[] memory params,
|
|
15
|
+
function calcNormalBatch(FillOrderParams[] memory params, address YT, uint256 lnFeeRateRoot)
|
|
16
16
|
internal
|
|
17
|
-
pure
|
|
18
17
|
returns (IPOrderMixinType.NormalResults memory out)
|
|
19
18
|
{
|
|
19
|
+
return calcNormalBatch(
|
|
20
|
+
params, IPYieldToken(YT).expiry() - block.timestamp, IPYieldToken(YT).pyIndexCurrent(), lnFeeRateRoot
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function calcFlashBatch(FillOrderParams[] memory params, address YT, uint256 lnFeeRateRoot)
|
|
25
|
+
internal
|
|
26
|
+
returns (
|
|
27
|
+
uint256 netInputFromTaker,
|
|
28
|
+
uint256 netOutputToTaker,
|
|
29
|
+
uint256 netFee,
|
|
30
|
+
IPOrderMixinType.NormalResults memory out
|
|
31
|
+
)
|
|
32
|
+
{
|
|
33
|
+
(, function (uint256, uint256, uint256, PYIndex) internal pure returns (uint256, uint256) calcFlash) =
|
|
34
|
+
getCalcFunctions(params[0].order.orderType);
|
|
35
|
+
|
|
36
|
+
uint256 timeToExpiry = IPYieldToken(YT).expiry() - block.timestamp;
|
|
37
|
+
uint256 pyIndex = IPYieldToken(YT).pyIndexCurrent();
|
|
38
|
+
|
|
39
|
+
out = calcNormalBatch(params, timeToExpiry, pyIndex, lnFeeRateRoot);
|
|
40
|
+
(netInputFromTaker, netOutputToTaker) =
|
|
41
|
+
calcFlash(out.totalMaking, out.totalTaking, out.totalFee, PYIndex.wrap(pyIndex));
|
|
42
|
+
netFee = out.totalFee;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// --- PURE FUNCTIONS ---
|
|
46
|
+
function calcNormalBatch(
|
|
47
|
+
FillOrderParams[] memory params,
|
|
48
|
+
uint256 timeToExpiry,
|
|
49
|
+
uint256 pyIndex,
|
|
50
|
+
uint256 lnFeeRateRoot
|
|
51
|
+
) internal pure returns (IPOrderMixinType.NormalResults memory out) {
|
|
20
52
|
uint256 len = params.length;
|
|
21
53
|
out.netMakings = new uint256[](len);
|
|
22
54
|
out.netTakings = new uint256[](len);
|
|
23
55
|
out.netFees = new uint256[](len);
|
|
56
|
+
out.notionalVolumes = new uint256[](len);
|
|
24
57
|
|
|
25
|
-
(function (uint256, uint256, PYIndex, uint256) internal pure returns (uint256, uint256) calcNormal,) =
|
|
58
|
+
(function (uint256, uint256, PYIndex, uint256) internal pure returns (uint256, uint256, uint256) calcNormal,) =
|
|
26
59
|
getCalcFunctions(params[0].order.orderType);
|
|
27
60
|
|
|
28
|
-
uint256 feeRate = impliedRateToExchangeRate(
|
|
61
|
+
uint256 feeRate = impliedRateToExchangeRate(lnFeeRateRoot, timeToExpiry);
|
|
29
62
|
|
|
30
63
|
for (uint256 i = 0; i < len; i = inc1(i)) {
|
|
31
64
|
FillOrderParams memory param = params[i];
|
|
32
65
|
if (param.makingAmount == 0) continue; // nothing changes
|
|
33
66
|
|
|
34
|
-
uint256 exchangeRate = impliedRateToExchangeRate(param.order.lnImpliedRate,
|
|
67
|
+
uint256 exchangeRate = impliedRateToExchangeRate(param.order.lnImpliedRate, timeToExpiry);
|
|
35
68
|
|
|
36
69
|
out.netMakings[i] = param.makingAmount;
|
|
37
|
-
(out.netTakings[i], out.netFees[i]) =
|
|
38
|
-
calcNormal(out.netMakings[i], exchangeRate, PYIndex.wrap(
|
|
70
|
+
(out.netTakings[i], out.netFees[i], out.notionalVolumes[i]) =
|
|
71
|
+
calcNormal(out.netMakings[i], exchangeRate, PYIndex.wrap(pyIndex), feeRate);
|
|
39
72
|
|
|
40
73
|
require(out.netTakings[i] > 0, "LOP: can't swap 0 amount");
|
|
41
74
|
|
|
42
75
|
out.totalMaking += out.netMakings[i];
|
|
43
76
|
out.totalTaking += out.netTakings[i];
|
|
44
77
|
out.totalFee += out.netFees[i];
|
|
78
|
+
out.totalNotionalVolume += out.notionalVolumes[i];
|
|
45
79
|
}
|
|
46
80
|
}
|
|
47
81
|
|
|
48
|
-
function calcFlashBatch(FillOrderParams[] memory params, IPOrderMixinType.OnchainParams memory onchain)
|
|
49
|
-
internal
|
|
50
|
-
pure
|
|
51
|
-
returns (
|
|
52
|
-
uint256 netInputFromTaker,
|
|
53
|
-
uint256 netOutputToTaker,
|
|
54
|
-
uint256 netFee,
|
|
55
|
-
IPOrderMixinType.NormalResults memory out
|
|
56
|
-
)
|
|
57
|
-
{
|
|
58
|
-
(, function (uint256, uint256, uint256, PYIndex) internal pure returns (uint256, uint256) calcFlash) =
|
|
59
|
-
getCalcFunctions(params[0].order.orderType);
|
|
60
|
-
|
|
61
|
-
out = calcNormalBatch(params, onchain);
|
|
62
|
-
(netInputFromTaker, netOutputToTaker) =
|
|
63
|
-
calcFlash(out.totalMaking, out.totalTaking, out.totalFee, PYIndex.wrap(onchain.pyIndex));
|
|
64
|
-
netFee = out.totalFee;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
82
|
function calcSyForPtNormal(uint256 makeSy, uint256 r, PYIndex index, uint256 f)
|
|
68
83
|
internal
|
|
69
84
|
pure
|
|
70
|
-
returns (uint256 takePt, uint256 fee)
|
|
85
|
+
returns (uint256 takePt, uint256 fee, uint256 notionalVolume)
|
|
71
86
|
{
|
|
72
87
|
// takePt = makeSy * index * r
|
|
73
88
|
// fee = makeSy * (f - 1)
|
|
89
|
+
// notionalVolume = makeSy
|
|
74
90
|
|
|
75
91
|
takePt = index.syToAsset(makeSy).mulDown(r);
|
|
76
92
|
fee = makeSy.mulDown(f - PMath.ONE);
|
|
93
|
+
notionalVolume = makeSy;
|
|
77
94
|
}
|
|
78
95
|
|
|
79
96
|
function calcPtForSyNormal(uint256 makePt, uint256 r, PYIndex index, uint256 f)
|
|
80
97
|
internal
|
|
81
98
|
pure
|
|
82
|
-
returns (uint256 takeSy, uint256 fee)
|
|
99
|
+
returns (uint256 takeSy, uint256 fee, uint256 notionalVolume)
|
|
83
100
|
{
|
|
84
101
|
// takeAsset = make / r
|
|
85
102
|
// takeSy = takeAsset / index
|
|
86
103
|
// fee = takeSy * (f-1)/f
|
|
104
|
+
// notionalVolume = takeSy
|
|
87
105
|
|
|
88
106
|
takeSy = index.assetToSyUp(makePt.divDown(r));
|
|
89
107
|
fee = takeSy * (f - PMath.ONE) / f;
|
|
108
|
+
notionalVolume = takeSy;
|
|
90
109
|
}
|
|
91
110
|
|
|
92
111
|
function calcSyForYtNormal(uint256 makeSy, uint256 r, PYIndex index, uint256 f)
|
|
93
112
|
internal
|
|
94
113
|
pure
|
|
95
|
-
returns (uint256 takeYt, uint256 fee)
|
|
114
|
+
returns (uint256 takeYt, uint256 fee, uint256 notionalVolume)
|
|
96
115
|
{
|
|
97
116
|
// pt = makeSy * index * r
|
|
98
117
|
// yt = pt / (r-1)
|
|
99
118
|
// fee = makeSy * ((f-1) / f) / (r-1)
|
|
119
|
+
// notionalVolume = makeSy / (r-1)
|
|
100
120
|
|
|
101
121
|
takeYt = index.syToAssetUp(makeSy) * r / (r - PMath.ONE);
|
|
102
122
|
fee = (makeSy * (f - PMath.ONE) / f).divDown(r - PMath.ONE);
|
|
123
|
+
notionalVolume = makeSy.divDown(r - PMath.ONE);
|
|
103
124
|
}
|
|
104
125
|
|
|
105
126
|
function calcYtForSyNormal(uint256 makeYt, uint256 r, PYIndex index, uint256 f)
|
|
106
127
|
internal
|
|
107
128
|
pure
|
|
108
|
-
returns (uint256 takeSy, uint256 fee)
|
|
129
|
+
returns (uint256 takeSy, uint256 fee, uint256 notionalVolume)
|
|
109
130
|
{
|
|
110
131
|
// pt = yt * (r-1)
|
|
111
132
|
// takeSy = pt / r / index
|
|
112
133
|
// feeSy = takeSy * (f-1) / (r-1)
|
|
134
|
+
// notionalVolume = takeSy / (r-1)
|
|
113
135
|
|
|
114
136
|
takeSy = index.assetToSyUp(makeYt * (r - PMath.ONE) / r);
|
|
115
137
|
fee = takeSy * (f - PMath.ONE) / (r - PMath.ONE);
|
|
138
|
+
notionalVolume = takeSy.divDown(r - PMath.ONE);
|
|
116
139
|
}
|
|
117
140
|
|
|
118
141
|
// Proof of index.syToAsset(index.assetToSyUp(takePt)) >= takePt at end of this file
|
|
@@ -175,7 +198,7 @@ library LimitMathCore {
|
|
|
175
198
|
internal
|
|
176
199
|
pure
|
|
177
200
|
returns (
|
|
178
|
-
function (uint256, uint256, PYIndex, uint256) internal pure returns (uint256, uint256) calcNormal,
|
|
201
|
+
function (uint256, uint256, PYIndex, uint256) internal pure returns (uint256, uint256, uint256) calcNormal,
|
|
179
202
|
function (uint256, uint256, uint256, PYIndex) internal pure returns (uint256, uint256) calcFlash
|
|
180
203
|
)
|
|
181
204
|
{
|
|
@@ -39,10 +39,10 @@ contract PendleLimitRouter is PendleOrderMixin, IPLimitRouter {
|
|
|
39
39
|
require(order.maker == msg.sender, "LOP: Access denied");
|
|
40
40
|
|
|
41
41
|
bytes32 orderHash = hashOrder(order);
|
|
42
|
-
|
|
43
|
-
require(orderRemaining != _ORDER_FILLED, "LOP: already filled");
|
|
44
|
-
emit OrderCanceled(msg.sender, orderHash, orderRemaining);
|
|
42
|
+
require(_remaining[orderHash] != _ORDER_FILLED, "LOP: already filled");
|
|
45
43
|
_remaining[orderHash] = _ORDER_FILLED;
|
|
44
|
+
|
|
45
|
+
emit OrderCanceled(msg.sender, orderHash);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
function remaining(bytes32 orderHash) external view returns (uint256) {
|