@pendle/core-v2 0.16.6-testnet → 0.17.0-testnet
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/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -2
- 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/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 +16 -5
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.json +0 -13
- 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/BulkSeller/BulkSeller.sol/BulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSeller.sol/BulkSeller.json +2 -15
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerFactory.sol/BulkSellerFactory.json +2 -2
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/BulkSeller/BulkSellerMathCore.sol/BulkSellerMathCore.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/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +25 -13
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +221 -50
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.json +2 -2
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.json +141 -0
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json +141 -0
- 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 +143 -2
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol/PendleCurveFraxUsdcSY.json +1144 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol/PendleCurveUsdd3CrvSY.json +1209 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol/Curve3CrvPoolHelper.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol/CurveFraxUsdcPoolHelper.json +3 -82
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol/CurveUsdd3CrvPoolHelper.json +10 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/base/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/{ConvexCurveLP → base}/PendleConvexLPSY.sol/PendleConvexLPSY.json +142 -1
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol/PendleLooksStakingSY.json +997 -0
- 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 +143 -2
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- 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 +83 -10
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +35 -4
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.json +2 -2
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.json +2 -2
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.json +3 -38
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.json +2 -2
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeable.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeable.sol/BoringOwnableUpgradeableData.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 +105 -31
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ConvexCurve/IBooster.sol/IBooster.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/Curve/ICrvPool.sol/ICrvPool.json +14 -7
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/Curve/ITriCrvPool.sol/ITriCrvPool.json +213 -0
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IERC4626.sol/IERC4626.json +1 -1
- package/build/artifacts/contracts/interfaces/ILooksFeeSharing.sol/ILooksFeeSharing.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ILooksFeeSharing.sol/ILooksFeeSharing.json +30 -0
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/ILooksStaking.sol/ILooksStaking.json +76 -0
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +8 -8
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +18 -18
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +2 -2
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +28 -28
- package/build/artifacts/contracts/interfaces/IPBulkSeller.sol/IPBulkSeller.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBulkSellerFactory.sol/IPBulkSellerFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +17 -5
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.json +50 -19
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.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/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.json +7 -7
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +13 -0
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BulkSellerOffchain.sol/BulkSellerOffchain.json +58 -2
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +2 -46
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +62 -62
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +11 -11
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +2 -2
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +20 -20
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
- 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/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +3 -3
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +4 -4
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -186
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.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/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/kyberswap/AggregationRouterHelper.sol/AggregationRouterHelper.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +1 -1
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +3 -6
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +7 -4
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol +10 -5
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol +1 -4
- package/contracts/LiquidityMining/libraries/VeHistoryLib.sol +0 -5
- package/contracts/core/BulkSeller/BulkSeller.sol +0 -5
- package/contracts/core/BulkSeller/BulkSellerFactory.sol +7 -6
- package/contracts/core/Market/MarketMathCore.sol +52 -11
- package/contracts/core/Market/PendleMarket.sol +35 -22
- package/contracts/core/Market/PendleMarketFactory.sol +67 -35
- package/contracts/core/StandardizedYield/SYBase.sol +26 -3
- package/contracts/core/StandardizedYield/SYBaseWithRewards.sol +3 -1
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveFraxUsdcSY.sol +102 -0
- package/contracts/core/StandardizedYield/implementations/Convex/PendleCurveUsdd3CrvSY.sol +160 -0
- package/contracts/core/StandardizedYield/implementations/Convex/README.md +29 -0
- package/contracts/core/StandardizedYield/implementations/Convex/base/Curve3CrvPoolHelper.sol +215 -0
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveFraxUsdcPoolHelper.sol +46 -26
- package/contracts/core/StandardizedYield/implementations/Convex/base/CurveUsdd3CrvPoolHelper.sol +152 -0
- package/contracts/core/StandardizedYield/implementations/Convex/{ConvexCurveLP → base}/PendleConvexLPSY.sol +0 -0
- package/contracts/core/StandardizedYield/implementations/PendleLooksStakingSY.sol +128 -0
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +30 -12
- package/contracts/core/YieldContracts/PendleYieldToken.sol +79 -22
- package/contracts/core/erc20/PendleERC20.sol +4 -7
- package/contracts/core/libraries/BaseSplitCodeFactory.sol +1 -1
- package/contracts/core/libraries/BoringOwnableUpgradeable.sol +1 -1
- package/contracts/core/libraries/Errors.sol +12 -2
- package/contracts/interfaces/ConvexCurve/IBooster.sol +1 -1
- package/contracts/interfaces/Curve/ICrvPool.sol +3 -4
- package/contracts/interfaces/Curve/ITriCrvPool.sol +41 -0
- package/contracts/interfaces/IERC4626.sol +1 -1
- package/contracts/interfaces/ILooksFeeSharing.sol +5 -0
- package/contracts/interfaces/ILooksStaking.sol +13 -0
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +4 -4
- package/contracts/interfaces/IPActionMintRedeem.sol +8 -8
- package/contracts/interfaces/IPActionSwapYT.sol +2 -2
- package/contracts/interfaces/IPMarket.sol +20 -4
- package/contracts/interfaces/IPMarketFactory.sol +15 -5
- package/contracts/interfaces/IPMsgSendEndpoint.sol +1 -1
- package/contracts/interfaces/IPYieldContractFactory.sol +2 -2
- package/contracts/interfaces/IPYieldToken.sol +2 -0
- package/contracts/interfaces/IStandardizedYield.sol +15 -10
- package/contracts/offchain-helpers/BulkSellerOffchain.sol +17 -8
- package/contracts/offchain-helpers/MarketMathStatic.sol +35 -96
- package/contracts/offchain-helpers/RouterStatic.sol +8 -6
- package/contracts/router/ActionAddRemoveLiq.sol +102 -10
- package/contracts/router/ActionMintRedeem.sol +44 -4
- package/contracts/router/ActionSwapPT.sol +41 -11
- package/contracts/router/ActionSwapPTYT.sol +32 -7
- package/contracts/router/ActionSwapYT.sol +49 -33
- package/contracts/router/PendleRouter.sol +3 -11
- package/contracts/router/base/MarketApproxLib.sol +52 -18
- package/deployments/43113-core.json +18 -14
- package/deployments/43113-markets/USDC-FEB-2ND.json +10 -0
- package/deployments/43113-markets/WETH-FEB-2ND.json +10 -0
- package/deployments/43113-testenv.json +1 -2
- package/package.json +5 -5
- package/typechain-types/ActionAddRemoveLiq.ts +18 -18
- package/typechain-types/ActionMintRedeem.ts +30 -30
- package/typechain-types/ActionSwapPTYT.ts +5 -5
- package/typechain-types/ActionSwapYT.ts +5 -5
- package/typechain-types/BulkSeller.ts +0 -19
- package/typechain-types/BulkSellerOffchain.ts +74 -0
- package/typechain-types/IBooster.ts +9 -3
- package/typechain-types/ICrvPool.ts +4 -9
- package/typechain-types/IERC4626.ts +5 -5
- package/typechain-types/IPActionAddRemoveLiq.ts +13 -13
- package/typechain-types/IPActionMintRedeem.ts +30 -30
- package/typechain-types/IPActionSwapYT.ts +5 -5
- package/typechain-types/IPAllAction.ts +48 -48
- package/typechain-types/IPMarket.ts +26 -16
- package/typechain-types/IPMarketFactory.ts +70 -37
- package/typechain-types/IPMsgSendEndpoint.ts +1 -1
- package/typechain-types/IPYieldContractFactory.ts +11 -11
- package/typechain-types/IPYieldToken.ts +21 -0
- package/typechain-types/MarketMathStatic.ts +0 -67
- package/typechain-types/PendleConvexLPSY.ts +204 -0
- package/typechain-types/PendleMarket.ts +26 -16
- package/typechain-types/PendleMarketFactory.ts +316 -92
- package/typechain-types/PendleQiTokenSY.ts +204 -0
- package/typechain-types/PendleRouter.ts +3 -287
- package/typechain-types/PendleWstEthSY.ts +204 -0
- package/typechain-types/PendleYieldContractFactory.ts +63 -18
- package/typechain-types/PendleYieldToken.ts +42 -0
- package/typechain-types/RouterStatic.ts +2 -2
- package/typechain-types/SYBase.ts +204 -0
- package/typechain-types/SYBaseWithRewards.ts +204 -0
- package/typechain-types/VotingEscrowPendleSidechain.ts +8 -8
- package/typechain-types/VotingEscrowTokenBase.ts +0 -21
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +10 -10
- package/typechain-types/factories/ActionCallback__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeem__factory.ts +19 -19
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +2 -2
- package/typechain-types/factories/ActionSwapPT__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYT__factory.ts +3 -3
- package/typechain-types/factories/AggregationRouterHelper__factory.ts +1 -1
- package/typechain-types/factories/BaseSplitCodeFactoryContract__factory.ts +1 -1
- package/typechain-types/factories/BoringOwnableUpgradeableData__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerFactory__factory.ts +1 -1
- package/typechain-types/factories/BulkSellerOffchain__factory.ts +57 -1
- package/typechain-types/factories/BulkSeller__factory.ts +1 -14
- package/typechain-types/factories/Errors__factory.ts +104 -30
- package/typechain-types/factories/IBooster__factory.ts +1 -1
- package/typechain-types/factories/ICrvPool__factory.ts +14 -7
- package/typechain-types/factories/IERC4626__factory.ts +1 -1
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +8 -8
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +18 -18
- package/typechain-types/factories/IPActionSwapYT__factory.ts +2 -2
- package/typechain-types/factories/IPAllAction__factory.ts +28 -28
- package/typechain-types/factories/IPMarketFactory__factory.ts +50 -19
- package/typechain-types/factories/IPMarket__factory.ts +17 -5
- package/typechain-types/factories/IPMsgSendEndpoint__factory.ts +1 -1
- package/typechain-types/factories/IPYieldContractFactory__factory.ts +7 -7
- package/typechain-types/factories/IPYieldToken__factory.ts +13 -0
- package/typechain-types/factories/MarketMathStatic__factory.ts +1 -45
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleConvexLPSY__factory.ts +141 -0
- package/typechain-types/factories/PendleCurveFraxUsdcSY__factory.ts +1 -1
- package/typechain-types/factories/PendleCurveUsdd3CrvSY__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20Permit__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__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/PendleLooksStakingSY__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +220 -49
- package/typechain-types/factories/PendleMarket__factory.ts +18 -6
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +142 -1
- package/typechain-types/factories/PendleRouter__factory.ts +1 -185
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +142 -1
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +82 -9
- package/typechain-types/factories/PendleYieldToken__factory.ts +38 -3
- package/typechain-types/factories/RouterStatic__factory.ts +3 -3
- package/typechain-types/factories/SYBaseWithRewards__factory.ts +141 -0
- package/typechain-types/factories/SYBase__factory.ts +141 -0
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +15 -4
- package/typechain-types/factories/VotingEscrowTokenBase__factory.ts +0 -13
- package/typechain-types/hardhat.d.ts +0 -36
- package/typechain-types/index.ts +0 -6
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +0 -182
- package/contracts/offchain-helpers/ImplicitSwapfeeContract.sol +0 -30
- package/deployments/43113-markets/QIWBTC-3RD-FEB.json +0 -11
- package/deployments/43113-markets/benqi-market-QI-AVAX-FEB-2ND.json +0 -9
- package/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
- package/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -9
- package/deployments/80001-core.json +0 -16
- package/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
- package/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
- package/deployments/80001-testenv.json +0 -22
|
@@ -7,6 +7,7 @@ import "../interfaces/IPActionSwapYT.sol";
|
|
|
7
7
|
import "../interfaces/IPMarket.sol";
|
|
8
8
|
import "../core/libraries/Errors.sol";
|
|
9
9
|
|
|
10
|
+
/// @dev All swap actions will revert if market is expired
|
|
10
11
|
contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
11
12
|
using Math for uint256;
|
|
12
13
|
using Math for int256;
|
|
@@ -21,14 +22,16 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
21
22
|
{}
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
* @notice swap exact SY to YT with the help of flashswaps & YT tokenization / redemption
|
|
26
|
+
* @dev inner working of this function:
|
|
26
27
|
- `exactSyIn` SY is transferred to YT contract
|
|
27
|
-
- `market.swapExactPtForSy` is called, which will transfer SY directly to YT contract &
|
|
28
|
-
|
|
29
|
-
- in callback, all SY in YT contract is used to mint PT + YT, with PT used to pay back the
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
- `market.swapExactPtForSy` is called, which will transfer more SY directly to YT contract &
|
|
29
|
+
callback is invoked. Note that now we owe PT
|
|
30
|
+
- in callback, all SY in YT contract is used to mint PT + YT, with all PT used to pay back the
|
|
31
|
+
loan, and all YT transferred to the receiver
|
|
32
|
+
* @param exactSyIn will always consume this amount of SY for as much YT as possible
|
|
33
|
+
* @param guessYtOut approximation data for total YT output
|
|
34
|
+
* @dev this function works in conjunction with ActionCallback
|
|
32
35
|
*/
|
|
33
36
|
function swapExactSyForYt(
|
|
34
37
|
address receiver,
|
|
@@ -54,14 +57,15 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
/**
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
* @notice swap exact YT to SY with the help of flashswaps & YT tokenization / redemption
|
|
61
|
+
* @dev inner working of this function:
|
|
59
62
|
- `exactYtIn` YT is transferred to YT contract
|
|
60
|
-
- `market.swapSyForExactPt` is called, which will transfer PT directly to YT contract &
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
- `market.swapSyForExactPt` is called, which will transfer PT directly to YT contract &
|
|
64
|
+
callback is invoked. Note that now we owe SY.
|
|
65
|
+
- In callback, all PT + YT in YT contract is used to redeem SY. A portion of SY is used to
|
|
66
|
+
payback the loan, the rest is transferred to the `receiver`
|
|
67
|
+
* @param exactYtIn will consume exactly this much YT for as much SY as possible
|
|
68
|
+
* @dev this function works in conjunction with ActionCallback
|
|
65
69
|
*/
|
|
66
70
|
function swapExactYtForSy(
|
|
67
71
|
address receiver,
|
|
@@ -79,13 +83,14 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
79
83
|
}
|
|
80
84
|
|
|
81
85
|
/**
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- `market.swapExactPtForSy` is called, which will transfer SY directly to YT contract &
|
|
85
|
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
* @notice swap SY to exact YT with the help of flashswaps & YT tokenization / redemption
|
|
87
|
+
* @dev inner working of this function:
|
|
88
|
+
- `market.swapExactPtForSy` is called, which will transfer SY directly to YT contract &
|
|
89
|
+
callback is invoked. Note that now we owe PT
|
|
90
|
+
- In callback, we will pull in more SY as needed from caller & mint all SY to PT + YT. PT is
|
|
91
|
+
then used to payback the loan, while YT is transferred to `receiver`
|
|
92
|
+
* @param exactYtOut will output exactly this amount of YT, no approximation is used
|
|
93
|
+
* @dev this function works in conjunction with ActionCallback
|
|
89
94
|
*/
|
|
90
95
|
function swapSyForExactYt(
|
|
91
96
|
address receiver,
|
|
@@ -109,14 +114,15 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
109
114
|
}
|
|
110
115
|
|
|
111
116
|
/**
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
-
|
|
115
|
-
- `
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
* @notice swap YT to exact SY with the help of flashswaps & YT tokenization / redemption
|
|
118
|
+
* @dev inner working of this function:
|
|
119
|
+
- Approximates `netYtIn` using the data from `guessYtIn`
|
|
120
|
+
- Pulls `netYtIn` amount of YT from caller
|
|
121
|
+
- `market.swapSyForExactPt` is called, which will transfer PT directly to YT contract &
|
|
122
|
+
callback is invoked. Note that now we owe SY
|
|
123
|
+
- In callback, we will redeem all PT + YT to get SY. A portion of it is used to payback the
|
|
124
|
+
loan. The rest is transferred to `receiver`
|
|
125
|
+
* @dev this function works in conjunction with ActionCallback
|
|
120
126
|
*/
|
|
121
127
|
function swapYtForExactSy(
|
|
122
128
|
address receiver,
|
|
@@ -125,7 +131,7 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
125
131
|
uint256 maxYtIn,
|
|
126
132
|
ApproxParams memory guessYtIn
|
|
127
133
|
) external returns (uint256 netYtIn, uint256 netSyFee) {
|
|
128
|
-
MarketState memory state = IPMarket(market).readState();
|
|
134
|
+
MarketState memory state = IPMarket(market).readState(address(this));
|
|
129
135
|
(, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
130
136
|
|
|
131
137
|
(netYtIn, , ) = state.approxSwapYtForExactSy(
|
|
@@ -148,6 +154,11 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
148
154
|
emit SwapYtAndSy(msg.sender, market, receiver, netYtIn.neg(), exactSyOut.Int());
|
|
149
155
|
}
|
|
150
156
|
|
|
157
|
+
/**
|
|
158
|
+
* @notice swaps any token to YT
|
|
159
|
+
* @dev this function swaps token for SY-mintable token first through Kyberswap, then mints SY
|
|
160
|
+
* from such, finally swaps SY to YT (see `swapSyForExactYt()`)
|
|
161
|
+
*/
|
|
151
162
|
function swapExactTokenForYt(
|
|
152
163
|
address receiver,
|
|
153
164
|
address market,
|
|
@@ -171,13 +182,18 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
171
182
|
emit SwapYtAndToken(
|
|
172
183
|
msg.sender,
|
|
173
184
|
market,
|
|
174
|
-
receiver,
|
|
175
185
|
input.tokenIn,
|
|
186
|
+
receiver,
|
|
176
187
|
netYtOut.Int(),
|
|
177
188
|
input.netTokenIn.neg()
|
|
178
189
|
);
|
|
179
190
|
}
|
|
180
191
|
|
|
192
|
+
/**
|
|
193
|
+
* @notice swaps YT to a given token
|
|
194
|
+
* @dev the function first swaps YT to SY (see `swapExactYtForSy()`), then redeems SY,
|
|
195
|
+
* finally swaps resulting tokens to desired output token using Kyberswap
|
|
196
|
+
*/
|
|
181
197
|
function swapExactYtForToken(
|
|
182
198
|
address receiver,
|
|
183
199
|
address market,
|
|
@@ -204,8 +220,8 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
204
220
|
emit SwapYtAndToken(
|
|
205
221
|
msg.sender,
|
|
206
222
|
market,
|
|
207
|
-
receiver,
|
|
208
223
|
output.tokenOut,
|
|
224
|
+
receiver,
|
|
209
225
|
netYtIn.neg(),
|
|
210
226
|
netTokenOut.Int()
|
|
211
227
|
);
|
|
@@ -219,7 +235,7 @@ contract ActionSwapYT is IPActionSwapYT, ActionBaseMintRedeem, CallbackHelper {
|
|
|
219
235
|
uint256 minYtOut,
|
|
220
236
|
ApproxParams memory guessYtOut
|
|
221
237
|
) internal returns (uint256 netYtOut, uint256 netSyFee) {
|
|
222
|
-
MarketState memory state = IPMarket(market).readState();
|
|
238
|
+
MarketState memory state = IPMarket(market).readState(address(this));
|
|
223
239
|
|
|
224
240
|
(netYtOut, ) = state.approxSwapExactSyForYt(
|
|
225
241
|
YT.newIndex(),
|
|
@@ -5,7 +5,6 @@ import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
|
5
5
|
import "@openzeppelin/contracts/proxy/Proxy.sol";
|
|
6
6
|
import "../interfaces/IPAllAction.sol";
|
|
7
7
|
import "../interfaces/IPMarketSwapCallback.sol";
|
|
8
|
-
import "../core/libraries/BoringOwnableUpgradeable.sol";
|
|
9
8
|
import "../core/libraries/Errors.sol";
|
|
10
9
|
|
|
11
10
|
/// @dev this contract will be deployed behind an ERC1967 proxy
|
|
@@ -13,7 +12,7 @@ import "../core/libraries/Errors.sol";
|
|
|
13
12
|
/// corresponding implementation contracts
|
|
14
13
|
|
|
15
14
|
// solhint-disable no-empty-blocks
|
|
16
|
-
contract PendleRouter is Proxy
|
|
15
|
+
contract PendleRouter is Proxy {
|
|
17
16
|
address public immutable ACTION_MINT_REDEEM;
|
|
18
17
|
address public immutable ACTION_ADD_REMOVE_LIQ;
|
|
19
18
|
address public immutable ACTION_SWAP_PT;
|
|
@@ -30,7 +29,7 @@ contract PendleRouter is Proxy, Initializable, UUPSUpgradeable, BoringOwnableUpg
|
|
|
30
29
|
address _ACTION_SWAP_PTYT,
|
|
31
30
|
address _ACTION_CALLBACK,
|
|
32
31
|
address _ACTION_MISC
|
|
33
|
-
)
|
|
32
|
+
) {
|
|
34
33
|
ACTION_MINT_REDEEM = _ACTION_MINT_REDEEM;
|
|
35
34
|
ACTION_ADD_REMOVE_LIQ = _ACTION_ADD_REMOVE_LIQ;
|
|
36
35
|
ACTION_SWAP_PT = _ACTION_SWAP_PT;
|
|
@@ -40,12 +39,7 @@ contract PendleRouter is Proxy, Initializable, UUPSUpgradeable, BoringOwnableUpg
|
|
|
40
39
|
ACTION_MISC = _ACTION_MISC;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
receive() external payable virtual override {
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function initialize() external initializer {
|
|
47
|
-
__BoringOwnable_init();
|
|
48
|
-
}
|
|
42
|
+
receive() external payable virtual override {}
|
|
49
43
|
|
|
50
44
|
function getRouterImplementation(bytes4 sig) public view returns (address) {
|
|
51
45
|
if (
|
|
@@ -103,8 +97,6 @@ contract PendleRouter is Proxy, Initializable, UUPSUpgradeable, BoringOwnableUpg
|
|
|
103
97
|
revert Errors.RouterInvalidAction(sig);
|
|
104
98
|
}
|
|
105
99
|
|
|
106
|
-
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
|
|
107
|
-
|
|
108
100
|
function _implementation() internal view override returns (address) {
|
|
109
101
|
return getRouterImplementation(msg.sig);
|
|
110
102
|
}
|
|
@@ -84,7 +84,7 @@ library MarketApproxPtInLib {
|
|
|
84
84
|
continue;
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
(uint256 netSyOut, uint256 netSyFee) = calcSyOut(a.market, comp, a.index, guess);
|
|
87
|
+
(uint256 netSyOut, uint256 netSyFee, ) = calcSyOut(a.market, comp, a.index, guess);
|
|
88
88
|
|
|
89
89
|
if (netSyOut >= a.minSyOut) {
|
|
90
90
|
p.guessMax = guess;
|
|
@@ -146,7 +146,7 @@ library MarketApproxPtInLib {
|
|
|
146
146
|
continue;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
(uint256 netSyOut, uint256 netSyFee) = calcSyOut(a.market, comp, a.index, guess);
|
|
149
|
+
(uint256 netSyOut, uint256 netSyFee, ) = calcSyOut(a.market, comp, a.index, guess);
|
|
150
150
|
|
|
151
151
|
uint256 maxPtPayable = a.index.syToAsset(netSyOut + a.exactSyIn);
|
|
152
152
|
|
|
@@ -211,14 +211,18 @@ library MarketApproxPtInLib {
|
|
|
211
211
|
continue;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
(uint256 netSyOut, uint256 netSyFee) = calcSyOut(
|
|
214
|
+
(uint256 netSyOut, uint256 netSyFee, uint256 netSyToReserve) = calcSyOut(
|
|
215
|
+
a.market,
|
|
216
|
+
comp,
|
|
217
|
+
a.index,
|
|
218
|
+
guess
|
|
219
|
+
);
|
|
215
220
|
|
|
216
221
|
uint256 syNumerator;
|
|
217
222
|
uint256 ptNumerator;
|
|
218
223
|
{
|
|
219
224
|
uint256 newTotalPt = a.market.totalPt.Uint() + guess;
|
|
220
|
-
uint256
|
|
221
|
-
uint256 newTotalSy = (a.market.totalSy.Uint() - netSyOut - netSyFee);
|
|
225
|
+
uint256 newTotalSy = (a.market.totalSy.Uint() - netSyOut - netSyToReserve);
|
|
222
226
|
|
|
223
227
|
// it is desired that
|
|
224
228
|
// netSyOut / newTotalSy = netPtRemaining / newTotalPt
|
|
@@ -226,7 +230,7 @@ library MarketApproxPtInLib {
|
|
|
226
230
|
// netSyOut * newTotalPt = netPtRemaining * newTotalSy
|
|
227
231
|
|
|
228
232
|
syNumerator = netSyOut * newTotalPt;
|
|
229
|
-
ptNumerator =
|
|
233
|
+
ptNumerator = (a.totalPtIn - guess) * newTotalSy;
|
|
230
234
|
}
|
|
231
235
|
|
|
232
236
|
if (Math.isAApproxB(syNumerator, ptNumerator, p.eps)) {
|
|
@@ -292,7 +296,7 @@ library MarketApproxPtInLib {
|
|
|
292
296
|
continue;
|
|
293
297
|
}
|
|
294
298
|
|
|
295
|
-
(uint256 netSyOut, uint256 netSyFee) = calcSyOut(a.market, comp, a.index, guess);
|
|
299
|
+
(uint256 netSyOut, uint256 netSyFee, ) = calcSyOut(a.market, comp, a.index, guess);
|
|
296
300
|
|
|
297
301
|
uint256 netAssetOut = a.index.syToAsset(netSyOut);
|
|
298
302
|
|
|
@@ -316,10 +320,23 @@ library MarketApproxPtInLib {
|
|
|
316
320
|
MarketPreCompute memory comp,
|
|
317
321
|
PYIndex index,
|
|
318
322
|
uint256 netPtIn
|
|
319
|
-
)
|
|
320
|
-
|
|
323
|
+
)
|
|
324
|
+
internal
|
|
325
|
+
pure
|
|
326
|
+
returns (
|
|
327
|
+
uint256 netSyOut,
|
|
328
|
+
uint256 netSyFee,
|
|
329
|
+
uint256 netSyToReserve
|
|
330
|
+
)
|
|
331
|
+
{
|
|
332
|
+
(int256 _netSyOut, int256 _netSyFee, int256 _netSyToReserve) = market.calcTrade(
|
|
333
|
+
comp,
|
|
334
|
+
index,
|
|
335
|
+
netPtIn.neg()
|
|
336
|
+
);
|
|
321
337
|
netSyOut = _netSyOut.Uint();
|
|
322
338
|
netSyFee = _netSyFee.Uint();
|
|
339
|
+
netSyToReserve = _netSyToReserve.Uint();
|
|
323
340
|
}
|
|
324
341
|
|
|
325
342
|
function newApproxParamsPtIn(
|
|
@@ -447,7 +464,7 @@ library MarketApproxPtOutLib {
|
|
|
447
464
|
for (uint256 iter = 0; iter < p.maxIteration; ++iter) {
|
|
448
465
|
uint256 guess = nextGuess(p, iter);
|
|
449
466
|
|
|
450
|
-
(uint256 netSyIn, uint256 netSyFee) = calcSyIn(a.market, comp, a.index, guess);
|
|
467
|
+
(uint256 netSyIn, uint256 netSyFee, ) = calcSyIn(a.market, comp, a.index, guess);
|
|
451
468
|
|
|
452
469
|
if (netSyIn <= a.exactSyIn) {
|
|
453
470
|
p.guessMin = guess;
|
|
@@ -502,7 +519,7 @@ library MarketApproxPtOutLib {
|
|
|
502
519
|
for (uint256 iter = 0; iter < p.maxIteration; ++iter) {
|
|
503
520
|
uint256 guess = nextGuess(p, iter);
|
|
504
521
|
|
|
505
|
-
(uint256 netSyOwed, uint256 netSyFee) = calcSyIn(a.market, comp, a.index, guess);
|
|
522
|
+
(uint256 netSyOwed, uint256 netSyFee, ) = calcSyIn(a.market, comp, a.index, guess);
|
|
506
523
|
|
|
507
524
|
uint256 netAssetToRepay = a.index.syToAssetUp(netSyOwed);
|
|
508
525
|
uint256 netSyOut = a.index.assetToSy(guess - netAssetToRepay);
|
|
@@ -562,7 +579,12 @@ library MarketApproxPtOutLib {
|
|
|
562
579
|
for (uint256 iter = 0; iter < p.maxIteration; ++iter) {
|
|
563
580
|
uint256 guess = nextGuess(p, iter);
|
|
564
581
|
|
|
565
|
-
(uint256 netSyIn, uint256 netSyFee) = calcSyIn(
|
|
582
|
+
(uint256 netSyIn, uint256 netSyFee, uint256 netSyToReserve) = calcSyIn(
|
|
583
|
+
a.market,
|
|
584
|
+
comp,
|
|
585
|
+
a.index,
|
|
586
|
+
guess
|
|
587
|
+
);
|
|
566
588
|
|
|
567
589
|
if (netSyIn > a.totalSyIn) {
|
|
568
590
|
p.guessMax = guess - 1;
|
|
@@ -573,9 +595,8 @@ library MarketApproxPtOutLib {
|
|
|
573
595
|
uint256 ptNumerator;
|
|
574
596
|
|
|
575
597
|
{
|
|
576
|
-
uint256 netSyRemaining = a.totalSyIn - netSyIn;
|
|
577
598
|
uint256 newTotalPt = a.market.totalPt.Uint() - guess;
|
|
578
|
-
uint256 netTotalSy = a.market.totalSy.Uint() + netSyIn -
|
|
599
|
+
uint256 netTotalSy = a.market.totalSy.Uint() + netSyIn - netSyToReserve;
|
|
579
600
|
|
|
580
601
|
// it is desired that
|
|
581
602
|
// netPtFromSwap / newTotalPt = netSyRemaining / netTotalSy
|
|
@@ -583,7 +604,7 @@ library MarketApproxPtOutLib {
|
|
|
583
604
|
// netPtFromSwap * netTotalSy = netSyRemaining * newTotalPt
|
|
584
605
|
|
|
585
606
|
ptNumerator = guess * netTotalSy;
|
|
586
|
-
syNumerator =
|
|
607
|
+
syNumerator = (a.totalSyIn - netSyIn) * newTotalPt;
|
|
587
608
|
}
|
|
588
609
|
|
|
589
610
|
if (Math.isAApproxB(ptNumerator, syNumerator, p.eps)) {
|
|
@@ -650,7 +671,7 @@ library MarketApproxPtOutLib {
|
|
|
650
671
|
for (uint256 iter = 0; iter < p.maxIteration; ++iter) {
|
|
651
672
|
uint256 guess = nextGuess(p, iter);
|
|
652
673
|
|
|
653
|
-
(uint256 netSyOwed, uint256 netSyFee) = calcSyIn(a.market, comp, a.index, guess);
|
|
674
|
+
(uint256 netSyOwed, uint256 netSyFee, ) = calcSyIn(a.market, comp, a.index, guess);
|
|
654
675
|
|
|
655
676
|
if (netSyOwed <= a.maxSyPayable) {
|
|
656
677
|
p.guessMin = guess;
|
|
@@ -671,11 +692,24 @@ library MarketApproxPtOutLib {
|
|
|
671
692
|
MarketPreCompute memory comp,
|
|
672
693
|
PYIndex index,
|
|
673
694
|
uint256 netPtOut
|
|
674
|
-
)
|
|
675
|
-
|
|
695
|
+
)
|
|
696
|
+
internal
|
|
697
|
+
pure
|
|
698
|
+
returns (
|
|
699
|
+
uint256 netSyIn,
|
|
700
|
+
uint256 netSyFee,
|
|
701
|
+
uint256 netSyToReserve
|
|
702
|
+
)
|
|
703
|
+
{
|
|
704
|
+
(int256 _netSyIn, int256 _netSyFee, int256 _netSyToReserve) = market.calcTrade(
|
|
705
|
+
comp,
|
|
706
|
+
index,
|
|
707
|
+
netPtOut.Int()
|
|
708
|
+
);
|
|
676
709
|
|
|
677
710
|
netSyIn = _netSyIn.abs();
|
|
678
711
|
netSyFee = _netSyFee.Uint();
|
|
712
|
+
netSyToReserve = _netSyToReserve.Uint();
|
|
679
713
|
}
|
|
680
714
|
|
|
681
715
|
function newApproxParamsPtOut(
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"deployer": "0x1FcCC097db89A86Bfc474A1028F93958295b1Fb7",
|
|
3
|
-
"network":
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
3
|
+
"network": {
|
|
4
|
+
"chainId": 43113,
|
|
5
|
+
"treasury": "0x243b7CFD29AcAF9cDe98C1958902FAA3B1F095D5",
|
|
6
|
+
"governance": "0x1FcCC097db89A86Bfc474A1028F93958295b1Fb7",
|
|
7
|
+
"pendle": "0x808507121b80c02388fad14726482e061b8da827",
|
|
8
|
+
"lzEndpoint": "0x93f54D755A063cE7bB9e6Ac47Eccc8e33411d706"
|
|
9
|
+
},
|
|
10
|
+
"splitter": "0x718Bfb977A2f327edC41bf8e615f1206a57F9Eea",
|
|
11
|
+
"PENDLE": "0x808507121b80c02388fad14726482e061b8da827",
|
|
12
|
+
"yieldContractFactory": "0x56966bbe5FdC4e76febb7eb3a5E892d9c39De46c",
|
|
13
|
+
"marketFactory": "0x59cD89c89dF47BA43B134F55D2E734E03aC62871",
|
|
14
|
+
"bulkSellerFactory": "0x5e2e7Dd7364cB8b73d69A50276B7cAC5aD165420",
|
|
15
|
+
"router": "0xf637E80aEF8ed8d257d189967ADeE5C6b18Ea776",
|
|
16
|
+
"routerStatic": "0x81EAcd9D16CbA337ec35F0960468C49AD3c0Ea91",
|
|
17
|
+
"vePendle": "0x8B859D03A23Cf74f973657C8594B071dE3Bc17c4",
|
|
18
|
+
"senderEndpoint": "0x49eb5784b9D2360e123Acb8366C01A5469960D68",
|
|
19
|
+
"votingController": "0xb8Dec786A995376BDb0aeAF0D5ce9A27577495ca",
|
|
20
|
+
"gaugeController": "0xC66Bd01662E1Ab9FF0BeAd18E8b2e187ab4FaA1B"
|
|
17
21
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY Benqi USDC",
|
|
3
|
+
"SY": "0x18a23e0a9Bf35EE15603FF38441A72D15D35B487",
|
|
4
|
+
"YT": "0x1E07Ba35866C98C60c046544b3635F63dE7FBfF2",
|
|
5
|
+
"PT": "0x27fb9d4E67E4850f605775B9E12a833c5d3D8DaD",
|
|
6
|
+
"market": "0xce7Bd6374032DbDd735F24b96a6B50f4F67fFfa3",
|
|
7
|
+
"expiry": 1675382400,
|
|
8
|
+
"scalarRoot": "62000000000000000000",
|
|
9
|
+
"initAnchor": "1012600000000000000"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "SY Benqi WETH",
|
|
3
|
+
"SY": "0xD1CE136Ab1A2f684e03F09A27028264d6233f70c",
|
|
4
|
+
"YT": "0x4981dC960318d7B340FE8193b97FD51db752e9Ee",
|
|
5
|
+
"PT": "0xBc89b4DEdB90223BFabde42c1A15489f3623465d",
|
|
6
|
+
"market": "0x19e6b9102966C55a9318379BC443fF5D0a97E4dE",
|
|
7
|
+
"expiry": 1675382400,
|
|
8
|
+
"scalarRoot": "62000000000000000000",
|
|
9
|
+
"initAnchor": "1012600000000000000"
|
|
10
|
+
}
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
"WETH": "0x1e2e40697603CA5b5ffc102c9D7A3310EA3f2Aa3",
|
|
11
11
|
"qiUSDC": "0xEE3a174F1478198fBc669132B1e2cc13B5686F94",
|
|
12
12
|
"qiWETH": "0xE5710EC5e4CeB255fb14d2c2BFC93E64d0c30A2c",
|
|
13
|
-
"qiAVAX": "0xf9aEd3b927dce44C6d53B334Cb759f4D230D9b9c"
|
|
14
|
-
"qiWBTC": "0xb847E93A481E50E6C289ff9559A8405aD225210B"
|
|
13
|
+
"qiAVAX": "0xf9aEd3b927dce44C6d53B334Cb759f4D230D9b9c"
|
|
15
14
|
},
|
|
16
15
|
"benqi": {
|
|
17
16
|
"comptroller": "0x4Af3e9CA6f86E655C01f03C13519BcAF867286EE",
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@pendle/core-v2",
|
|
3
3
|
"description": "Core smart contracts of Pendle Protocol.",
|
|
4
4
|
"license": "BUSL-1.1",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.17.0-testnet",
|
|
6
6
|
"homepage": "https://pendle.finance",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"pendle",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@typechain/ethers-v5": "^9.0.0",
|
|
27
27
|
"@typechain/hardhat": "^4.0.0",
|
|
28
|
-
"hardhat": "^2.12.
|
|
28
|
+
"hardhat": "^2.12.2",
|
|
29
29
|
"hardhat-contract-sizer": "^2.6.1",
|
|
30
30
|
"hardhat-storage-layout-diff": "^0.0.4",
|
|
31
31
|
"prettier": "^2.7.1",
|
|
32
|
-
"prettier-plugin-solidity": "^1.0.0-
|
|
32
|
+
"prettier-plugin-solidity": "^1.0.0-rc.1",
|
|
33
33
|
"solc": "^0.8.17",
|
|
34
34
|
"solhint": "^3.3.7",
|
|
35
35
|
"ts-node": "^10.9.1",
|
|
36
|
-
"typechain": "^8.1.
|
|
37
|
-
"typescript": "^4.
|
|
36
|
+
"typechain": "^8.1.1",
|
|
37
|
+
"typescript": "^4.9.3"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"compile": "yarn hardhat compile",
|
|
@@ -208,7 +208,7 @@ export interface ActionAddRemoveLiqInterface extends utils.Interface {
|
|
|
208
208
|
"AddLiquiditySingleSy(address,address,address,uint256,uint256)": EventFragment;
|
|
209
209
|
"AddLiquiditySingleToken(address,address,address,address,uint256,uint256)": EventFragment;
|
|
210
210
|
"RemoveLiquidityDualSyAndPt(address,address,address,uint256,uint256,uint256)": EventFragment;
|
|
211
|
-
"RemoveLiquidityDualTokenAndPt(address,address,address,uint256,uint256,
|
|
211
|
+
"RemoveLiquidityDualTokenAndPt(address,address,address,address,uint256,uint256,uint256)": EventFragment;
|
|
212
212
|
"RemoveLiquiditySinglePt(address,address,address,uint256,uint256)": EventFragment;
|
|
213
213
|
"RemoveLiquiditySingleSy(address,address,address,uint256,uint256)": EventFragment;
|
|
214
214
|
"RemoveLiquiditySingleToken(address,address,address,address,uint256,uint256)": EventFragment;
|
|
@@ -248,8 +248,8 @@ export type AddLiquidityDualTokenAndPtEvent = TypedEvent<
|
|
|
248
248
|
{
|
|
249
249
|
caller: string;
|
|
250
250
|
market: string;
|
|
251
|
-
receiver: string;
|
|
252
251
|
tokenIn: string;
|
|
252
|
+
receiver: string;
|
|
253
253
|
netTokenUsed: BigNumber;
|
|
254
254
|
netPtUsed: BigNumber;
|
|
255
255
|
netLpOut: BigNumber;
|
|
@@ -318,14 +318,14 @@ export type RemoveLiquidityDualSyAndPtEventFilter =
|
|
|
318
318
|
TypedEventFilter<RemoveLiquidityDualSyAndPtEvent>;
|
|
319
319
|
|
|
320
320
|
export type RemoveLiquidityDualTokenAndPtEvent = TypedEvent<
|
|
321
|
-
[string, string, string,
|
|
321
|
+
[string, string, string, string, BigNumber, BigNumber, BigNumber],
|
|
322
322
|
{
|
|
323
323
|
caller: string;
|
|
324
324
|
market: string;
|
|
325
|
+
tokenOut: string;
|
|
325
326
|
receiver: string;
|
|
326
327
|
netLpToRemove: BigNumber;
|
|
327
328
|
netPtOut: BigNumber;
|
|
328
|
-
tokenOut: string;
|
|
329
329
|
netTokenOut: BigNumber;
|
|
330
330
|
}
|
|
331
331
|
>;
|
|
@@ -474,7 +474,7 @@ export interface ActionAddRemoveLiq extends BaseContract {
|
|
|
474
474
|
market: string,
|
|
475
475
|
netLpToRemove: BigNumberish,
|
|
476
476
|
minPtOut: BigNumberish,
|
|
477
|
-
|
|
477
|
+
guessPtReceivedFromSy: ApproxParamsStruct,
|
|
478
478
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
479
479
|
): Promise<ContractTransaction>;
|
|
480
480
|
|
|
@@ -565,7 +565,7 @@ export interface ActionAddRemoveLiq extends BaseContract {
|
|
|
565
565
|
market: string,
|
|
566
566
|
netLpToRemove: BigNumberish,
|
|
567
567
|
minPtOut: BigNumberish,
|
|
568
|
-
|
|
568
|
+
guessPtReceivedFromSy: ApproxParamsStruct,
|
|
569
569
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
570
570
|
): Promise<ContractTransaction>;
|
|
571
571
|
|
|
@@ -678,7 +678,7 @@ export interface ActionAddRemoveLiq extends BaseContract {
|
|
|
678
678
|
market: string,
|
|
679
679
|
netLpToRemove: BigNumberish,
|
|
680
680
|
minPtOut: BigNumberish,
|
|
681
|
-
|
|
681
|
+
guessPtReceivedFromSy: ApproxParamsStruct,
|
|
682
682
|
overrides?: CallOverrides
|
|
683
683
|
): Promise<
|
|
684
684
|
[BigNumber, BigNumber] & { netPtOut: BigNumber; netSyFee: BigNumber }
|
|
@@ -726,8 +726,8 @@ export interface ActionAddRemoveLiq extends BaseContract {
|
|
|
726
726
|
"AddLiquidityDualTokenAndPt(address,address,address,address,uint256,uint256,uint256)"(
|
|
727
727
|
caller?: string | null,
|
|
728
728
|
market?: string | null,
|
|
729
|
-
|
|
730
|
-
|
|
729
|
+
tokenIn?: string | null,
|
|
730
|
+
receiver?: null,
|
|
731
731
|
netTokenUsed?: null,
|
|
732
732
|
netPtUsed?: null,
|
|
733
733
|
netLpOut?: null
|
|
@@ -735,8 +735,8 @@ export interface ActionAddRemoveLiq extends BaseContract {
|
|
|
735
735
|
AddLiquidityDualTokenAndPt(
|
|
736
736
|
caller?: string | null,
|
|
737
737
|
market?: string | null,
|
|
738
|
-
|
|
739
|
-
|
|
738
|
+
tokenIn?: string | null,
|
|
739
|
+
receiver?: null,
|
|
740
740
|
netTokenUsed?: null,
|
|
741
741
|
netPtUsed?: null,
|
|
742
742
|
netLpOut?: null
|
|
@@ -806,22 +806,22 @@ export interface ActionAddRemoveLiq extends BaseContract {
|
|
|
806
806
|
netSyOut?: null
|
|
807
807
|
): RemoveLiquidityDualSyAndPtEventFilter;
|
|
808
808
|
|
|
809
|
-
"RemoveLiquidityDualTokenAndPt(address,address,address,uint256,uint256,
|
|
809
|
+
"RemoveLiquidityDualTokenAndPt(address,address,address,address,uint256,uint256,uint256)"(
|
|
810
810
|
caller?: string | null,
|
|
811
811
|
market?: string | null,
|
|
812
|
-
|
|
812
|
+
tokenOut?: string | null,
|
|
813
|
+
receiver?: null,
|
|
813
814
|
netLpToRemove?: null,
|
|
814
815
|
netPtOut?: null,
|
|
815
|
-
tokenOut?: null,
|
|
816
816
|
netTokenOut?: null
|
|
817
817
|
): RemoveLiquidityDualTokenAndPtEventFilter;
|
|
818
818
|
RemoveLiquidityDualTokenAndPt(
|
|
819
819
|
caller?: string | null,
|
|
820
820
|
market?: string | null,
|
|
821
|
-
|
|
821
|
+
tokenOut?: string | null,
|
|
822
|
+
receiver?: null,
|
|
822
823
|
netLpToRemove?: null,
|
|
823
824
|
netPtOut?: null,
|
|
824
|
-
tokenOut?: null,
|
|
825
825
|
netTokenOut?: null
|
|
826
826
|
): RemoveLiquidityDualTokenAndPtEventFilter;
|
|
827
827
|
|
|
@@ -944,7 +944,7 @@ export interface ActionAddRemoveLiq extends BaseContract {
|
|
|
944
944
|
market: string,
|
|
945
945
|
netLpToRemove: BigNumberish,
|
|
946
946
|
minPtOut: BigNumberish,
|
|
947
|
-
|
|
947
|
+
guessPtReceivedFromSy: ApproxParamsStruct,
|
|
948
948
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
949
949
|
): Promise<BigNumber>;
|
|
950
950
|
|
|
@@ -1036,7 +1036,7 @@ export interface ActionAddRemoveLiq extends BaseContract {
|
|
|
1036
1036
|
market: string,
|
|
1037
1037
|
netLpToRemove: BigNumberish,
|
|
1038
1038
|
minPtOut: BigNumberish,
|
|
1039
|
-
|
|
1039
|
+
guessPtReceivedFromSy: ApproxParamsStruct,
|
|
1040
1040
|
overrides?: Overrides & { from?: string | Promise<string> }
|
|
1041
1041
|
): Promise<PopulatedTransaction>;
|
|
1042
1042
|
|