@pendle/core-v2 6.3.1 → 6.3.2-pendle-merkle-transfer
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/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol/ExcessivelySafeCall.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol/LayerZeroHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/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/PendleMerkleDistributor.sol/PendleMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/PendleMerkleDistributor.sol/PendleMerkleDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol/PendleMultiTokenMerkleDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol/PendleVotingControllerUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol/VotingControllerStorageUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol/VotingEscrowPendleMainchain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol/VotingEscrowPendleSidechain.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/VotingEscrow/VotingEscrowTokenBase.sol/VotingEscrowTokenBase.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeBalanceLib.sol/VeBalanceLib.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/CheckpointHelper.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/libraries/VeHistoryLib.sol/Checkpoints.json +2 -2
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.json +2 -2
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/OracleLib.sol/OracleLib.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactoryV6Upg.sol/PendleMarketFactoryV6Upg.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactoryV6Upg.sol/PendleMarketFactoryV6Upg.json +2 -2
- package/build/artifacts/contracts/core/Market/PendleMarketV6.sol/PendleMarketV6.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketV6.sol/PendleMarketV6.json +2 -2
- 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/PYIndex.sol/PYIndexLib.json +2 -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/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol/PendleYieldContractFactoryUpg.json +2 -2
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +2 -2
- package/build/artifacts/contracts/core/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/libraries/ArrayLib.sol/ArrayLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ArrayLib.sol/ArrayLib.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 +2 -2
- 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/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableData.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/BoringOwnableUpgradeableV2.sol/BoringOwnableUpgradeableData.json +2 -2
- 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/Errors.sol/Errors.json +2 -2
- package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/ExpiryUtilsLib.sol/ExpiryUtils.json +2 -2
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/StringLib.sol/StringLib.json +2 -2
- 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/LogExpMath.sol/LogExpMath.json +2 -2
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/FixedPricePTAMM.sol/FixedPricePTAMM.json +2 -2
- package/build/artifacts/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol/PendlePTOFTAdapterFactory.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol/PendlePTOFTAdapterFactory.json +2 -2
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol/PendleBridgedPrincipalToken.json +2 -2
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.dbg.json +1 -1
- package/build/artifacts/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol/PendleFeeDistributorV2.json +2 -2
- package/build/artifacts/contracts/interfaces/ILayerZeroEndpoint.sol/ILayerZeroEndpoint.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/IPCommonSYFactory.sol/IPCommonSYFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPExchangeRateOracleApp.sol/IPExchangeRateOracleApp.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/IPGovernanceProxy.sol/IPGovernanceProxy.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPInterestManagerYTV2.sol/IPInterestManagerYTV2.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/IPLimitRouter.json +0 -42
- 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/IPMarket.sol/IPMarket.json +0 -13
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMerkleDistributor.sol/IPMerkleDistributor.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/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/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/IStandardizedYield.sol/IStandardizedYield.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.json +2 -2
- package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/AddressProvider.sol/AddressProvider.json +2 -2
- 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/BalanceReader.sol/BalanceReader.json +2 -2
- 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/Broadcaster.sol/Broadcaster.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Broadcaster.sol/Broadcaster.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/BytesLib.sol/BytesLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BytesLib.sol/BytesLib.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/EmptyUUPS.sol/EmptyUUPS.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LegacyNFTHelper.sol/LegacyNFTHelper.json +2 -2
- 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/LimitBackendHelperV2.sol/LimitBackendHelperV2.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/Multicall2.sol/Multicall2.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleExchangeRateOracle.sol/PendleExchangeRateOracle.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleMerkleDepositor.sol/PendleMerkleDepositor.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/PendleMerkleDepositor.sol/PendleMerkleDepositor.json +102 -0
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallOwnerV1.sol/PendleMulticallOwnerV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallOwnerV1.sol/PendleMulticallOwnerV1.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV1.sol/PendleMulticallV1.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleMulticallV2.sol/PendleMulticallV2.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleOffchainStorage.sol/PendleOffchainStorage.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleOffchainStorage.sol/PendleOffchainStorage.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/PendleWstETHPriceFeed.sol/PendleWstETHPriceFeed.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleWstETHPriceFeed.sol/PendleWstETHPriceFeed.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/SimulateHelper.sol/SimulateHelper.json +2 -2
- 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 +2 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol/PendleCommonSYFactory.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol/MarketDeployLib.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol/MarketDeployLib.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol/SDKErrorsDirectory.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.json +2 -2
- 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/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.json +2 -2
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol/PendleCrossChainOracleBaseApp_Init.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol/PendleExchangeRateOracleApp.json +2 -2
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol/PendleExchangeRateOracleV2.json +2 -2
- package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol/ExchangeRateMsgCodec.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.json +2 -2
- 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/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.json +2 -2
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol/PendleSparkLinearDiscountOracleFactoryWrapper.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol/PendleSparkLinearDiscountOracleFactoryWrapper.json +2 -2
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.json +2 -2
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.json +2 -2
- package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.json +2 -2
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +2 -2
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -2
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -2
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.json +2 -2
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.json +2 -2
- package/build/artifacts/contracts/router/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/ApproxStateLib.sol/ApproxStateLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.json +2 -2
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.json +2 -2
- package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/IOKXDexRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/swap-aggregator/OKXScaleHelper.sol/IOKXDexRouter.json +0 -171
- 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/ParaswapScaleHelper.sol/ParaswapScaleHelper.json +2 -2
- 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/build/artifacts/contracts/router/swap-aggregator/PendleSwap.sol/PendleSwap.json +2 -2
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +17 -15
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +16 -14
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +3 -2
- package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +12 -9
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +12 -12
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +10 -8
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol +12 -6
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol +11 -4
- package/contracts/LiquidityMining/PendleMerkleDistributor.sol +13 -11
- package/contracts/LiquidityMining/PendleMultiTokenMerkleDistributor.sol +22 -17
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +28 -21
- package/contracts/LiquidityMining/VotingController/VotingControllerStorageUpg.sol +27 -31
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +23 -19
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleSidechain.sol +8 -7
- package/contracts/LiquidityMining/libraries/VeBalanceLib.sol +5 -6
- package/contracts/core/Market/MarketMathCore.sol +112 -78
- package/contracts/core/Market/OracleLib.sol +41 -34
- package/contracts/core/Market/PendleGauge.sol +8 -8
- package/contracts/core/Market/PendleMarketFactoryV6Upg.sol +16 -19
- package/contracts/core/Market/PendleMarketV6.sol +65 -63
- package/contracts/core/RewardManager/RewardManager.sol +8 -8
- package/contracts/core/RewardManager/RewardManagerAbstract.sol +5 -6
- package/contracts/core/StandardizedYield/PYIndex.sol +2 -2
- package/contracts/core/YieldContracts/InterestManagerYT.sol +9 -8
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +8 -4
- package/contracts/core/YieldContracts/PendleYieldContractFactoryUpg.sol +12 -15
- package/contracts/core/YieldContracts/PendleYieldToken.sol +41 -54
- package/contracts/core/erc20/PendleERC20.sol +6 -9
- package/contracts/core/libraries/ArrayLib.sol +13 -11
- package/contracts/core/libraries/BaseSplitCodeFactory.sol +29 -22
- package/contracts/core/libraries/BoringOwnableUpgradeableV2.sol +1 -2
- package/contracts/core/libraries/Errors.sol +4 -1
- package/contracts/core/libraries/ExpiryUtilsLib.sol +10 -10
- package/contracts/core/libraries/StringLib.sol +13 -13
- package/contracts/core/libraries/TokenHelper.sol +3 -3
- package/contracts/core/libraries/math/LogExpMath.sol +67 -77
- package/contracts/cross-chain/FixedPricePTAMM.sol +39 -38
- package/contracts/cross-chain/factory/hub/PendlePTOFTAdapterFactory.sol +1 -1
- package/contracts/cross-chain/oftImpl/spoke/PendleBridgedPrincipalToken.sol +1 -1
- package/contracts/deprecated/VeDistributor/PendleFeeDistributor.sol +12 -15
- package/contracts/deprecated/VeDistributor/PendleFeeDistributorV2.sol +24 -21
- package/contracts/interfaces/ILayerZeroEndpoint.sol +3 -5
- package/contracts/interfaces/IPActionCallbackV3.sol +1 -1
- package/contracts/interfaces/IPActionInfoStatic.sol +3 -1
- package/contracts/interfaces/IPActionMarketAuxStatic.sol +15 -11
- package/contracts/interfaces/IPActionMarketCoreStatic.sol +109 -58
- package/contracts/interfaces/IPActionMintRedeemStatic.sol +26 -21
- package/contracts/interfaces/IPActionMiscV3.sol +44 -24
- package/contracts/interfaces/IPActionSimple.sol +43 -24
- package/contracts/interfaces/IPActionVePendleStatic.sol +5 -4
- package/contracts/interfaces/IPAllActionTypeV3.sol +16 -14
- package/contracts/interfaces/IPAllActionV3.sol +4 -4
- package/contracts/interfaces/IPAllEventsV3.sol +21 -5
- package/contracts/interfaces/IPBridgedPrincipalToken.sol +2 -2
- package/contracts/interfaces/IPCommonSYFactory.sol +6 -3
- package/contracts/interfaces/IPExchangeRateOracleApp.sol +26 -25
- package/contracts/interfaces/IPFeeDistributorV2.sol +16 -13
- package/contracts/interfaces/IPFixedPricePTAMM.sol +34 -22
- package/contracts/interfaces/IPGovernanceProxy.sol +6 -2
- package/contracts/interfaces/IPInterestManagerYTV2.sol +3 -4
- package/contracts/interfaces/IPLimitRouter.sol +16 -16
- package/contracts/interfaces/IPMarket.sol +35 -25
- package/contracts/interfaces/IPMarketFactory.sol +16 -9
- package/contracts/interfaces/IPMerkleDistributor.sol +10 -6
- package/contracts/interfaces/IPMsgSendEndpoint.sol +12 -7
- package/contracts/interfaces/IPMultiTokenMerkleDistributor.sol +12 -6
- package/contracts/interfaces/IPPYLpOracle.sol +4 -1
- package/contracts/interfaces/IPRouterStatic.sol +3 -3
- package/contracts/interfaces/IPVotingController.sol +4 -4
- package/contracts/interfaces/IPVotingEscrowMainchain.sol +1 -1
- package/contracts/interfaces/IPYieldContractFactory.sol +5 -3
- package/contracts/interfaces/IPYieldToken.sol +11 -8
- package/contracts/interfaces/IPYieldTokenV2.sol +11 -8
- package/contracts/interfaces/IStandardizedYield.sol +17 -16
- package/contracts/limit/LimitMathCore.sol +56 -38
- package/contracts/limit/LimitRouterBase.sol +88 -66
- package/contracts/limit/PendleLimitRouter.sol +7 -11
- package/contracts/offchain-helpers/AddressProvider.sol +1 -1
- package/contracts/offchain-helpers/AutomateReady.sol +2 -2
- package/contracts/offchain-helpers/BalanceReader.sol +9 -21
- package/contracts/offchain-helpers/BaseSplitCodeFactoryContract.sol +7 -5
- package/contracts/offchain-helpers/Broadcaster.sol +3 -3
- package/contracts/offchain-helpers/BytesLib.sol +5 -3
- package/contracts/offchain-helpers/EmptyUUPS.sol +2 -2
- package/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol +8 -5
- package/contracts/offchain-helpers/LegacyNFTHelper.sol +5 -1
- package/contracts/offchain-helpers/LimitBackendHelperV2.sol +12 -12
- package/contracts/offchain-helpers/Multicall2.sol +7 -9
- package/contracts/offchain-helpers/PendleExchangeRateOracle.sol +8 -4
- package/contracts/offchain-helpers/PendleGovernanceProxy.sol +10 -7
- package/contracts/offchain-helpers/PendleLPWrapper.sol +3 -12
- package/contracts/offchain-helpers/PendleLPWrapperFactory.sol +2 -2
- package/contracts/offchain-helpers/PendleMerkleDepositor.sol +64 -0
- package/contracts/offchain-helpers/PendleMulticallV1.sol +7 -7
- package/contracts/offchain-helpers/PendleMulticallV2.sol +12 -13
- package/contracts/offchain-helpers/PendleOffchainStorage.sol +1 -1
- package/contracts/offchain-helpers/PendleWstETHPriceFeed.sol +2 -4
- package/contracts/offchain-helpers/SimulateHelper.sol +6 -7
- package/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol +32 -13
- package/contracts/offchain-helpers/deploy/PendleCommonSYFactory.sol +11 -7
- package/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol +35 -16
- package/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol +35 -15
- package/contracts/offchain-helpers/deploy/lib/MarketDeployLib.sol +13 -12
- package/contracts/offchain-helpers/errors/SDKErrorsDirectory.sol +4 -1
- package/contracts/offchain-helpers/router-static/PendleRouterStatic.sol +1 -1
- package/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol +9 -12
- package/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol +91 -60
- package/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol +190 -103
- package/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol +26 -26
- package/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol +3 -3
- package/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol +10 -8
- package/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol +40 -100
- package/contracts/oracles/CrossChainOracle/base/PendleCrossChainOracleBaseApp_Init.sol +6 -14
- package/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleApp.sol +47 -55
- package/contracts/oracles/CrossChainOracle/exchangeRate/PendleExchangeRateOracleV2.sol +3 -2
- package/contracts/oracles/CrossChainOracle/libraries/ExchangeRateMsgCodec.sol +12 -12
- package/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol +20 -17
- package/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol +19 -15
- package/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol +6 -7
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol +9 -13
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol +21 -20
- package/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol +7 -4
- package/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol +2 -2
- package/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol +10 -13
- package/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol +10 -13
- package/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol +5 -6
- package/contracts/oracles/StatelessWrapper/PendleSparkLinearDiscountOracleFactoryWrapper.sol +1 -1
- package/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol +3 -3
- package/contracts/router/ActionAddRemoveLiqV3.sol +150 -55
- package/contracts/router/ActionCallbackV3.sol +13 -20
- package/contracts/router/ActionMiscV3.sol +78 -54
- package/contracts/router/ActionSimple.sol +128 -76
- package/contracts/router/ActionSwapPTV3.sol +19 -7
- package/contracts/router/ActionSwapYTV3.sol +20 -8
- package/contracts/router/PendleRouterV4.sol +1 -1
- package/contracts/router/Reflector.sol +21 -15
- package/contracts/router/base/ActionBase.sol +105 -61
- package/contracts/router/base/ActionDelegateBase.sol +38 -39
- package/contracts/router/base/CallbackHelper.sol +19 -21
- package/contracts/router/math/ApproxStateLib.sol +28 -28
- package/contracts/router/math/MarketApproxEstimateLib.sol +13 -11
- package/contracts/router/math/MarketApproxLibOnchain.sol +24 -47
- package/contracts/router/math/MarketApproxLibV2.sol +44 -63
- package/contracts/router/swap-aggregator/OKXScaleHelper.sol +55 -191
- package/contracts/router/swap-aggregator/ParaswapScaleHelper.sol +48 -34
- package/contracts/router/swap-aggregator/PendleSwap.sol +28 -26
- package/deployments/1-core.json +2 -1
- package/deployments/1-offchain-helper.json +1 -2
- package/deployments/10-core.json +2 -1
- package/deployments/10-offchain-helper.json +1 -2
- package/deployments/146-core.json +2 -1
- package/deployments/146-offchain-helper.json +1 -2
- package/deployments/42161-core.json +2 -1
- package/deployments/42161-offchain-helper.json +1 -2
- package/deployments/5000-core.json +2 -1
- package/deployments/5000-offchain-helper.json +1 -2
- package/deployments/56-core.json +2 -1
- package/deployments/56-offchain-helper.json +1 -2
- package/deployments/80094-core.json +2 -1
- package/deployments/80094-offchain-helper.json +1 -2
- package/deployments/8453-core.json +2 -1
- package/deployments/8453-offchain-helper.json +1 -2
- package/deployments/9745-core.json +2 -1
- package/deployments/9745-offchain-helper.json +1 -2
- package/deployments/999-core.json +2 -1
- package/deployments/999-offchain-helper.json +1 -2
- package/package.json +4 -2
- package/typechain-types/IOKXDexRouter.ts +0 -99
- package/typechain-types/IPLimitRouter.ts +0 -69
- package/typechain-types/IPMarket.ts +0 -13
- package/typechain-types/PendleMerkleDepositor.ts +171 -0
- package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -1
- package/typechain-types/factories/ActionCallbackV3__factory.ts +1 -1
- package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionMiscV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSimple__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
- package/typechain-types/factories/ActionStorageV4__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -1
- package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
- package/typechain-types/factories/AddressProvider__factory.ts +1 -1
- package/typechain-types/factories/BalanceReader__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/BoringPYUsdChainlinkAssetOracle__factory.ts +1 -1
- package/typechain-types/factories/BoringPYUsdChainlinkSYOracle__factory.ts +1 -1
- package/typechain-types/factories/Broadcaster__factory.ts +1 -1
- package/typechain-types/factories/EmptyUUPS__factory.ts +1 -1
- package/typechain-types/factories/Errors__factory.ts +1 -1
- package/typechain-types/factories/ExchangeRateMsgCodec__factory.ts +1 -1
- package/typechain-types/factories/ExpiredLpPtRedeemer__factory.ts +1 -1
- package/typechain-types/factories/FixedPricePTAMM__factory.ts +1 -1
- package/typechain-types/factories/IOKXDexRouter__factory.ts +0 -171
- package/typechain-types/factories/IPLimitRouter__factory.ts +0 -42
- package/typechain-types/factories/IPMarket__factory.ts +0 -13
- package/typechain-types/factories/LegacyNFTHelper__factory.ts +1 -1
- package/typechain-types/factories/LimitBackendHelperV2__factory.ts +1 -1
- package/typechain-types/factories/Multicall2__factory.ts +1 -1
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/PendleBridgedPrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkOracleFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkOracleWithQuote__factory.ts +1 -1
- package/typechain-types/factories/PendleChainlinkOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleCommonPoolDeployHelperV2__factory.ts +1 -1
- package/typechain-types/factories/PendleCommonSYFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleERC20__factory.ts +1 -1
- package/typechain-types/factories/PendleExchangeRateOracleApp__factory.ts +1 -1
- package/typechain-types/factories/PendleExchangeRateOracleV2__factory.ts +1 -1
- package/typechain-types/factories/PendleExchangeRateOracle__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributorV2__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleGovernanceProxy__factory.ts +1 -1
- package/typechain-types/factories/PendleLPWrapperFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleLPWrapper__factory.ts +1 -1
- package/typechain-types/factories/PendleLimitRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketFactoryV6Upg__factory.ts +1 -1
- package/typechain-types/factories/PendleMarketV6__factory.ts +1 -1
- package/typechain-types/factories/PendleMerkleDepositor__factory.ts +164 -0
- package/typechain-types/factories/PendleMerkleDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMultiTokenMerkleDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleMulticallOwnerV1__factory.ts +1 -1
- package/typechain-types/factories/PendleMulticallV1__factory.ts +1 -1
- package/typechain-types/factories/PendleMulticallV2__factory.ts +1 -1
- package/typechain-types/factories/PendleOffchainStorage__factory.ts +1 -1
- package/typechain-types/factories/PendlePTOFTAdapterFactory__factory.ts +1 -1
- package/typechain-types/factories/PendlePYLpOracle__factory.ts +1 -1
- package/typechain-types/factories/PendlePoolDeployHelperV2__factory.ts +1 -1
- package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
- package/typechain-types/factories/PendleRouterV4__factory.ts +1 -1
- package/typechain-types/factories/PendleSparkLinearDiscountOracleFactoryWrapper__factory.ts +1 -1
- package/typechain-types/factories/PendleSparkLinearDiscountOracleFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleSwap__factory.ts +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWstETHPriceFeed__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldContractFactoryUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleYieldToken__factory.ts +1 -1
- package/typechain-types/factories/Reflector__factory.ts +1 -1
- package/typechain-types/factories/SDKErrorsDirectory__factory.ts +1 -1
- package/typechain-types/factories/SimulateHelper__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +9 -18
- package/typechain-types/index.ts +2 -4
- package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/PendleFeeSetter.sol/PendleFeeSetter.json +0 -326
- package/contracts/offchain-helpers/PendleFeeSetter.sol +0 -149
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.17;
|
|
3
3
|
|
|
4
|
-
import "../../../LiquidityMining/libraries/VeBalanceLib.sol";
|
|
5
4
|
import "../../../core/libraries/MiniHelpers.sol";
|
|
6
5
|
import "../../../interfaces/IPRouterStatic.sol";
|
|
7
6
|
import "../../../interfaces/IPVotingEscrowMainchain.sol";
|
|
7
|
+
import "../../../LiquidityMining/libraries/VeBalanceLib.sol";
|
|
8
8
|
|
|
9
9
|
contract ActionVePendleStatic is IPActionVePendleStatic {
|
|
10
10
|
using VeBalanceLib for VeBalance;
|
|
@@ -19,11 +19,11 @@ contract ActionVePendleStatic is IPActionVePendleStatic {
|
|
|
19
19
|
vePENDLE = _vePENDLE;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function increaseLockPositionStatic(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
22
|
+
function increaseLockPositionStatic(
|
|
23
|
+
address user,
|
|
24
|
+
uint128 additionalAmountToLock,
|
|
25
|
+
uint128 newExpiry
|
|
26
|
+
) external view returns (uint128 newVeBalance) {
|
|
27
27
|
if (!WeekMath.isValidWTime(newExpiry)) revert Errors.InvalidWTime(newExpiry);
|
|
28
28
|
if (MiniHelpers.isTimeInThePast(newExpiry)) revert Errors.ExpiryInThePast(newExpiry);
|
|
29
29
|
|
|
@@ -44,8 +44,10 @@ contract ActionVePendleStatic is IPActionVePendleStatic {
|
|
|
44
44
|
|
|
45
45
|
uint128 additionalDurationToLock = newExpiry - oldPosition.expiry;
|
|
46
46
|
|
|
47
|
-
LockedPosition memory newPosition =
|
|
48
|
-
|
|
47
|
+
LockedPosition memory newPosition = LockedPosition(
|
|
48
|
+
oldPosition.amount + additionalAmountToLock,
|
|
49
|
+
oldPosition.expiry + additionalDurationToLock
|
|
50
|
+
);
|
|
49
51
|
|
|
50
52
|
VeBalance memory newBalance = newPosition.convertToVeBalance();
|
|
51
53
|
return newBalance.getCurrentValue();
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
import "../../../core/Market/MarketMathCore.sol";
|
|
5
4
|
import "../../../core/libraries/math/PMath.sol";
|
|
5
|
+
import "../../../core/Market/MarketMathCore.sol";
|
|
6
6
|
import {ApproxParams} from "../../../interfaces/IPAllActionTypeV3.sol";
|
|
7
7
|
|
|
8
|
-
/// Further explanation of the eps. Take swapExactSyForPt for example. To calc the corresponding amount of Pt to swap
|
|
9
|
-
///
|
|
8
|
+
/// Further explanation of the eps. Take swapExactSyForPt for example. To calc the corresponding amount of Pt to swap out,
|
|
9
|
+
/// it's necessary to run an approximation algorithm, because by default there only exists the Pt to Sy formula
|
|
10
10
|
/// To approx, the 5 values above will have to be provided, and the approx process will run as follows:
|
|
11
11
|
/// mid = (guessMin + guessMax) / 2 // mid here is the current guess of the amount of Pt out
|
|
12
12
|
/// netSyNeed = calcSwapSyForExactPt(mid)
|
|
13
13
|
/// if (netSyNeed > exactSyIn) guessMax = mid - 1 // since the maximum Sy in can't exceed the exactSyIn
|
|
14
14
|
/// else guessMin = mid (1)
|
|
15
15
|
/// For the (1), since netSyNeed <= exactSyIn, the result might be usable. If the netSyNeed is within eps of
|
|
16
|
-
/// exactSyIn (ex eps=0.1% => we have used 99.9% the amount of Sy specified), mid will be chosen as the final guess
|
|
17
|
-
/// result
|
|
16
|
+
/// exactSyIn (ex eps=0.1% => we have used 99.9% the amount of Sy specified), mid will be chosen as the final guess result
|
|
18
17
|
|
|
19
18
|
/// for guessOffchain, this is to provide a shortcut to guessing. The offchain SDK can precalculate the exact result
|
|
20
|
-
/// before the tx is sent. When the tx reaches the contract, the guessOffchain will be checked first, and if it
|
|
21
|
-
///
|
|
22
|
-
/// used in most cases
|
|
19
|
+
/// before the tx is sent. When the tx reaches the contract, the guessOffchain will be checked first, and if it satisfies the
|
|
20
|
+
/// approximation, it will be used (and save all the guessing). It's expected that this shortcut will be used in most cases
|
|
23
21
|
/// except in cases that there is a trade in the same market right before the tx
|
|
24
22
|
|
|
25
23
|
library MarketApproxPtInLibV1 {
|
|
@@ -42,15 +40,7 @@ library MarketApproxPtInLibV1 {
|
|
|
42
40
|
uint256 minSyOut,
|
|
43
41
|
uint256 blockTime,
|
|
44
42
|
ApproxParams memory approx
|
|
45
|
-
)
|
|
46
|
-
internal
|
|
47
|
-
pure
|
|
48
|
-
returns (
|
|
49
|
-
uint256, /*netPtIn*/
|
|
50
|
-
uint256, /*netSyOut*/
|
|
51
|
-
uint256 /*netSyFee*/
|
|
52
|
-
)
|
|
53
|
-
{
|
|
43
|
+
) internal pure returns (uint256, /*netPtIn*/ uint256, /*netSyOut*/ uint256 /*netSyFee*/) {
|
|
54
44
|
MarketPreCompute memory comp = market.getMarketPreCompute(index, blockTime);
|
|
55
45
|
if (approx.guessOffchain == 0) {
|
|
56
46
|
// no limit on min
|
|
@@ -60,7 +50,7 @@ library MarketApproxPtInLibV1 {
|
|
|
60
50
|
|
|
61
51
|
for (uint256 iter = 0; iter < approx.maxIteration; ++iter) {
|
|
62
52
|
uint256 guess = nextGuess(approx, iter);
|
|
63
|
-
(uint256 netSyOut, uint256 netSyFee,) = calcSyOut(market, comp, index, guess);
|
|
53
|
+
(uint256 netSyOut, uint256 netSyFee, ) = calcSyOut(market, comp, index, guess);
|
|
64
54
|
|
|
65
55
|
if (netSyOut >= minSyOut) {
|
|
66
56
|
if (PMath.isAGreaterApproxB(netSyOut, minSyOut, approx.eps)) {
|
|
@@ -89,15 +79,7 @@ library MarketApproxPtInLibV1 {
|
|
|
89
79
|
uint256 exactSyIn,
|
|
90
80
|
uint256 blockTime,
|
|
91
81
|
ApproxParams memory approx
|
|
92
|
-
)
|
|
93
|
-
internal
|
|
94
|
-
pure
|
|
95
|
-
returns (
|
|
96
|
-
uint256, /*netYtOut*/
|
|
97
|
-
uint256, /*netSyFee*/
|
|
98
|
-
uint256 /*iter*/
|
|
99
|
-
)
|
|
100
|
-
{
|
|
82
|
+
) internal pure returns (uint256, /*netYtOut*/ uint256 /*netSyFee*/, uint256 /*iter*/) {
|
|
101
83
|
MarketPreCompute memory comp = market.getMarketPreCompute(index, blockTime);
|
|
102
84
|
if (approx.guessOffchain == 0) {
|
|
103
85
|
approx.guessMin = PMath.max(approx.guessMin, index.syToAsset(exactSyIn));
|
|
@@ -110,7 +92,7 @@ library MarketApproxPtInLibV1 {
|
|
|
110
92
|
for (uint256 iter = 0; iter < approx.maxIteration; ++iter) {
|
|
111
93
|
uint256 guess = nextGuess(approx, iter);
|
|
112
94
|
|
|
113
|
-
(uint256 netSyOut, uint256 netSyFee,) = calcSyOut(market, comp, index, guess);
|
|
95
|
+
(uint256 netSyOut, uint256 netSyFee, ) = calcSyOut(market, comp, index, guess);
|
|
114
96
|
|
|
115
97
|
uint256 netSyToTokenizePt = index.assetToSyUp(guess);
|
|
116
98
|
|
|
@@ -153,16 +135,7 @@ library MarketApproxPtInLibV1 {
|
|
|
153
135
|
uint256 _netSyHolding,
|
|
154
136
|
uint256 _blockTime,
|
|
155
137
|
ApproxParams memory approx
|
|
156
|
-
)
|
|
157
|
-
internal
|
|
158
|
-
pure
|
|
159
|
-
returns (
|
|
160
|
-
uint256, /*netPtSwap*/
|
|
161
|
-
uint256, /*netSyFromSwap*/
|
|
162
|
-
uint256, /*netSyFee*/
|
|
163
|
-
uint256 /*iter*/
|
|
164
|
-
)
|
|
165
|
-
{
|
|
138
|
+
) internal pure returns (uint256, /*netPtSwap*/ uint256, /*netSyFromSwap*/ uint256, /*netSyFee*/ uint256 /*iter*/) {
|
|
166
139
|
Args5 memory a = Args5(_market, _index, _totalPtIn, _netSyHolding, _blockTime, approx);
|
|
167
140
|
MarketPreCompute memory comp = a.market.getMarketPreCompute(a.index, a.blockTime);
|
|
168
141
|
if (approx.guessOffchain == 0) {
|
|
@@ -176,8 +149,14 @@ library MarketApproxPtInLibV1 {
|
|
|
176
149
|
for (uint256 iter = 0; iter < approx.maxIteration; ++iter) {
|
|
177
150
|
uint256 guess = nextGuess(approx, iter);
|
|
178
151
|
|
|
179
|
-
(uint256 syNumerator, uint256 ptNumerator, uint256 netSyOut, uint256 netSyFee,) =
|
|
180
|
-
|
|
152
|
+
(uint256 syNumerator, uint256 ptNumerator, uint256 netSyOut, uint256 netSyFee, ) = calcNumerators(
|
|
153
|
+
a.market,
|
|
154
|
+
a.index,
|
|
155
|
+
a.totalPtIn,
|
|
156
|
+
a.netSyHolding,
|
|
157
|
+
comp,
|
|
158
|
+
guess
|
|
159
|
+
);
|
|
181
160
|
|
|
182
161
|
if (PMath.isAApproxB(syNumerator, ptNumerator, approx.eps)) {
|
|
183
162
|
return (guess, netSyOut, netSyFee, iter);
|
|
@@ -235,15 +214,7 @@ library MarketApproxPtInLibV1 {
|
|
|
235
214
|
uint256 exactPtIn,
|
|
236
215
|
uint256 blockTime,
|
|
237
216
|
ApproxParams memory approx
|
|
238
|
-
)
|
|
239
|
-
internal
|
|
240
|
-
pure
|
|
241
|
-
returns (
|
|
242
|
-
uint256, /*netYtOut*/
|
|
243
|
-
uint256, /*totalPtToSwap*/
|
|
244
|
-
uint256 /*netSyFee*/
|
|
245
|
-
)
|
|
246
|
-
{
|
|
217
|
+
) internal pure returns (uint256, /*netYtOut*/ uint256, /*totalPtToSwap*/ uint256 /*netSyFee*/) {
|
|
247
218
|
MarketPreCompute memory comp = market.getMarketPreCompute(index, blockTime);
|
|
248
219
|
if (approx.guessOffchain == 0) {
|
|
249
220
|
approx.guessMin = PMath.max(approx.guessMin, exactPtIn);
|
|
@@ -254,7 +225,7 @@ library MarketApproxPtInLibV1 {
|
|
|
254
225
|
for (uint256 iter = 0; iter < approx.maxIteration; ++iter) {
|
|
255
226
|
uint256 guess = nextGuess(approx, iter);
|
|
256
227
|
|
|
257
|
-
(uint256 netSyOut, uint256 netSyFee,) = calcSyOut(market, comp, index, guess);
|
|
228
|
+
(uint256 netSyOut, uint256 netSyFee, ) = calcSyOut(market, comp, index, guess);
|
|
258
229
|
|
|
259
230
|
uint256 netAssetOut = index.syToAsset(netSyOut);
|
|
260
231
|
|
|
@@ -275,11 +246,12 @@ library MarketApproxPtInLibV1 {
|
|
|
275
246
|
|
|
276
247
|
////////////////////////////////////////////////////////////////////////////////
|
|
277
248
|
|
|
278
|
-
function calcSyOut(
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
249
|
+
function calcSyOut(
|
|
250
|
+
MarketState memory market,
|
|
251
|
+
MarketPreCompute memory comp,
|
|
252
|
+
PYIndex index,
|
|
253
|
+
uint256 netPtIn
|
|
254
|
+
) internal pure returns (uint256 netSyOut, uint256 netSyFee, uint256 netSyToReserve) {
|
|
283
255
|
(int256 _netSyOut, int256 _netSyFee, int256 _netSyToReserve) = market.calcTrade(comp, index, -int256(netPtIn));
|
|
284
256
|
netSyOut = uint256(_netSyOut);
|
|
285
257
|
netSyFee = uint256(_netSyFee);
|
|
@@ -351,15 +323,7 @@ library MarketApproxPtOutLibV1 {
|
|
|
351
323
|
uint256 exactSyIn,
|
|
352
324
|
uint256 blockTime,
|
|
353
325
|
ApproxParams memory approx
|
|
354
|
-
)
|
|
355
|
-
internal
|
|
356
|
-
pure
|
|
357
|
-
returns (
|
|
358
|
-
uint256, /*netPtOut*/
|
|
359
|
-
uint256, /*netSyFee*/
|
|
360
|
-
uint256 /*iter*/
|
|
361
|
-
)
|
|
362
|
-
{
|
|
326
|
+
) internal pure returns (uint256, /*netPtOut*/ uint256 /*netSyFee*/, uint256 /*iter*/) {
|
|
363
327
|
MarketPreCompute memory comp = market.getMarketPreCompute(index, blockTime);
|
|
364
328
|
if (approx.guessOffchain == 0) {
|
|
365
329
|
// no limit on min
|
|
@@ -370,7 +334,7 @@ library MarketApproxPtOutLibV1 {
|
|
|
370
334
|
for (uint256 iter = 0; iter < approx.maxIteration; ++iter) {
|
|
371
335
|
uint256 guess = nextGuess(approx, iter);
|
|
372
336
|
|
|
373
|
-
(uint256 netSyIn, uint256 netSyFee,) = calcSyIn(market, comp, index, guess);
|
|
337
|
+
(uint256 netSyIn, uint256 netSyFee, ) = calcSyIn(market, comp, index, guess);
|
|
374
338
|
|
|
375
339
|
if (netSyIn <= exactSyIn) {
|
|
376
340
|
if (PMath.isASmallerApproxB(netSyIn, exactSyIn, approx.eps)) {
|
|
@@ -399,15 +363,7 @@ library MarketApproxPtOutLibV1 {
|
|
|
399
363
|
uint256 minSyOut,
|
|
400
364
|
uint256 blockTime,
|
|
401
365
|
ApproxParams memory approx
|
|
402
|
-
)
|
|
403
|
-
internal
|
|
404
|
-
pure
|
|
405
|
-
returns (
|
|
406
|
-
uint256, /*netYtIn*/
|
|
407
|
-
uint256, /*netSyOut*/
|
|
408
|
-
uint256 /*netSyFee*/
|
|
409
|
-
)
|
|
410
|
-
{
|
|
366
|
+
) internal pure returns (uint256, /*netYtIn*/ uint256, /*netSyOut*/ uint256 /*netSyFee*/) {
|
|
411
367
|
MarketPreCompute memory comp = market.getMarketPreCompute(index, blockTime);
|
|
412
368
|
if (approx.guessOffchain == 0) {
|
|
413
369
|
// no limit on min
|
|
@@ -418,7 +374,7 @@ library MarketApproxPtOutLibV1 {
|
|
|
418
374
|
for (uint256 iter = 0; iter < approx.maxIteration; ++iter) {
|
|
419
375
|
uint256 guess = nextGuess(approx, iter);
|
|
420
376
|
|
|
421
|
-
(uint256 netSyOwed, uint256 netSyFee,) = calcSyIn(market, comp, index, guess);
|
|
377
|
+
(uint256 netSyOwed, uint256 netSyFee, ) = calcSyIn(market, comp, index, guess);
|
|
422
378
|
|
|
423
379
|
uint256 netAssetToRepay = index.syToAssetUp(netSyOwed);
|
|
424
380
|
uint256 netSyOut = index.assetToSy(guess - netAssetToRepay);
|
|
@@ -459,16 +415,7 @@ library MarketApproxPtOutLibV1 {
|
|
|
459
415
|
uint256 _netPtHolding,
|
|
460
416
|
uint256 _blockTime,
|
|
461
417
|
ApproxParams memory _approx
|
|
462
|
-
)
|
|
463
|
-
internal
|
|
464
|
-
pure
|
|
465
|
-
returns (
|
|
466
|
-
uint256, /*netPtFromSwap*/
|
|
467
|
-
uint256, /*netSySwap*/
|
|
468
|
-
uint256, /*netSyFee*/
|
|
469
|
-
uint256 /*iter*/
|
|
470
|
-
)
|
|
471
|
-
{
|
|
418
|
+
) internal pure returns (uint256, /*netPtFromSwap*/ uint256, /*netSySwap*/ uint256, /*netSyFee*/ uint256 /*iter*/) {
|
|
472
419
|
Args6 memory a = Args6(_market, _index, _totalSyIn, _netPtHolding, _blockTime, _approx);
|
|
473
420
|
|
|
474
421
|
MarketPreCompute memory comp = a.market.getMarketPreCompute(a.index, a.blockTime);
|
|
@@ -535,15 +482,7 @@ library MarketApproxPtOutLibV1 {
|
|
|
535
482
|
uint256 exactYtIn,
|
|
536
483
|
uint256 blockTime,
|
|
537
484
|
ApproxParams memory approx
|
|
538
|
-
)
|
|
539
|
-
internal
|
|
540
|
-
pure
|
|
541
|
-
returns (
|
|
542
|
-
uint256, /*netPtOut*/
|
|
543
|
-
uint256, /*totalPtSwapped*/
|
|
544
|
-
uint256 /*netSyFee*/
|
|
545
|
-
)
|
|
546
|
-
{
|
|
485
|
+
) internal pure returns (uint256, /*netPtOut*/ uint256, /*totalPtSwapped*/ uint256 /*netSyFee*/) {
|
|
547
486
|
MarketPreCompute memory comp = market.getMarketPreCompute(index, blockTime);
|
|
548
487
|
if (approx.guessOffchain == 0) {
|
|
549
488
|
approx.guessMin = PMath.max(approx.guessMin, exactYtIn);
|
|
@@ -554,7 +493,7 @@ library MarketApproxPtOutLibV1 {
|
|
|
554
493
|
for (uint256 iter = 0; iter < approx.maxIteration; ++iter) {
|
|
555
494
|
uint256 guess = nextGuess(approx, iter);
|
|
556
495
|
|
|
557
|
-
(uint256 netSyOwed, uint256 netSyFee,) = calcSyIn(market, comp, index, guess);
|
|
496
|
+
(uint256 netSyOwed, uint256 netSyFee, ) = calcSyIn(market, comp, index, guess);
|
|
558
497
|
|
|
559
498
|
uint256 netYtToPull = index.syToAssetUp(netSyOwed);
|
|
560
499
|
|
|
@@ -572,11 +511,12 @@ library MarketApproxPtOutLibV1 {
|
|
|
572
511
|
|
|
573
512
|
////////////////////////////////////////////////////////////////////////////////
|
|
574
513
|
|
|
575
|
-
function calcSyIn(
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
514
|
+
function calcSyIn(
|
|
515
|
+
MarketState memory market,
|
|
516
|
+
MarketPreCompute memory comp,
|
|
517
|
+
PYIndex index,
|
|
518
|
+
uint256 netPtOut
|
|
519
|
+
) internal pure returns (uint256 netSyIn, uint256 netSyFee, uint256 netSyToReserve) {
|
|
580
520
|
(int256 _netSyIn, int256 _netSyFee, int256 _netSyToReserve) = market.calcTrade(comp, index, int256(netPtOut));
|
|
581
521
|
|
|
582
522
|
// all safe since totalPt and totalSy is int128
|
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
+
import {OAppUpgradeable, Origin, MessagingFee, MessagingReceipt} from "@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppUpgradeable.sol";
|
|
5
|
+
import {OAppOptionsType3Upgradeable} from "@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/libs/OAppOptionsType3Upgradeable.sol";
|
|
4
6
|
import {ILayerZeroEndpointV2} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";
|
|
5
|
-
import {
|
|
6
|
-
MessagingFee,
|
|
7
|
-
MessagingReceipt,
|
|
8
|
-
OAppUpgradeable,
|
|
9
|
-
Origin
|
|
10
|
-
} from "@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/OAppUpgradeable.sol";
|
|
11
|
-
import {
|
|
12
|
-
OAppOptionsType3Upgradeable
|
|
13
|
-
} from "@layerzerolabs/oapp-evm-upgradeable/contracts/oapp/libs/OAppOptionsType3Upgradeable.sol";
|
|
14
7
|
|
|
15
8
|
abstract contract PendleCrossChainOracleBaseApp_Init is OAppUpgradeable, OAppOptionsType3Upgradeable {
|
|
16
9
|
uint32 public immutable eid;
|
|
@@ -21,11 +14,10 @@ abstract contract PendleCrossChainOracleBaseApp_Init is OAppUpgradeable, OAppOpt
|
|
|
21
14
|
eid = ILayerZeroEndpointV2(_endpoint).eid();
|
|
22
15
|
}
|
|
23
16
|
|
|
24
|
-
function __PendleCrossChainOracleBaseApp_initialize(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
17
|
+
function __PendleCrossChainOracleBaseApp_initialize(
|
|
18
|
+
address _owner,
|
|
19
|
+
address _delegate
|
|
20
|
+
) internal virtual onlyInitializing {
|
|
29
21
|
__OApp_init(_delegate);
|
|
30
22
|
_transferOwnership(_owner);
|
|
31
23
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import "../base/PendleCrossChainOracleBaseApp_Init.sol";
|
|
5
5
|
import "../../../interfaces/IPExchangeRateOracleApp.sol";
|
|
6
6
|
import {IStandardizedYield} from "../../../interfaces/IStandardizedYield.sol";
|
|
7
|
-
import "../base/PendleCrossChainOracleBaseApp_Init.sol";
|
|
8
7
|
import {ExchangeRateMsgCodec} from "../libraries/ExchangeRateMsgCodec.sol";
|
|
8
|
+
import {Errors} from "../../../core/libraries/Errors.sol";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @title PendleExchangeRateOracleApp
|
|
@@ -34,11 +34,10 @@ contract PendleExchangeRateOracleApp is PendleCrossChainOracleBaseApp_Init, IPEx
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/// @inheritdoc IPExchangeRateOracleApp
|
|
37
|
-
function quoteSendExchangeRateBatch(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
{
|
|
37
|
+
function quoteSendExchangeRateBatch(
|
|
38
|
+
SendExchangeRateParam[] calldata sendParams,
|
|
39
|
+
bool[] calldata payInLzTokens
|
|
40
|
+
) external view returns (MessagingFee[] memory fees) {
|
|
42
41
|
if (sendParams.length != payInLzTokens.length) revert Errors.ArrayLengthMismatch();
|
|
43
42
|
|
|
44
43
|
uint256 length = sendParams.length;
|
|
@@ -50,21 +49,18 @@ contract PendleExchangeRateOracleApp is PendleCrossChainOracleBaseApp_Init, IPEx
|
|
|
50
49
|
}
|
|
51
50
|
|
|
52
51
|
/// @inheritdoc IPExchangeRateOracleApp
|
|
53
|
-
function quoteSendExchangeRate(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
{
|
|
52
|
+
function quoteSendExchangeRate(
|
|
53
|
+
SendExchangeRateParam calldata sendParam,
|
|
54
|
+
bool payInLzToken
|
|
55
|
+
) external view returns (MessagingFee memory fee) {
|
|
58
56
|
return _quoteSendExchangeRate(sendParam, payInLzToken);
|
|
59
57
|
}
|
|
60
58
|
|
|
61
59
|
/// @inheritdoc IPExchangeRateOracleApp
|
|
62
|
-
function sendExchangeRateBatch(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
returns (MessagingReceipt[] memory receipts)
|
|
67
|
-
{
|
|
60
|
+
function sendExchangeRateBatch(
|
|
61
|
+
SendExchangeRateParam[] calldata sendParams,
|
|
62
|
+
MessagingFee[] calldata fees
|
|
63
|
+
) external payable onlyOwnerOrAllowedSender returns (MessagingReceipt[] memory receipts) {
|
|
68
64
|
if (sendParams.length != fees.length) revert Errors.ArrayLengthMismatch();
|
|
69
65
|
_validateNativeFees(fees);
|
|
70
66
|
|
|
@@ -77,22 +73,19 @@ contract PendleExchangeRateOracleApp is PendleCrossChainOracleBaseApp_Init, IPEx
|
|
|
77
73
|
}
|
|
78
74
|
|
|
79
75
|
/// @inheritdoc IPExchangeRateOracleApp
|
|
80
|
-
function sendExchangeRate(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
returns (MessagingReceipt memory receipt)
|
|
85
|
-
{
|
|
76
|
+
function sendExchangeRate(
|
|
77
|
+
SendExchangeRateParam calldata sendParam,
|
|
78
|
+
MessagingFee calldata fee
|
|
79
|
+
) external payable onlyOwnerOrAllowedSender returns (MessagingReceipt memory receipt) {
|
|
86
80
|
_validateNativeFee(fee);
|
|
87
81
|
return _sendExchangeRate(sendParam, fee);
|
|
88
82
|
}
|
|
89
83
|
|
|
90
84
|
/// @inheritdoc IPExchangeRateOracleApp
|
|
91
|
-
function getExchangeRate(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
{
|
|
85
|
+
function getExchangeRate(
|
|
86
|
+
uint32 _srcEid,
|
|
87
|
+
bytes32 exchangeRateSource
|
|
88
|
+
) external view returns (ExchangeRateData memory exchangeRateData) {
|
|
96
89
|
if (_srcEid == eid) {
|
|
97
90
|
uint256 exchangeRate = _getExchangeRateFromSource(exchangeRateSource.bytes32ToAddress());
|
|
98
91
|
return ExchangeRateData(exchangeRate, block.timestamp);
|
|
@@ -103,11 +96,10 @@ contract PendleExchangeRateOracleApp is PendleCrossChainOracleBaseApp_Init, IPEx
|
|
|
103
96
|
if (exchangeRateData.updatedAt == 0) revert Errors.FeedNotInitialized();
|
|
104
97
|
}
|
|
105
98
|
|
|
106
|
-
function _quoteSendExchangeRate(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
{
|
|
99
|
+
function _quoteSendExchangeRate(
|
|
100
|
+
SendExchangeRateParam calldata sendParam,
|
|
101
|
+
bool payInLzToken
|
|
102
|
+
) internal view returns (MessagingFee memory fee) {
|
|
111
103
|
_validateDstEid(sendParam.dstEid);
|
|
112
104
|
uint256 exchangeRate = _getExchangeRateFromSource(sendParam.exchangeRateSource);
|
|
113
105
|
(bytes memory message, bytes memory options) = _buildMsgAndOptions(sendParam, exchangeRate);
|
|
@@ -115,10 +107,10 @@ contract PendleExchangeRateOracleApp is PendleCrossChainOracleBaseApp_Init, IPEx
|
|
|
115
107
|
fee = _quote(sendParam.dstEid, message, options, payInLzToken);
|
|
116
108
|
}
|
|
117
109
|
|
|
118
|
-
function _sendExchangeRate(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
{
|
|
110
|
+
function _sendExchangeRate(
|
|
111
|
+
SendExchangeRateParam calldata sendParam,
|
|
112
|
+
MessagingFee calldata fee
|
|
113
|
+
) internal returns (MessagingReceipt memory receipt) {
|
|
122
114
|
_validateDstEid(sendParam.dstEid);
|
|
123
115
|
uint256 exchangeRate = _getExchangeRateFromSource(sendParam.exchangeRateSource);
|
|
124
116
|
(bytes memory message, bytes memory options) = _buildMsgAndOptions(sendParam, exchangeRate);
|
|
@@ -132,13 +124,9 @@ contract PendleExchangeRateOracleApp is PendleCrossChainOracleBaseApp_Init, IPEx
|
|
|
132
124
|
Origin calldata _origin,
|
|
133
125
|
bytes32 _guid,
|
|
134
126
|
bytes calldata _message,
|
|
135
|
-
address
|
|
136
|
-
/*_executor*/
|
|
127
|
+
address /*_executor*/,
|
|
137
128
|
bytes calldata /*_extraData*/
|
|
138
|
-
)
|
|
139
|
-
internal
|
|
140
|
-
override
|
|
141
|
-
{
|
|
129
|
+
) internal override {
|
|
142
130
|
(bytes32 exchangeRateSource, uint256 exchangeRate, uint256 updatedAt) = _message.decodeMessage();
|
|
143
131
|
|
|
144
132
|
bool rateAccepted = _updateExchangeRate(_origin.srcEid, exchangeRateSource, exchangeRate, updatedAt);
|
|
@@ -146,15 +134,17 @@ contract PendleExchangeRateOracleApp is PendleCrossChainOracleBaseApp_Init, IPEx
|
|
|
146
134
|
emit ExchangeRateReceived(_guid, _origin.srcEid, exchangeRateSource, exchangeRate, updatedAt, rateAccepted);
|
|
147
135
|
}
|
|
148
136
|
|
|
149
|
-
function _buildMsgAndOptions(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
{
|
|
137
|
+
function _buildMsgAndOptions(
|
|
138
|
+
SendExchangeRateParam calldata sendParam,
|
|
139
|
+
uint256 exchangeRate
|
|
140
|
+
) internal view returns (bytes memory message, bytes memory options) {
|
|
154
141
|
uint16 msgType;
|
|
155
142
|
|
|
156
|
-
(msgType, message) =
|
|
157
|
-
|
|
143
|
+
(msgType, message) = ExchangeRateMsgCodec.encodeExchangeRateMessage(
|
|
144
|
+
sendParam.exchangeRateSource,
|
|
145
|
+
exchangeRate,
|
|
146
|
+
block.timestamp
|
|
147
|
+
);
|
|
158
148
|
|
|
159
149
|
options = combineOptions(sendParam.dstEid, msgType, sendParam.extraOptions);
|
|
160
150
|
}
|
|
@@ -173,10 +163,12 @@ contract PendleExchangeRateOracleApp is PendleCrossChainOracleBaseApp_Init, IPEx
|
|
|
173
163
|
}
|
|
174
164
|
}
|
|
175
165
|
|
|
176
|
-
function _updateExchangeRate(
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
166
|
+
function _updateExchangeRate(
|
|
167
|
+
uint32 _srcEid,
|
|
168
|
+
bytes32 exchangeRateSource,
|
|
169
|
+
uint256 exchangeRate,
|
|
170
|
+
uint256 updatedAt
|
|
171
|
+
) internal returns (bool rateAccepted) {
|
|
180
172
|
ExchangeRateData storage currentFeedData = feedData[_srcEid][exchangeRateSource];
|
|
181
173
|
|
|
182
174
|
if (updatedAt > currentFeedData.updatedAt) {
|
|
@@ -16,8 +16,9 @@ contract PendleExchangeRateOracleV2 is IPExchangeRateOracle {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
function getExchangeRate() external view returns (uint256) {
|
|
19
|
-
IPExchangeRateOracleApp.ExchangeRateData memory exchangeRateData =
|
|
20
|
-
|
|
19
|
+
IPExchangeRateOracleApp.ExchangeRateData memory exchangeRateData = IPExchangeRateOracleApp(
|
|
20
|
+
exchangeRateOracleApp
|
|
21
|
+
).getExchangeRate(srcEid, exchangeRateSource);
|
|
21
22
|
|
|
22
23
|
return exchangeRateData.exchangeRate;
|
|
23
24
|
}
|
|
@@ -6,23 +6,23 @@ import {Errors} from "../../../core/libraries/Errors.sol";
|
|
|
6
6
|
library ExchangeRateMsgCodec {
|
|
7
7
|
uint16 public constant SEND_EXCHANGE_RATE = 1;
|
|
8
8
|
|
|
9
|
-
function encodeExchangeRateMessage(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{
|
|
9
|
+
function encodeExchangeRateMessage(
|
|
10
|
+
address exchangeRateSource,
|
|
11
|
+
uint256 exchangeRate,
|
|
12
|
+
uint256 updatedAt
|
|
13
|
+
) internal pure returns (uint16 msgType, bytes memory message) {
|
|
14
14
|
msgType = SEND_EXCHANGE_RATE;
|
|
15
15
|
message = abi.encode(msgType, exchangeRateSource, exchangeRate, updatedAt);
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
function decodeMessage(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
returns (bytes32 exchangeRateSource, uint256 exchangeRate, uint256 updatedAt)
|
|
22
|
-
{
|
|
18
|
+
function decodeMessage(
|
|
19
|
+
bytes calldata message
|
|
20
|
+
) internal pure returns (bytes32 exchangeRateSource, uint256 exchangeRate, uint256 updatedAt) {
|
|
23
21
|
uint16 msgType;
|
|
24
|
-
(msgType, exchangeRateSource, exchangeRate, updatedAt) =
|
|
25
|
-
|
|
22
|
+
(msgType, exchangeRateSource, exchangeRate, updatedAt) = abi.decode(
|
|
23
|
+
message,
|
|
24
|
+
(uint16, bytes32, uint256, uint256)
|
|
25
|
+
);
|
|
26
26
|
if (msgType != SEND_EXCHANGE_RATE) revert Errors.InvalidMsgType();
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -10,8 +10,8 @@ library PendleLpOracleLib {
|
|
|
10
10
|
using MarketMathCore for MarketState;
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
* This function returns the approximated twap rate LP/asset on market, but take into account the current rate of SY
|
|
14
|
+
This is to account for special cases where underlying asset becomes insolvent and has decreasing exchangeRate
|
|
15
15
|
* @param market market to get rate from
|
|
16
16
|
* @param duration twap duration
|
|
17
17
|
*/
|
|
@@ -26,8 +26,8 @@ library PendleLpOracleLib {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
* This function returns the approximated twap rate LP/asset on market, but take into account the current rate of SY
|
|
30
|
+
This is to account for special cases where underlying asset becomes insolvent and has decreasing exchangeRate
|
|
31
31
|
* @param market market to get rate from
|
|
32
32
|
* @param duration twap duration
|
|
33
33
|
*/
|
|
@@ -41,11 +41,11 @@ library PendleLpOracleLib {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function _getLpToAssetRateRaw(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{
|
|
44
|
+
function _getLpToAssetRateRaw(
|
|
45
|
+
IPMarket market,
|
|
46
|
+
uint32 duration,
|
|
47
|
+
uint256 pyIndex
|
|
48
|
+
) private view returns (uint256 lpToAssetRateRaw) {
|
|
49
49
|
_checkMarketReentrancy(market);
|
|
50
50
|
MarketState memory state = market.readState(address(0));
|
|
51
51
|
|
|
@@ -59,21 +59,24 @@ library PendleLpOracleLib {
|
|
|
59
59
|
(int256 rateOracle, int256 rateHypTrade) = _getPtRatesRaw(market, state, duration);
|
|
60
60
|
int256 cParam = LogExpMath.exp(comp.rateScalar.mulDown((rateOracle - comp.rateAnchor)));
|
|
61
61
|
|
|
62
|
-
int256 tradeSize =
|
|
63
|
-
|
|
62
|
+
int256 tradeSize = (cParam.mulDown(comp.totalAsset) - state.totalPt).divDown(
|
|
63
|
+
PMath.IONE + cParam.divDown(rateHypTrade)
|
|
64
|
+
);
|
|
64
65
|
|
|
65
66
|
totalHypotheticalAsset =
|
|
66
|
-
comp.totalAsset -
|
|
67
|
+
comp.totalAsset -
|
|
68
|
+
tradeSize.divDown(rateHypTrade) +
|
|
69
|
+
(state.totalPt + tradeSize).divDown(rateOracle);
|
|
67
70
|
}
|
|
68
71
|
|
|
69
72
|
lpToAssetRateRaw = totalHypotheticalAsset.divDown(state.totalLp).Uint();
|
|
70
73
|
}
|
|
71
74
|
|
|
72
|
-
function _getPtRatesRaw(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
{
|
|
75
|
+
function _getPtRatesRaw(
|
|
76
|
+
IPMarket market,
|
|
77
|
+
MarketState memory state,
|
|
78
|
+
uint32 duration
|
|
79
|
+
) private view returns (int256 rateOracle, int256 rateHypTrade) {
|
|
77
80
|
uint256 lnImpliedRate = market.getMarketLnImpliedRate(duration);
|
|
78
81
|
uint256 timeToExpiry = state.expiry - block.timestamp;
|
|
79
82
|
rateOracle = MarketMathCore._getExchangeRateFromImpliedRate(lnImpliedRate, timeToExpiry);
|