@pendle/core-v2 6.1.1 → 6.1.3-swapnseed
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/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/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.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/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- 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/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/WeekMath.sol/WeekMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/v3/PendleMarketFactoryV3.sol/PendleMarketFactoryV3.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/v3/PendleMarketV3.sol/PendleMarketV3.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/RewardManager/RewardManagerAbstract.sol/RewardManagerAbstract.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +1 -1
- 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/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20PermitUpg.sol/PendleERC20PermitUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Upg.sol/PendleERC20Upg.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/BaseSplitCodeFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BaseSplitCodeFactory.sol/CodeDeployer.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableV2.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/MiniHelpers.sol/MiniHelpers.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/TokenHelper.sol/TokenHelper.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/LogExpMath.sol/LogExpMath.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/math/PMath.sol/PMath.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol/PendlePTOFTAdapterFactory.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/oftImpl/hub/OFTAdapterImpl.sol/OFTAdapterImpl.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IAddressProvider.sol/IAddressProvider.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILPWrapper.sol/ILPWrapper.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/ILayerZeroReceiver.sol/ILayerZeroReceiver.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.json +141 -0
- package/build/artifacts/contracts/interfaces/IOwnable.sol/IOwnable.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionCallbackV3.sol/IPActionCallbackV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionInfoStatic.sol/IPActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeemStatic.sol/IPActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionVePendleStatic.sol/IPActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPBridgedPrincipalToken.sol/IPBridgedPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPChainlinkOracle.sol/IPChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleEssential.sol/IPChainlinkOracleEssential.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleFactory.sol/IPChainlinkOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPChainlinkOracleWithQuote.sol/IPChainlinkOracleWithQuote.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.json +93 -0
- package/build/artifacts/contracts/interfaces/IPCommonSYFactory.sol/IPCommonSYFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPExchangeRateOracle.sol/IPExchangeRateOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributor.sol/IPFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFeeDistributorV2.sol/IPFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMM.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPFixedPricePTAMM.sol/IPFixedPricePTAMMSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeController.sol/IPGaugeController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGaugeControllerMainchain.sol/IPGaugeControllerMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.json +170 -32
- package/build/artifacts/contracts/interfaces/IPInterestManagerYT.sol/IPInterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLPWrapperFactory.sol/IPLPWrapperFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactoryV3.sol/IPMarketFactoryV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketV3.sol/IPMarketV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMiniDiamond.sol/IPMiniDiamond.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgReceiverApp.sol/IPMsgReceiverApp.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMsgSendEndpoint.sol/IPMsgSendEndpoint.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMultiTokenMerkleDistributor.sol/IPMultiTokenMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPOffchainStorage.sol/IPOffchainStorage.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPOracleForSy.sol/IPOracleForSy.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPTOFTAdapterFactory.sol/IPPTOFTAdapterFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPausingInterface.sol/IPPausingInterface.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPoolDeployHelperV2.sol/IPPoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPriceFeed.sol/IPPriceFeed.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPReflector.sol/IPReflector.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPTokenWithSupplyCap.sol/IPTokenWithSupplyCap.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVeToken.sol/IPVeToken.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/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldTokenV2.sol/IPYieldTokenV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRedstonePriceFeed.sol/IRedstonePriceFeed.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IRewardManager.sol/IRewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWETH.sol/IWETH.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IWstETH.sol/IWstETH.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
- package/build/artifacts/contracts/limit/helpers/NonceManager.sol/NonceManager.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/AutomateReady.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IAutomate.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/IOpsProxyFactory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AutomateReady.sol/ITaskTreasuryUpgradable.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/BalanceReader.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol/BaseSplitCodeFactoryContract.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BytesLib.sol/BytesLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/StarNFTV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.json +265 -0
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.json +192 -53
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallOwnerV1.sol/PendleMulticallOwnerV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleOffchainStorage.sol/PendleOffchainStorage.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleWstETHPriceFeed.sol/PendleWstETHPriceFeed.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/IPossibleSupplyCapInterface.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/SupplyCapReader.sol/SupplyCapReader.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.json +108 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol/MarketDeployLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- 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/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- 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/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- 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/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleBoringOneracle.sol/PendleBoringOneracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleBoringSolvBTCOneracle.sol/PendleBoringSolvBTCOneracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/LPExpiry.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracle.sol/PendleLpLinearDiscountOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleLpLinearDiscountOracleFactory.sol/PendleLpLinearDiscountOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleRedStoneRateOracleAdapter.sol/PendleRedStoneRateOracleAdapter.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PTExpiry.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracle.sol/PendleSparkLinearDiscountOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
- package/build/artifacts/contracts/router/RouterStorage.sol/RouterStorage.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/IPSwapAggregator.sol/IPSwapAggregator.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/IOKXDexRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/OKXScaleHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/IAugustusV6.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/ParaswapScaleHelper.sol/ParaswapScaleHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IKyberScalingHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/IOdosRouterV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.dbg.json +1 -1
- package/contracts/interfaces/IMarketSweed.sol +23 -0
- package/contracts/interfaces/IPCommonPoolDeployHelperV2.sol +9 -0
- package/contracts/interfaces/IPGovernanceProxy.sol +16 -5
- package/contracts/offchain-helpers/MarketSweed.sol +230 -0
- package/contracts/offchain-helpers/PendleGovernanceProxy.sol +57 -32
- package/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol +21 -7
- package/deployments/10-core.json +1 -1
- package/package.json +2 -2
- package/typechain-types/ActionBase.ts +81 -0
- package/typechain-types/ActionInputTracker.ts +81 -0
- package/typechain-types/BoringOwnableUpgradeable.ts +203 -0
- package/typechain-types/BoringOwnableUpgradeable__deprecated.ts +204 -0
- package/typechain-types/IMarketSweed.ts +203 -0
- package/typechain-types/IPCommonPoolDeployHelperV2.ts +66 -0
- package/typechain-types/IPGovernanceProxy.ts +232 -51
- package/typechain-types/IPReentrancyGuardUpg.ts +89 -0
- package/typechain-types/ITracker.ts +224 -0
- package/typechain-types/MarketSweed.ts +216 -0
- package/typechain-types/PendleCommonPoolDeployHelperV2.ts +87 -0
- package/typechain-types/PendleERC20Upg.ts +21 -0
- package/typechain-types/PendleGovernanceProxy.ts +275 -96
- package/typechain-types/PendleMarket.ts +1257 -0
- package/typechain-types/PendleMarketFactory.ts +906 -0
- package/typechain-types/PendleMarketFactoryUpg.ts +773 -0
- package/typechain-types/PendleMarketFactoryV3Upg.ts +760 -0
- package/typechain-types/PendleReentrancyGuardUpg.ts +100 -0
- package/typechain-types/PendleYieldContractFactoryUpg.ts +820 -0
- package/typechain-types/Tracker.ts +432 -0
- package/typechain-types/factories/ActionBase__factory.ts +36 -0
- package/typechain-types/factories/ActionInputTracker__factory.ts +39 -0
- package/typechain-types/factories/BoringOwnableUpgradeable__deprecated__factory.ts +120 -0
- package/typechain-types/factories/BoringOwnableUpgradeable__factory.ts +118 -0
- package/typechain-types/factories/IMarketSweed__factory.ts +153 -0
- package/typechain-types/factories/IPCommonPoolDeployHelperV2__factory.ts +93 -0
- package/typechain-types/factories/IPGovernanceProxy__factory.ts +170 -32
- package/typechain-types/factories/IPReentrancyGuardUpg__factory.ts +43 -0
- package/typechain-types/factories/ITracker__factory.ts +114 -0
- package/typechain-types/factories/MarketSweed__factory.ts +323 -0
- package/typechain-types/factories/PendleCommonPoolDeployHelperV2__factory.ts +107 -1
- package/typechain-types/factories/PendleERC20Upg__factory.ts +13 -0
- package/typechain-types/factories/PendleGovernanceProxy__factory.ts +191 -52
- package/typechain-types/factories/PendleMarketFactoryUpg__factory.ts +732 -0
- package/typechain-types/factories/PendleMarketFactoryV3Upg__factory.ts +719 -0
- package/typechain-types/factories/PendleMarketFactory__factory.ts +748 -0
- package/typechain-types/factories/PendleMarket__factory.ts +1266 -0
- package/typechain-types/factories/PendleReentrancyGuardUpg__factory.ts +56 -0
- package/typechain-types/factories/PendleYieldContractFactoryUpg__factory.ts +692 -0
- package/typechain-types/factories/Tracker__factory.ts +303 -0
- package/typechain-types/hardhat.d.ts +71 -8
- package/typechain-types/index.ts +14 -2
- package/typechain-types/BasePendleBridgedPrincipalToken.ts +0 -1689
- package/typechain-types/PendleBridgedPrincipalToken_18Decimals.ts +0 -1689
- package/typechain-types/PendleBridgedPrincipalToken_6Decimals.ts +0 -1689
- package/typechain-types/PendleBridgedPrincipalToken_8Decimals.ts +0 -1689
- package/typechain-types/factories/BasePendleBridgedPrincipalToken__factory.ts +0 -1548
- package/typechain-types/factories/PendleBridgedPrincipalToken_18Decimals__factory.ts +0 -1652
- package/typechain-types/factories/PendleBridgedPrincipalToken_6Decimals__factory.ts +0 -1650
- package/typechain-types/factories/PendleBridgedPrincipalToken_8Decimals__factory.ts +0 -1650
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import "./IPAllActionV3.sol";
|
|
5
|
+
|
|
6
|
+
interface IMarketSweed {
|
|
7
|
+
struct ApproxSweedParams {
|
|
8
|
+
uint256 targetLnImpliedRate;
|
|
9
|
+
uint256 eps;
|
|
10
|
+
uint256 maxPtToSwap;
|
|
11
|
+
int256 guessOffchain;
|
|
12
|
+
uint256 maxIteration;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function seedAtImpliedRate(
|
|
16
|
+
address receiver,
|
|
17
|
+
address market,
|
|
18
|
+
uint256 minLpOut,
|
|
19
|
+
uint256 minYtOut,
|
|
20
|
+
TokenInput calldata input,
|
|
21
|
+
ApproxSweedParams calldata sweedParams
|
|
22
|
+
) external payable returns (uint256 netLpOut, uint256 netYtOut, int256 guessedAmountPtToSwap);
|
|
23
|
+
}
|
|
@@ -27,4 +27,13 @@ interface IPCommonPoolDeployHelperV2 is IPPoolDeployHelperV2 {
|
|
|
27
27
|
uint256 amountToSeed,
|
|
28
28
|
address syOwner
|
|
29
29
|
) external returns (PoolDeploymentAddrs memory);
|
|
30
|
+
|
|
31
|
+
function deployCommonMarketById(
|
|
32
|
+
bytes32 id,
|
|
33
|
+
bytes memory constructorParams,
|
|
34
|
+
PoolConfig memory config,
|
|
35
|
+
address tokenToSeedLiqudity,
|
|
36
|
+
uint256 amountToSeed,
|
|
37
|
+
address syOwner
|
|
38
|
+
) external returns (PoolDeploymentAddrs memory);
|
|
30
39
|
}
|
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
4
|
interface IPGovernanceProxy {
|
|
5
|
+
event ModifyScopedAccess(address indexed caller, bytes4 indexed selector, address indexed target, bool access);
|
|
6
|
+
|
|
7
|
+
event ModifySelectorAdmin(address indexed addr, bytes4 indexed selector, bool isAdmin);
|
|
8
|
+
|
|
9
|
+
event SetAllowedSelectors(bytes4[] selectors, bytes32 indexed role); // Deprecated
|
|
10
|
+
|
|
5
11
|
struct Call {
|
|
6
12
|
address target;
|
|
7
13
|
uint256 value;
|
|
@@ -12,13 +18,18 @@ interface IPGovernanceProxy {
|
|
|
12
18
|
|
|
13
19
|
function aggregate(Call[] calldata calls) external payable returns (bytes[] memory rtnData);
|
|
14
20
|
|
|
15
|
-
|
|
21
|
+
function aggregateWithScopedAccess(Call[] calldata calls) external payable returns (bytes[] memory rtnData);
|
|
16
22
|
|
|
17
|
-
function
|
|
23
|
+
function isSelectorAdminOf(address addr, bytes4 selector) external view returns (bool);
|
|
18
24
|
|
|
19
|
-
function
|
|
25
|
+
function hasScopedAccess(address caller, bytes4 selector, address target) external view returns (bool);
|
|
20
26
|
|
|
21
|
-
function
|
|
27
|
+
function modifySelectorAdmin(address addr, bytes4[] memory selectors, bool[] memory isAdmins) external;
|
|
22
28
|
|
|
23
|
-
function
|
|
29
|
+
function modifyScopedAccess(
|
|
30
|
+
address caller,
|
|
31
|
+
address[] memory targets,
|
|
32
|
+
bytes4 selector,
|
|
33
|
+
bool[] memory accesses
|
|
34
|
+
) external;
|
|
24
35
|
}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.17;
|
|
4
|
+
|
|
5
|
+
import "../interfaces/IPMarket.sol";
|
|
6
|
+
import "../router/math/MarketApproxLibOnchain.sol";
|
|
7
|
+
import "../router/base/ActionBase.sol";
|
|
8
|
+
import "../interfaces/IMarketSweed.sol";
|
|
9
|
+
|
|
10
|
+
contract MarketSweed is ActionBase, IMarketSweed {
|
|
11
|
+
using PMath for uint256;
|
|
12
|
+
using PMath for int256;
|
|
13
|
+
using PYIndexLib for PYIndex;
|
|
14
|
+
using MarketMathCore for MarketState;
|
|
15
|
+
using PYIndexLib for IPYieldToken;
|
|
16
|
+
|
|
17
|
+
address public immutable router;
|
|
18
|
+
|
|
19
|
+
struct MarketTokens {
|
|
20
|
+
IStandardizedYield SY;
|
|
21
|
+
IPPrincipalToken PT;
|
|
22
|
+
IPYieldToken YT;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
constructor(address _router, address _dustReceiver) ActionBase(_dustReceiver) {
|
|
26
|
+
router = _router;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function seedAtImpliedRate(
|
|
30
|
+
address receiver,
|
|
31
|
+
address market,
|
|
32
|
+
uint256 minLpOut,
|
|
33
|
+
uint256 minYtOut,
|
|
34
|
+
TokenInput calldata input,
|
|
35
|
+
ApproxSweedParams calldata sweedParams
|
|
36
|
+
) external payable returns (uint256 netLpOut, uint256 netYtOut, int256 guessedAmountPtToSwap) {
|
|
37
|
+
MarketTokens memory tokens;
|
|
38
|
+
(tokens.SY, tokens.PT, tokens.YT) = IPMarket(market).readTokens();
|
|
39
|
+
|
|
40
|
+
_mintSyFromToken(address(this), address(tokens.SY), 1, input);
|
|
41
|
+
|
|
42
|
+
uint256 netPtOut;
|
|
43
|
+
(netPtOut, netYtOut, guessedAmountPtToSwap) = _swap(receiver, market, tokens, sweedParams);
|
|
44
|
+
|
|
45
|
+
uint256 netYtFromSeed;
|
|
46
|
+
(netLpOut, netYtFromSeed, ) = _seed(receiver, market, tokens.SY, tokens.YT, _selfBalance(tokens.SY), netPtOut);
|
|
47
|
+
netYtOut += netYtFromSeed;
|
|
48
|
+
|
|
49
|
+
if (netLpOut < minLpOut) revert("Slippage: INSUFFICIENT_LP_OUT");
|
|
50
|
+
if (netYtOut < minYtOut) revert("Slippage: INSUFFICIENT_YT_OUT");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function _seed(
|
|
54
|
+
address receiver,
|
|
55
|
+
address market,
|
|
56
|
+
IStandardizedYield SY,
|
|
57
|
+
IPYieldToken YT,
|
|
58
|
+
uint256 netSyIn,
|
|
59
|
+
uint256 netPtIn
|
|
60
|
+
) internal returns (uint256 netLpOut, uint256 netYtOut, uint256 netSyMintPy) {
|
|
61
|
+
MarketState memory state = _readMarket(market);
|
|
62
|
+
|
|
63
|
+
uint256 netSyDual = 0;
|
|
64
|
+
if (netPtIn > 0) {
|
|
65
|
+
/** Add dual SY + PT */
|
|
66
|
+
uint256 netPtDual;
|
|
67
|
+
(, , netSyDual, netPtDual) = _readMarket(market).addLiquidity(netSyIn, netPtIn, block.timestamp);
|
|
68
|
+
if (netPtIn > netPtDual || netSyDual == netSyIn) {
|
|
69
|
+
revert("MS: Bought too much PT");
|
|
70
|
+
}
|
|
71
|
+
netSyIn -= netSyDual;
|
|
72
|
+
_transferOut(YT.PT(), market, netPtDual);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
PYIndex pyIndex = YT.newIndex();
|
|
76
|
+
netSyMintPy =
|
|
77
|
+
(netSyIn * state.totalPt.Uint()) /
|
|
78
|
+
(state.totalPt.Uint() + pyIndex.syToAsset(state.totalSy.Uint()));
|
|
79
|
+
|
|
80
|
+
uint256 netSyAddLiquidity = netSyIn - netSyMintPy;
|
|
81
|
+
|
|
82
|
+
// transfer SY to mint PY
|
|
83
|
+
_transferOut(address(SY), address(YT), netSyMintPy);
|
|
84
|
+
|
|
85
|
+
// PT goes to market, YT goes to receiver
|
|
86
|
+
netYtOut = YT.mintPY(market, receiver);
|
|
87
|
+
|
|
88
|
+
// the rest of SY goes to market
|
|
89
|
+
_transferOut(address(SY), market, netSyAddLiquidity + netSyDual);
|
|
90
|
+
|
|
91
|
+
(netLpOut, , ) = IPMarket(market).mint(receiver, netSyAddLiquidity, netYtOut);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _swap(
|
|
95
|
+
address receiver,
|
|
96
|
+
address market,
|
|
97
|
+
MarketTokens memory tokens,
|
|
98
|
+
ApproxSweedParams memory sweedParams
|
|
99
|
+
) internal returns (uint256 amountPtToAccount, uint256 amountYTToAccount, int256 guessedSwap) {
|
|
100
|
+
PYIndex index = _getPYIndex(market);
|
|
101
|
+
MarketState memory state = _readMarket(market);
|
|
102
|
+
MarketPreCompute memory comp = state.getMarketPreCompute(index, block.timestamp);
|
|
103
|
+
|
|
104
|
+
if (state.lastLnImpliedRate > sweedParams.targetLnImpliedRate) {
|
|
105
|
+
// Normalize maxPtToSwap
|
|
106
|
+
sweedParams.maxPtToSwap = PMath.min(
|
|
107
|
+
sweedParams.maxPtToSwap,
|
|
108
|
+
MarketApproxPtOutLibOnchain.calcMaxPtOut(comp, state.totalPt)
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
int256 amountSyToAccount;
|
|
112
|
+
|
|
113
|
+
(guessedSwap, amountSyToAccount) = _calcAmountPtToBuy(state, index, sweedParams);
|
|
114
|
+
amountPtToAccount = guessedSwap.Uint();
|
|
115
|
+
|
|
116
|
+
_transferOut(address(tokens.SY), market, amountSyToAccount.abs());
|
|
117
|
+
IPMarket(market).swapSyForExactPt(address(this), guessedSwap.abs(), EMPTY_BYTES);
|
|
118
|
+
} else {
|
|
119
|
+
// Normalize maxPtToSwap
|
|
120
|
+
sweedParams.maxPtToSwap = PMath.min(
|
|
121
|
+
sweedParams.maxPtToSwap,
|
|
122
|
+
MarketApproxPtInLibOnchain.calcSoftMaxPtIn(state, comp)
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
guessedSwap = _calcAmountPtToSell(state, index, sweedParams);
|
|
126
|
+
|
|
127
|
+
uint256 amountPtToSell = guessedSwap.abs();
|
|
128
|
+
amountYTToAccount = amountPtToSell;
|
|
129
|
+
|
|
130
|
+
_transferOut(address(tokens.SY), address(tokens.YT), index.assetToSyUp(amountPtToSell));
|
|
131
|
+
uint256 amountPYOut = tokens.YT.mintPY(market, receiver);
|
|
132
|
+
|
|
133
|
+
assert(amountPYOut >= amountPtToSell);
|
|
134
|
+
|
|
135
|
+
// this amount of SY will be used to add liquidity in later step
|
|
136
|
+
IPMarket(market).swapExactPtForSy(address(this), amountPtToSell, EMPTY_BYTES);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function _calcAmountPtToBuy(
|
|
141
|
+
MarketState memory state,
|
|
142
|
+
PYIndex index,
|
|
143
|
+
ApproxSweedParams memory sweedParams
|
|
144
|
+
) internal view returns (int256 amountPtToSwapToAccount, int256 amountSyToAccount) {
|
|
145
|
+
int256 refAmt = sweedParams.maxPtToSwap.Int();
|
|
146
|
+
int256 accPtToAccount = 0;
|
|
147
|
+
|
|
148
|
+
for (uint256 iter = 0; iter < sweedParams.maxIteration; ++iter) {
|
|
149
|
+
int256 guess;
|
|
150
|
+
if (iter == 0 && _isValidGuessOffchain(sweedParams, true)) {
|
|
151
|
+
guess = sweedParams.guessOffchain;
|
|
152
|
+
} else {
|
|
153
|
+
refAmt /= 2;
|
|
154
|
+
guess = accPtToAccount + refAmt;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
MarketState memory localState = _deepCopy(state);
|
|
158
|
+
|
|
159
|
+
// // Will not revert. maxPtToBuy should already be normalized
|
|
160
|
+
(int256 localAmountSyToAccount, , ) = localState.executeTradeCore(index, guess, block.timestamp);
|
|
161
|
+
|
|
162
|
+
if (PMath.isAApproxB(localState.lastLnImpliedRate, sweedParams.targetLnImpliedRate, sweedParams.eps)) {
|
|
163
|
+
return (guess, localAmountSyToAccount);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (localState.lastLnImpliedRate > sweedParams.targetLnImpliedRate) {
|
|
167
|
+
accPtToAccount += refAmt;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
revert("_calcAmountPtToBuy: failed");
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function _calcAmountPtToSell(
|
|
174
|
+
MarketState memory state,
|
|
175
|
+
PYIndex index,
|
|
176
|
+
ApproxSweedParams memory sweedParams
|
|
177
|
+
) internal view returns (int256 amountPtToSwapToAccount) {
|
|
178
|
+
int256 refAmt = sweedParams.maxPtToSwap.Int();
|
|
179
|
+
int256 accPtToAccount = 0;
|
|
180
|
+
|
|
181
|
+
for (uint256 iter = 0; iter < sweedParams.maxIteration; ++iter) {
|
|
182
|
+
int256 guess;
|
|
183
|
+
if (iter == 0 && _isValidGuessOffchain(sweedParams, false)) {
|
|
184
|
+
guess = sweedParams.guessOffchain;
|
|
185
|
+
} else {
|
|
186
|
+
refAmt /= 2;
|
|
187
|
+
guess = accPtToAccount - refAmt;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
MarketState memory localState = _deepCopy(state);
|
|
191
|
+
|
|
192
|
+
// Will not revert. maxPtToSell should already be normalized
|
|
193
|
+
localState.executeTradeCore(index, guess, block.timestamp);
|
|
194
|
+
|
|
195
|
+
if (PMath.isAApproxB(localState.lastLnImpliedRate, sweedParams.targetLnImpliedRate, sweedParams.eps)) {
|
|
196
|
+
return guess;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (localState.lastLnImpliedRate < sweedParams.targetLnImpliedRate) {
|
|
200
|
+
accPtToAccount -= refAmt;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
revert("_calcAmountPtToSell: failed");
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
function _getPYIndex(address market) internal returns (PYIndex) {
|
|
207
|
+
(, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
208
|
+
return PYIndex.wrap(YT.pyIndexCurrent());
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function _deepCopy(MarketState memory state) internal pure returns (MarketState memory copiedState) {
|
|
212
|
+
copiedState.totalPt = state.totalPt;
|
|
213
|
+
copiedState.totalSy = state.totalSy;
|
|
214
|
+
copiedState.totalLp = state.totalLp;
|
|
215
|
+
copiedState.treasury = state.treasury;
|
|
216
|
+
|
|
217
|
+
copiedState.scalarRoot = state.scalarRoot;
|
|
218
|
+
copiedState.expiry = state.expiry;
|
|
219
|
+
|
|
220
|
+
copiedState.lnFeeRateRoot = state.lnFeeRateRoot;
|
|
221
|
+
copiedState.reserveFeePercent = state.reserveFeePercent;
|
|
222
|
+
copiedState.lastLnImpliedRate = state.lastLnImpliedRate;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function _isValidGuessOffchain(ApproxSweedParams memory sweedParams, bool isBuyingPt) internal pure returns (bool) {
|
|
226
|
+
if (sweedParams.guessOffchain == 0) return false;
|
|
227
|
+
if (isBuyingPt != (sweedParams.guessOffchain > 0)) return false;
|
|
228
|
+
return sweedParams.guessOffchain.abs() <= sweedParams.maxPtToSwap;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -13,30 +13,34 @@ import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
|
|
|
13
13
|
contract PendleGovernanceProxy is AccessControlUpgradeable, UUPSUpgradeable, IPGovernanceProxy {
|
|
14
14
|
bytes32 public constant GUARDIAN = keccak256("GUARDIAN");
|
|
15
15
|
|
|
16
|
-
bytes32 public
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
mapping(bytes4 => bytes32) public __deprecated_allowedSelectors;
|
|
17
|
+
|
|
18
|
+
// Only the [ADMIN] (governance) of PendleGovernanceProxy can modify one address to be
|
|
19
|
+
// a selector admin of some selectors.
|
|
20
|
+
//
|
|
21
|
+
// A [selector admin] of a selector can grant/revoke scoped access of that selector
|
|
22
|
+
// to/from ANY caller and ANY target.
|
|
23
|
+
//
|
|
24
|
+
// For example: [0xdeployer] is a selector admin of `updateSupplyCap(uint256)`, he can
|
|
25
|
+
// grant/revoke the scoped access of, say [0xalice] to call `updateSupplyCap(uint256)`
|
|
26
|
+
// on ANY target contract (in this case, SYs).
|
|
27
|
+
//
|
|
28
|
+
// Changes on execution:
|
|
29
|
+
// - aggregate(Call[]): is now callable by [ADMIN] only
|
|
30
|
+
// - aggregateWithScopedAccess(Call[]): new function to let anyone with scoped access
|
|
31
|
+
// to execute calls
|
|
32
|
+
|
|
33
|
+
mapping(address caller => mapping(bytes4 selector => bool isAdmin)) public isSelectorAdminOf;
|
|
34
|
+
mapping(address caller => mapping(bytes4 selector => mapping(address target => bool isAllowed)))
|
|
35
|
+
public hasScopedAccess;
|
|
21
36
|
|
|
22
37
|
modifier onlyGuardian() {
|
|
23
|
-
require(hasRole(GUARDIAN, msg.sender) || hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "n/a");
|
|
38
|
+
require(hasRole(GUARDIAN, msg.sender) || hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "PGP: n/a");
|
|
24
39
|
_;
|
|
25
40
|
}
|
|
26
41
|
|
|
27
42
|
modifier onlyAdmin() {
|
|
28
|
-
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "n/a");
|
|
29
|
-
_;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
modifier onlyHaveSomeRole() {
|
|
33
|
-
require(
|
|
34
|
-
hasRole(ALICE, msg.sender) ||
|
|
35
|
-
hasRole(BOB, msg.sender) ||
|
|
36
|
-
hasRole(CHARLIE, msg.sender) ||
|
|
37
|
-
hasRole(DEFAULT_ADMIN_ROLE, msg.sender),
|
|
38
|
-
"n/a"
|
|
39
|
-
);
|
|
43
|
+
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "PGP: n/a");
|
|
40
44
|
_;
|
|
41
45
|
}
|
|
42
46
|
|
|
@@ -44,14 +48,42 @@ contract PendleGovernanceProxy is AccessControlUpgradeable, UUPSUpgradeable, IPG
|
|
|
44
48
|
_disableInitializers();
|
|
45
49
|
}
|
|
46
50
|
|
|
47
|
-
function aggregate(Call[] calldata calls) external payable
|
|
48
|
-
|
|
51
|
+
function aggregate(Call[] calldata calls) external payable onlyAdmin returns (bytes[] memory) {
|
|
52
|
+
return _aggregate(calls);
|
|
53
|
+
}
|
|
49
54
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
/*///////////////////////////////////////////////////////////////
|
|
56
|
+
SCOPED ACCESS
|
|
57
|
+
//////////////////////////////////////////////////////////////*/
|
|
58
|
+
|
|
59
|
+
function modifySelectorAdmin(address addr, bytes4[] memory selectors, bool[] memory isAdmins) external onlyAdmin {
|
|
60
|
+
require(selectors.length == isAdmins.length, "PGP: Array length mismatch");
|
|
61
|
+
|
|
62
|
+
for (uint256 i = 0; i < selectors.length; i++) {
|
|
63
|
+
isSelectorAdminOf[addr][selectors[i]] = isAdmins[i];
|
|
64
|
+
emit ModifySelectorAdmin(addr, selectors[i], isAdmins[i]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function modifyScopedAccess(
|
|
69
|
+
address caller,
|
|
70
|
+
address[] memory targets,
|
|
71
|
+
bytes4 selector,
|
|
72
|
+
bool[] memory accesses
|
|
73
|
+
) external {
|
|
74
|
+
require(targets.length == accesses.length, "PGP: Array length mismatch");
|
|
75
|
+
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || isSelectorAdminOf[msg.sender][selector], "PGP: n/a");
|
|
76
|
+
|
|
77
|
+
for (uint256 i = 0; i < targets.length; i++) {
|
|
78
|
+
hasScopedAccess[caller][selector][targets[i]] = accesses[i];
|
|
79
|
+
emit ModifyScopedAccess(caller, selector, targets[i], accesses[i]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function aggregateWithScopedAccess(Call[] calldata calls) external payable returns (bytes[] memory) {
|
|
84
|
+
for (uint256 i = 0; i < calls.length; i++) {
|
|
85
|
+
bytes4 selector = bytes4(calls[i].callData[:4]);
|
|
86
|
+
require(hasScopedAccess[msg.sender][selector][calls[i].target], "PGP: n/a");
|
|
55
87
|
}
|
|
56
88
|
|
|
57
89
|
return _aggregate(calls);
|
|
@@ -75,13 +107,6 @@ contract PendleGovernanceProxy is AccessControlUpgradeable, UUPSUpgradeable, IPG
|
|
|
75
107
|
ADMIN CALL
|
|
76
108
|
//////////////////////////////////////////////////////////////*/
|
|
77
109
|
|
|
78
|
-
function setAllowedSelectors(bytes4[] calldata selectors, bytes32 role) external onlyAdmin {
|
|
79
|
-
for (uint256 i = 0; i < selectors.length; i++) {
|
|
80
|
-
allowedSelectors[selectors[i]] = role;
|
|
81
|
-
}
|
|
82
|
-
emit SetAllowedSelectors(selectors, role);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
110
|
function _aggregate(Call[] calldata calls) internal returns (bytes[] memory rtnData) {
|
|
86
111
|
uint256 length = calls.length;
|
|
87
112
|
rtnData = new bytes[](length);
|
|
@@ -7,13 +7,15 @@ import "../../interfaces/IOwnable.sol";
|
|
|
7
7
|
import "../../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
8
8
|
|
|
9
9
|
contract PendleCommonPoolDeployHelperV2 is PendlePoolDeployHelperV2, BoringOwnableUpgradeableV2 {
|
|
10
|
-
|
|
11
|
-
bytes32 public constant
|
|
12
|
-
bytes32 public constant
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
bytes32 public constant
|
|
16
|
-
bytes32 public constant
|
|
10
|
+
|
|
11
|
+
bytes32 public constant ERC4626_DEPLOY_ID = keccak256("PendleERC4626SYV2"); // 0x1278efc0e6754cd30fef2df25ff5ced072ebb194d348b0b1b9548166d24352ef
|
|
12
|
+
bytes32 public constant ERC4626_NOT_REDEEMABLE_DEPLOY_ID = keccak256("PendleERC4626NotRedeemableToAssetSYV2"); // 0x6f089cd4afdd945c5c26b3f4542d0c294d19ec0e339c6ce4f8eafa94d700d05d
|
|
13
|
+
bytes32 public constant ERC20_DEPLOY_ID = keccak256("PendleERC20SY"); // 0xfcf22a9a515753d83e4f2a81cf368c7226408c64f52411ae95241ebf5ed53304
|
|
14
|
+
|
|
15
|
+
bytes32 public constant ERC4626_WITH_ADAPTER_ID = keccak256("PendleERC4626WithAdapterSY"); // 0x73f41560741d6765943d3c955034291fe23d9141e3a4719bc97422d5bf019adc
|
|
16
|
+
bytes32 public constant ERC4626_NO_REDEEM_WITH_ADAPTER_ID = keccak256("PendleERC4626NoRedeemWithAdapterSY"); // 0x3b8dd2b992f773444e5422ba1db289c4657c57110d740dca7975dc095632ef23
|
|
17
|
+
bytes32 public constant ERC20_WITH_ADAPTER_ID = keccak256("PendleERC20WithAdapterSY"); // 0xe5cce2b1999bf8c2cc4cf6d96d0569a24d8b782ba1647c09a8e1aa8bbfb98996
|
|
18
|
+
bytes32 public constant ERC4626_NO_DEPOSIT_NO_REDEEM = keccak256("PendleERC4626NoRedeemNoDepositUpgSY"); // 0x5c1cddc0128e0b02bb711f84a022bf1c13177d4ab028830b702f3a77280025ea
|
|
17
19
|
|
|
18
20
|
address public immutable syFactory;
|
|
19
21
|
|
|
@@ -31,6 +33,18 @@ contract PendleCommonPoolDeployHelperV2 is PendlePoolDeployHelperV2, BoringOwnab
|
|
|
31
33
|
__BoringOwnableV2_init(_owner);
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
function deployCommonMarketById(
|
|
37
|
+
bytes32 id,
|
|
38
|
+
bytes memory constructorParams,
|
|
39
|
+
PoolConfig memory config,
|
|
40
|
+
address tokenToSeedLiqudity,
|
|
41
|
+
uint256 amountToSeed,
|
|
42
|
+
address syOwner
|
|
43
|
+
) external returns (PoolDeploymentAddrs memory) {
|
|
44
|
+
address SY = IPCommonSYFactory(syFactory).deploySY(id, constructorParams, syOwner);
|
|
45
|
+
return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
|
|
46
|
+
}
|
|
47
|
+
|
|
34
48
|
// Those 3 are all not payable as they should not accept tokenIn as native
|
|
35
49
|
|
|
36
50
|
function deployERC4626Market(
|
package/deployments/10-core.json
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"proxyAdmin": "0xA28c08f165116587D4F3E708743B4dEe155c5E64",
|
|
45
45
|
"reflector": "0x73d5DBF81A4f3bFa7b335e6a2d4638D6017a4fA8",
|
|
46
46
|
"vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
|
|
47
|
-
"externalRewardsDistributor": "
|
|
47
|
+
"externalRewardsDistributor": "0x33305665f69B4642D1275f4Ce81c23651674D21C",
|
|
48
48
|
"commonDeploy": "0x2Ed473F528E5B320f850d17ADfe0e558f0298aA9",
|
|
49
49
|
"syFactory": "0x466CeD3b33045Ea986B2f306C8D0aA8067961CF8",
|
|
50
50
|
"sparkLinearDiscountOracleFactory": "0x34C91651A070664279866E5f3d6B4d5F65cbbFFb",
|
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": "6.1.
|
|
5
|
+
"version": "6.1.3-swapnseed",
|
|
6
6
|
"homepage": "https://pendle.finance",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"pendle",
|
|
@@ -56,4 +56,4 @@
|
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
}
|
|
59
|
-
}
|
|
59
|
+
}
|