@pendle/core-v2 0.13.1-testnet → 0.14.0-testnet
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol/PendleMsgReceiveEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiverAppUpg.sol/PendleMsgReceiverAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol/PendleMsgSendEndpointUpg.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol/PendleMsgSenderAppUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/EpochResultManager.sol/EpochResultManager.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributor.sol/PendleFeeDistributor.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/FeeDistributor/PendleFeeDistributorFactory.sol/PendleFeeDistributorFactory.json +2 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.json +89 -0
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.json +91 -2
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.json +91 -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/PendleMarket.sol/PendleMarket.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarket.sol/PendleMarket.json +26 -26
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleMarketFactory.sol/PendleMarketFactory.json +2 -2
- package/build/artifacts/contracts/core/RewardManager/RewardManager.sol/RewardManager.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol/PYIndexLib.json +3 -3
- package/build/artifacts/contracts/core/StandardizedYield/SYBase.sol/SYBase.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/SCYBase.sol/SCYBase.json → StandardizedYield/SYBase.sol/SYBase.json} +11 -11
- package/build/artifacts/contracts/core/StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.json → StandardizedYield/SYBaseWithRewards.sol/SYBaseWithRewards.json} +11 -11
- package/build/artifacts/contracts/core/StandardizedYield/SYUtils.sol/SYUtils.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/SCYUtils.sol/SCYUtils.json → StandardizedYield/SYUtils.sol/SYUtils.json} +4 -4
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.json +3 -3
- package/build/artifacts/contracts/core/StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.json → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol/PendleQiTokenSY.json} +17 -17
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol/Pendle3CrvAndTokenSY.json +1028 -0
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.json → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol/PendleConvexLPSY.json} +47 -47
- package/build/artifacts/contracts/core/StandardizedYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.json +5 -5
- package/build/artifacts/contracts/core/StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.dbg.json +4 -0
- package/build/artifacts/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.json → StandardizedYield/implementations/PendleWstEthSY.sol/PendleWstEthSY.json} +13 -13
- 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 +4 -4
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.json +4 -4
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.json +24 -24
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.dbg.json +1 -1
- package/build/artifacts/contracts/core/libraries/Errors.sol/Errors.json +28 -28
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiq.sol/IPActionAddRemoveLiq.json +30 -30
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMintRedeem.sol/IPActionMintRedeem.json +34 -34
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPT.sol/IPActionSwapPT.json +20 -20
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapPTYT.sol/IPActionSwapPTYT.json +2 -2
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionSwapYT.sol/IPActionSwapYT.json +20 -20
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPAllAction.sol/IPAllAction.json +106 -106
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.json +18 -18
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketSwapCallback.sol/IPMarketSwapCallback.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingController.sol/IPVotingController.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPVotingEscrowMainchain.sol/IPVotingEscrowMainchain.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.json +3 -3
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldToken.sol/IPYieldToken.json +6 -6
- package/build/artifacts/contracts/interfaces/IStandardizedYield.sol/IStandardizedYield.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/{ISuperComposableYield.sol/ISuperComposableYield.json → IStandardizedYield.sol/IStandardizedYield.json} +5 -5
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketMathStatic.sol/MarketMathStatic.json +7 -7
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/RouterStatic.sol/RouterStatic.json +116 -116
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionAddRemoveLiq.sol/ActionAddRemoveLiq.json +35 -35
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionCallback.sol/ActionCallback.json +12 -12
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMintRedeem.sol/ActionMintRedeem.json +41 -41
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionMisc.sol/ActionMisc.json +2 -2
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPT.sol/ActionSwapPT.json +28 -28
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapPTYT.sol/ActionSwapPTYT.json +4 -4
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionSwapYT.sol/ActionSwapYT.json +22 -22
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouter.sol/PendleRouter.json +2 -2
- package/build/artifacts/contracts/router/base/ActionBaseMintRedeem.sol/ActionBaseMintRedeem.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtInLib.json +2 -2
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/MarketApproxLib.sol/MarketApproxPtOutLib.json +2 -2
- package/build/artifacts/contracts/router/kyberswap/KyberSwapHelper.sol/KyberSwapHelper.dbg.json +1 -1
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgReceiveEndpointUpg.sol +96 -27
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSendEndpointUpg.sol +40 -12
- package/contracts/LiquidityMining/CrossChainMsg/PendleMsgSenderAppUpg.sol +24 -5
- package/contracts/LiquidityMining/CrossChainMsg/libraries/ExcessivelySafeCall.sol +133 -0
- package/contracts/LiquidityMining/CrossChainMsg/libraries/LayerZeroHelper.sol +33 -0
- package/contracts/LiquidityMining/GaugeController/PendleGaugeControllerBaseUpg.sol +8 -1
- package/contracts/LiquidityMining/VotingController/PendleVotingControllerUpg.sol +3 -3
- package/contracts/LiquidityMining/VotingEscrow/VotingEscrowPendleMainchain.sol +2 -7
- package/contracts/core/Market/MarketMathCore.sol +50 -53
- package/contracts/core/Market/PendleGauge.sol +8 -8
- package/contracts/core/Market/PendleMarket.sol +49 -49
- package/contracts/core/Market/PendleMarketFactory.sol +1 -1
- package/contracts/core/RewardManager/RewardManager.sol +1 -1
- package/contracts/core/{SuperComposableYield → StandardizedYield}/PYIndex.sol +16 -16
- package/contracts/core/{SuperComposableYield/SCYBase.sol → StandardizedYield/SYBase.sol} +17 -17
- package/contracts/core/{SuperComposableYield/SCYBaseWithRewards.sol → StandardizedYield/SYBaseWithRewards.sol} +9 -9
- package/contracts/core/StandardizedYield/SYUtils.sol +26 -0
- package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/BenQi/PendleQiTokenHelper.sol +1 -1
- package/contracts/core/{SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol → StandardizedYield/implementations/BenQi/PendleQiTokenSY.sol} +10 -10
- package/contracts/core/StandardizedYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSY.sol +167 -0
- package/contracts/core/{SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol → StandardizedYield/implementations/Convex/ConvexCurveLP/PendleConvexLPSY.sol} +51 -70
- package/contracts/core/{SuperComposableYield → StandardizedYield}/implementations/Convex/Pendle3CrvHelper.sol +7 -7
- package/contracts/core/{SuperComposableYield/implementations/PendleWstEthSCY.sol → StandardizedYield/implementations/PendleWstEthSY.sol} +5 -5
- package/contracts/core/YieldContracts/InterestManagerYT.sol +7 -7
- package/contracts/core/YieldContracts/PendlePrincipalToken.sol +3 -3
- package/contracts/core/YieldContracts/PendleYieldContractFactory.sol +15 -15
- package/contracts/core/YieldContracts/PendleYieldToken.sol +71 -71
- package/contracts/core/libraries/Errors.sol +23 -21
- package/contracts/core/libraries/TokenHelper.sol +0 -33
- package/contracts/interfaces/Curve/ICrvPool.sol +2 -0
- package/contracts/interfaces/ILayerZeroEndpoint.sol +39 -0
- package/contracts/interfaces/ILayerZeroReceiver.sol +12 -0
- package/contracts/interfaces/IPActionAddRemoveLiq.sol +27 -27
- package/contracts/interfaces/IPActionMintRedeem.sol +30 -30
- package/contracts/interfaces/IPActionSwapPT.sol +16 -16
- package/contracts/interfaces/IPActionSwapPTYT.sol +2 -2
- package/contracts/interfaces/IPActionSwapYT.sol +16 -16
- package/contracts/interfaces/IPMarket.sol +14 -19
- package/contracts/interfaces/IPMarketSwapCallback.sol +1 -1
- package/contracts/interfaces/IPMsgSendEndpoint.sol +4 -2
- package/contracts/interfaces/IPPrincipalToken.sol +1 -1
- package/contracts/interfaces/IPYieldContractFactory.sol +3 -3
- package/contracts/interfaces/IPYieldToken.sol +7 -9
- package/contracts/interfaces/{ISuperComposableYield.sol → IStandardizedYield.sol} +6 -6
- package/contracts/offchain-helpers/MarketMathStatic.sol +116 -131
- package/contracts/offchain-helpers/RouterStatic.sol +80 -93
- package/contracts/router/ActionAddRemoveLiq.sol +99 -111
- package/contracts/router/ActionCallback.sol +46 -46
- package/contracts/router/ActionMintRedeem.sol +58 -58
- package/contracts/router/ActionSwapPT.sol +61 -69
- package/contracts/router/ActionSwapPTYT.sol +7 -7
- package/contracts/router/ActionSwapYT.sol +72 -79
- package/contracts/router/PendleRouter.sol +16 -16
- package/contracts/router/base/ActionBaseMintRedeem.sol +43 -43
- package/contracts/router/base/CallbackHelper.sol +20 -20
- package/contracts/router/base/MarketApproxLib.sol +166 -143
- package/contracts/router/kyberswap/KyberSwapHelper.sol +2 -2
- package/deployments/43113-core.json +16 -0
- package/{contracts/deployments → deployments}/43113-helper.json +0 -0
- package/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +8 -0
- package/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +8 -0
- package/{contracts/deployments → deployments}/43113-testenv.json +0 -0
- package/deployments/80001-core.json +15 -0
- package/{contracts/deployments → deployments}/80001-testenv.json +0 -0
- package/package.json +2 -2
- package/typechain-types/ActionAddRemoveLiq.ts +127 -129
- package/typechain-types/ActionCallback.ts +5 -5
- package/typechain-types/ActionMintRedeem.ts +139 -141
- package/typechain-types/ActionSwapPT.ts +73 -73
- package/typechain-types/ActionSwapPTYT.ts +2 -2
- package/typechain-types/ActionSwapYT.ts +73 -73
- package/typechain-types/IPActionAddRemoveLiq.ts +127 -129
- package/typechain-types/IPActionMintRedeem.ts +139 -141
- package/typechain-types/IPActionSwapPT.ts +73 -73
- package/typechain-types/IPActionSwapPTYT.ts +2 -2
- package/typechain-types/IPActionSwapYT.ts +73 -73
- package/typechain-types/IPAllAction.ts +402 -406
- package/typechain-types/IPMarket.ts +51 -54
- package/typechain-types/IPMarketSwapCallback.ts +5 -5
- package/typechain-types/IPPrincipalToken.ts +8 -8
- package/typechain-types/IPYieldContractFactory.ts +13 -13
- package/typechain-types/IPYieldToken.ts +17 -17
- package/typechain-types/IStandardizedYield.ts +895 -0
- package/typechain-types/MarketMathStatic.ts +27 -27
- package/typechain-types/Pendle3CrvAndTokenSY.ts +1243 -0
- package/typechain-types/Pendle3CrvHelper.ts +13 -13
- package/typechain-types/PendleConvexLPSY.ts +1189 -0
- package/typechain-types/PendleGaugeControllerBaseUpg.ts +125 -0
- package/typechain-types/PendleGaugeControllerMainchainUpg.ts +125 -0
- package/typechain-types/PendleGaugeControllerSidechainUpg.ts +124 -0
- package/typechain-types/PendleMarket.ts +54 -57
- package/typechain-types/PendlePrincipalToken.ts +8 -8
- package/typechain-types/PendleQiTokenSY.ts +1166 -0
- package/typechain-types/PendleWstEthSY.ts +1040 -0
- package/typechain-types/PendleYieldContractFactory.ts +8 -8
- package/typechain-types/PendleYieldToken.ts +41 -44
- package/typechain-types/RouterStatic.ts +196 -196
- package/typechain-types/SYBase.ts +1001 -0
- package/typechain-types/SYBaseWithRewards.ts +1094 -0
- package/typechain-types/factories/ActionAddRemoveLiq__factory.ts +34 -34
- package/typechain-types/factories/ActionCallback__factory.ts +11 -11
- package/typechain-types/factories/ActionMintRedeem__factory.ts +38 -38
- package/typechain-types/factories/ActionMisc__factory.ts +1 -1
- package/typechain-types/factories/ActionSwapPTYT__factory.ts +3 -3
- package/typechain-types/factories/ActionSwapPT__factory.ts +27 -27
- package/typechain-types/factories/ActionSwapYT__factory.ts +21 -21
- package/typechain-types/factories/Errors__factory.ts +27 -27
- package/typechain-types/factories/IPActionAddRemoveLiq__factory.ts +30 -30
- package/typechain-types/factories/IPActionMintRedeem__factory.ts +34 -34
- package/typechain-types/factories/IPActionSwapPTYT__factory.ts +2 -2
- package/typechain-types/factories/IPActionSwapPT__factory.ts +20 -20
- package/typechain-types/factories/IPActionSwapYT__factory.ts +20 -20
- package/typechain-types/factories/IPAllAction__factory.ts +106 -106
- package/typechain-types/factories/IPMarketSwapCallback__factory.ts +1 -1
- package/typechain-types/factories/IPMarket__factory.ts +18 -18
- package/typechain-types/factories/IPPrincipalToken__factory.ts +1 -1
- package/typechain-types/factories/IPYieldContractFactory__factory.ts +3 -3
- package/typechain-types/factories/IPYieldToken__factory.ts +6 -6
- package/typechain-types/factories/IStandardizedYield__factory.ts +658 -0
- package/typechain-types/factories/MarketMathStatic__factory.ts +6 -6
- package/typechain-types/factories/OracleLib__factory.ts +1 -1
- package/typechain-types/factories/Pendle3CrvAndTokenSY__factory.ts +1124 -0
- package/typechain-types/factories/Pendle3CrvHelper__factory.ts +3 -3
- package/typechain-types/factories/PendleConvexLPSY__factory.ts +963 -0
- package/typechain-types/factories/PendleFeeDistributorFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleFeeDistributor__factory.ts +1 -1
- package/typechain-types/factories/PendleGaugeControllerBaseUpg__factory.ts +89 -0
- package/typechain-types/factories/PendleGaugeControllerMainchainUpg__factory.ts +90 -1
- package/typechain-types/factories/PendleGaugeControllerSidechainUpg__factory.ts +90 -1
- package/typechain-types/factories/PendleMarketFactory__factory.ts +1 -1
- package/typechain-types/factories/PendleMarket__factory.ts +21 -21
- package/typechain-types/factories/PendleMsgReceiveEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleMsgSendEndpointUpg__factory.ts +1 -1
- package/typechain-types/factories/PendlePrincipalToken__factory.ts +7 -7
- package/typechain-types/factories/PendleQiTokenHelper__factory.ts +1 -1
- package/typechain-types/factories/PendleQiTokenSY__factory.ts +1095 -0
- package/typechain-types/factories/PendleRouter__factory.ts +1 -1
- package/typechain-types/factories/PendleVotingControllerUpg__factory.ts +1 -1
- package/typechain-types/factories/PendleWstEthSY__factory.ts +924 -0
- package/typechain-types/factories/PendleYieldContractFactory__factory.ts +3 -3
- package/typechain-types/factories/PendleYieldToken__factory.ts +27 -27
- package/typechain-types/factories/RouterStatic__factory.ts +57 -57
- package/typechain-types/factories/SYBaseWithRewards__factory.ts +867 -0
- package/typechain-types/factories/SYBase__factory.ts +795 -0
- package/typechain-types/factories/VotingEscrowPendleMainchain__factory.ts +1 -1
- package/typechain-types/factories/VotingEscrowPendleSidechain__factory.ts +1 -1
- package/typechain-types/hardhat.d.ts +33 -51
- package/typechain-types/index.ts +14 -18
- package/build/artifacts/contracts/core/SuperComposableYield/PYIndex.sol/PYIndexLib.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/SCYBase.sol/SCYBase.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/SCYBaseWithRewards.sol/SCYBaseWithRewards.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/SCYUtils.sol/SCYUtils.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenHelper.sol/PendleQiTokenHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/BenQi/PendleQiTokenSCY.sol/PendleQiTokenSCY.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol/Pendle3CrvAndTokenSCY.json +0 -1030
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol/PendleConvexCurveLP2PoolSCY.json +0 -1025
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLPSCY.sol/PendleConvexCurveLPSCY.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/Convex/Pendle3CrvHelper.sol/Pendle3CrvHelper.dbg.json +0 -4
- package/build/artifacts/contracts/core/SuperComposableYield/implementations/PendleWstEthSCY.sol/PendleWstEthSCY.dbg.json +0 -4
- package/build/artifacts/contracts/interfaces/ISuperComposableYield.sol/ISuperComposableYield.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.dbg.json +0 -4
- package/build/artifacts/contracts/offchain-helpers/ImplicitSwapfeeContract.sol/ImplicitSwapfeeContract.json +0 -190
- package/contracts/core/SuperComposableYield/SCYUtils.sol +0 -34
- package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/Pendle3CrvAndTokenSCY.sol +0 -135
- package/contracts/core/SuperComposableYield/implementations/Convex/ConvexCurveLP/PendleConvexCurveLP2PoolSCY.sol +0 -96
- package/contracts/deployments/43113-core.json +0 -16
- package/contracts/deployments/43113-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
- package/contracts/deployments/43113-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
- package/contracts/deployments/80001-core.json +0 -15
- package/contracts/deployments/80001-markets/benqi-market-QI-USDC-FEB-2ND.json +0 -8
- package/contracts/deployments/80001-markets/benqi-market-QI-WETH-DEC-1ST.json +0 -8
- package/contracts/interfaces/ICelerMessageBus.sol +0 -28
- package/contracts/interfaces/ICelerMessageReceiverApp.sol +0 -25
- package/contracts/offchain-helpers/ImplicitSwapfeeContract.sol +0 -26
|
@@ -28,7 +28,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
struct AssetAmount {
|
|
31
|
-
|
|
31
|
+
IStandardizedYield.AssetType assetType;
|
|
32
32
|
address assetAddress;
|
|
33
33
|
uint256 amount;
|
|
34
34
|
}
|
|
@@ -51,7 +51,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
51
51
|
address market;
|
|
52
52
|
uint256 lpBalance;
|
|
53
53
|
TokenAmount ptBalance;
|
|
54
|
-
TokenAmount
|
|
54
|
+
TokenAmount syBalance;
|
|
55
55
|
AssetAmount assetBalance;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -139,17 +139,17 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
139
139
|
external
|
|
140
140
|
returns (
|
|
141
141
|
address pt,
|
|
142
|
-
address
|
|
142
|
+
address sy,
|
|
143
143
|
MarketState memory state,
|
|
144
144
|
int256 impliedYield,
|
|
145
145
|
uint256 exchangeRate
|
|
146
146
|
)
|
|
147
147
|
{
|
|
148
148
|
IPMarket _market = IPMarket(market);
|
|
149
|
-
(
|
|
149
|
+
(IStandardizedYield SY, IPPrincipalToken PT, ) = IPMarket(market).readTokens();
|
|
150
150
|
|
|
151
151
|
pt = address(PT);
|
|
152
|
-
|
|
152
|
+
sy = address(SY);
|
|
153
153
|
state = _market.readState();
|
|
154
154
|
impliedYield = getPtImpliedYield(market);
|
|
155
155
|
exchangeRate = MarketMathStatic.getExchangeRate(market);
|
|
@@ -179,19 +179,19 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
function
|
|
182
|
+
function getUserSYInfo(address sy, address user)
|
|
183
183
|
external
|
|
184
184
|
view
|
|
185
185
|
returns (uint256 balance, TokenAmount[] memory rewards)
|
|
186
186
|
{
|
|
187
|
-
|
|
188
|
-
balance =
|
|
189
|
-
address[] memory rewardTokens =
|
|
187
|
+
IStandardizedYield SY = IStandardizedYield(sy);
|
|
188
|
+
balance = SY.balanceOf(sy);
|
|
189
|
+
address[] memory rewardTokens = SY.getRewardTokens();
|
|
190
190
|
rewards = new TokenAmount[](rewardTokens.length);
|
|
191
191
|
for (uint256 i = 0; i < rewardTokens.length; ++i) {
|
|
192
192
|
address rewardToken = rewardTokens[i];
|
|
193
193
|
rewards[i].token = rewardToken;
|
|
194
|
-
(, rewards[i].amount) = IRewardManager(
|
|
194
|
+
(, rewards[i].amount) = IRewardManager(sy).userReward(rewardToken, user);
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
|
|
@@ -204,7 +204,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
204
204
|
IPYieldToken YT = IPYieldToken(userPYInfo.yt);
|
|
205
205
|
userPYInfo.ytBalance = YT.balanceOf(user);
|
|
206
206
|
userPYInfo.ptBalance = IPPrincipalToken(userPYInfo.pt).balanceOf(user);
|
|
207
|
-
userPYInfo.unclaimedInterest.token = YT.
|
|
207
|
+
userPYInfo.unclaimedInterest.token = YT.SY();
|
|
208
208
|
(, userPYInfo.unclaimedInterest.amount) = YT.userInterest(user);
|
|
209
209
|
address[] memory rewardTokens = YT.getRewardTokens();
|
|
210
210
|
TokenAmount[] memory unclaimedRewards = new TokenAmount[](rewardTokens.length);
|
|
@@ -235,8 +235,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
235
235
|
userMarketInfo.market = market;
|
|
236
236
|
userMarketInfo.lpBalance = userLp;
|
|
237
237
|
|
|
238
|
-
(
|
|
239
|
-
(userMarketInfo.assetBalance.assetType, userMarketInfo.assetBalance.assetAddress, ) =
|
|
238
|
+
(IStandardizedYield SY, IPPrincipalToken PT, ) = _market.readTokens();
|
|
239
|
+
(userMarketInfo.assetBalance.assetType, userMarketInfo.assetBalance.assetAddress, ) = SY
|
|
240
240
|
.assetInfo();
|
|
241
241
|
|
|
242
242
|
MarketState memory state = _market.readState();
|
|
@@ -247,11 +247,11 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
247
247
|
}
|
|
248
248
|
|
|
249
249
|
uint256 userPt = (userLp * uint256(state.totalPt)) / totalLp;
|
|
250
|
-
uint256
|
|
250
|
+
uint256 userSy = (userLp * uint256(state.totalSy)) / totalLp;
|
|
251
251
|
|
|
252
252
|
userMarketInfo.ptBalance = TokenAmount(address(PT), userPt);
|
|
253
|
-
userMarketInfo.
|
|
254
|
-
userMarketInfo.assetBalance.amount = (
|
|
253
|
+
userMarketInfo.syBalance = TokenAmount(address(SY), userSy);
|
|
254
|
+
userMarketInfo.assetBalance.amount = (userSy * SY.exchangeRate()) / Math.ONE;
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
function hasPYPosition(UserPYInfo calldata userPYInfo) public pure returns (bool hasPosition) {
|
|
@@ -263,21 +263,20 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
263
263
|
|
|
264
264
|
// ============= MARKET ACTIONS =============
|
|
265
265
|
|
|
266
|
-
function
|
|
266
|
+
function addLiquidityDualSyAndPtStatic(
|
|
267
267
|
address market,
|
|
268
|
-
uint256
|
|
268
|
+
uint256 netSyDesired,
|
|
269
269
|
uint256 netPtDesired
|
|
270
270
|
)
|
|
271
271
|
external
|
|
272
272
|
view
|
|
273
273
|
returns (
|
|
274
274
|
uint256 netLpOut,
|
|
275
|
-
uint256
|
|
275
|
+
uint256 netSyUsed,
|
|
276
276
|
uint256 netPtUsed
|
|
277
277
|
)
|
|
278
278
|
{
|
|
279
|
-
return
|
|
280
|
-
MarketMathStatic.addLiquidityDualScyAndPtStatic(market, netScyDesired, netPtDesired);
|
|
279
|
+
return MarketMathStatic.addLiquidityDualSyAndPtStatic(market, netSyDesired, netPtDesired);
|
|
281
280
|
}
|
|
282
281
|
|
|
283
282
|
function addLiquidityDualTokenAndPtStatic(
|
|
@@ -308,7 +307,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
308
307
|
returns (
|
|
309
308
|
uint256 netLpOut,
|
|
310
309
|
uint256 netPtToSwap,
|
|
311
|
-
uint256
|
|
310
|
+
uint256 netSyFee,
|
|
312
311
|
uint256 priceImpact
|
|
313
312
|
)
|
|
314
313
|
{
|
|
@@ -316,21 +315,17 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
316
315
|
MarketMathStatic.addLiquiditySinglePtStatic(market, netPtIn, getDefaultApproxParams());
|
|
317
316
|
}
|
|
318
317
|
|
|
319
|
-
function
|
|
318
|
+
function addLiquiditySingleSyStatic(address market, uint256 netSyIn)
|
|
320
319
|
public
|
|
321
320
|
returns (
|
|
322
321
|
uint256 netLpOut,
|
|
323
322
|
uint256 netPtFromSwap,
|
|
324
|
-
uint256
|
|
323
|
+
uint256 netSyFee,
|
|
325
324
|
uint256 priceImpact
|
|
326
325
|
)
|
|
327
326
|
{
|
|
328
327
|
return
|
|
329
|
-
MarketMathStatic.
|
|
330
|
-
market,
|
|
331
|
-
netScyIn,
|
|
332
|
-
getDefaultApproxParams()
|
|
333
|
-
);
|
|
328
|
+
MarketMathStatic.addLiquiditySingleSyStatic(market, netSyIn, getDefaultApproxParams());
|
|
334
329
|
}
|
|
335
330
|
|
|
336
331
|
function addLiquiditySingleBaseTokenStatic(
|
|
@@ -342,7 +337,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
342
337
|
returns (
|
|
343
338
|
uint256 netLpOut,
|
|
344
339
|
uint256 netPtFromSwap,
|
|
345
|
-
uint256
|
|
340
|
+
uint256 netSyFee,
|
|
346
341
|
uint256 priceImpact
|
|
347
342
|
)
|
|
348
343
|
{
|
|
@@ -355,12 +350,12 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
355
350
|
);
|
|
356
351
|
}
|
|
357
352
|
|
|
358
|
-
function
|
|
353
|
+
function removeLiquidityDualSyAndPtStatic(address market, uint256 netLpToRemove)
|
|
359
354
|
external
|
|
360
355
|
view
|
|
361
|
-
returns (uint256
|
|
356
|
+
returns (uint256 netSyOut, uint256 netPtOut)
|
|
362
357
|
{
|
|
363
|
-
return MarketMathStatic.
|
|
358
|
+
return MarketMathStatic.removeLiquidityDualSyAndPtStatic(market, netLpToRemove);
|
|
364
359
|
}
|
|
365
360
|
|
|
366
361
|
function removeLiquidityDualTokenAndPtStatic(
|
|
@@ -377,7 +372,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
377
372
|
returns (
|
|
378
373
|
uint256 netPtOut,
|
|
379
374
|
uint256 netPtFromSwap,
|
|
380
|
-
uint256
|
|
375
|
+
uint256 netSyFee,
|
|
381
376
|
uint256 priceImpact
|
|
382
377
|
)
|
|
383
378
|
{
|
|
@@ -389,15 +384,15 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
389
384
|
);
|
|
390
385
|
}
|
|
391
386
|
|
|
392
|
-
function
|
|
387
|
+
function removeLiquiditySingleSyStatic(address market, uint256 netLpToRemove)
|
|
393
388
|
public
|
|
394
389
|
returns (
|
|
395
|
-
uint256
|
|
396
|
-
uint256
|
|
390
|
+
uint256 netSyOut,
|
|
391
|
+
uint256 netSyFee,
|
|
397
392
|
uint256 priceImpact
|
|
398
393
|
)
|
|
399
394
|
{
|
|
400
|
-
return MarketMathStatic.
|
|
395
|
+
return MarketMathStatic.removeLiquiditySingleSyStatic(market, netLpToRemove);
|
|
401
396
|
}
|
|
402
397
|
|
|
403
398
|
function removeLiquiditySingleBaseTokenStatic(
|
|
@@ -408,7 +403,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
408
403
|
external
|
|
409
404
|
returns (
|
|
410
405
|
uint256 netBaseTokenOut,
|
|
411
|
-
uint256
|
|
406
|
+
uint256 netSyFee,
|
|
412
407
|
uint256 priceImpact
|
|
413
408
|
)
|
|
414
409
|
{
|
|
@@ -420,54 +415,50 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
420
415
|
);
|
|
421
416
|
}
|
|
422
417
|
|
|
423
|
-
function
|
|
418
|
+
function swapExactPtForSyStatic(address market, uint256 exactPtIn)
|
|
424
419
|
public
|
|
425
420
|
returns (
|
|
426
|
-
uint256
|
|
427
|
-
uint256
|
|
421
|
+
uint256 netSyOut,
|
|
422
|
+
uint256 netSyFee,
|
|
428
423
|
uint256 priceImpact
|
|
429
424
|
)
|
|
430
425
|
{
|
|
431
|
-
return MarketMathStatic.
|
|
426
|
+
return MarketMathStatic.swapExactPtForSyStatic(market, exactPtIn);
|
|
432
427
|
}
|
|
433
428
|
|
|
434
|
-
function
|
|
429
|
+
function swapSyForExactPtStatic(address market, uint256 exactPtOut)
|
|
435
430
|
external
|
|
436
431
|
returns (
|
|
437
|
-
uint256
|
|
438
|
-
uint256
|
|
432
|
+
uint256 netSyIn,
|
|
433
|
+
uint256 netSyFee,
|
|
439
434
|
uint256 priceImpact
|
|
440
435
|
)
|
|
441
436
|
{
|
|
442
|
-
return MarketMathStatic.
|
|
437
|
+
return MarketMathStatic.swapSyForExactPtStatic(market, exactPtOut);
|
|
443
438
|
}
|
|
444
439
|
|
|
445
|
-
function
|
|
440
|
+
function swapExactSyForPtStatic(address market, uint256 exactSyIn)
|
|
446
441
|
public
|
|
447
442
|
returns (
|
|
448
443
|
uint256 netPtOut,
|
|
449
|
-
uint256
|
|
444
|
+
uint256 netSyFee,
|
|
450
445
|
uint256 priceImpact
|
|
451
446
|
)
|
|
452
447
|
{
|
|
453
448
|
return
|
|
454
|
-
MarketMathStatic.
|
|
449
|
+
MarketMathStatic.swapExactSyForPtStatic(market, exactSyIn, getDefaultApproxParams());
|
|
455
450
|
}
|
|
456
451
|
|
|
457
|
-
function
|
|
452
|
+
function swapPtForExactSyStatic(address market, uint256 exactSyOut)
|
|
458
453
|
public
|
|
459
454
|
returns (
|
|
460
455
|
uint256 netPtIn,
|
|
461
|
-
uint256
|
|
456
|
+
uint256 netSyFee,
|
|
462
457
|
uint256 priceImpact
|
|
463
458
|
)
|
|
464
459
|
{
|
|
465
460
|
return
|
|
466
|
-
MarketMathStatic.
|
|
467
|
-
market,
|
|
468
|
-
exactScyOut,
|
|
469
|
-
getDefaultApproxParams()
|
|
470
|
-
);
|
|
461
|
+
MarketMathStatic.swapPtForExactSyStatic(market, exactSyOut, getDefaultApproxParams());
|
|
471
462
|
}
|
|
472
463
|
|
|
473
464
|
function swapExactBaseTokenForPtStatic(
|
|
@@ -478,7 +469,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
478
469
|
external
|
|
479
470
|
returns (
|
|
480
471
|
uint256 netPtOut,
|
|
481
|
-
uint256
|
|
472
|
+
uint256 netSyFee,
|
|
482
473
|
uint256 priceImpact
|
|
483
474
|
)
|
|
484
475
|
{
|
|
@@ -499,61 +490,57 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
499
490
|
external
|
|
500
491
|
returns (
|
|
501
492
|
uint256 netBaseTokenOut,
|
|
502
|
-
uint256
|
|
493
|
+
uint256 netSyFee,
|
|
503
494
|
uint256 priceImpact
|
|
504
495
|
)
|
|
505
496
|
{
|
|
506
497
|
return MarketMathStatic.swapExactPtForBaseTokenStatic(market, exactPtIn, baseToken);
|
|
507
498
|
}
|
|
508
499
|
|
|
509
|
-
function
|
|
500
|
+
function swapSyForExactYtStatic(address market, uint256 exactYtOut)
|
|
510
501
|
external
|
|
511
502
|
returns (
|
|
512
|
-
uint256
|
|
513
|
-
uint256
|
|
503
|
+
uint256 netSyIn,
|
|
504
|
+
uint256 netSyFee,
|
|
514
505
|
uint256 priceImpact
|
|
515
506
|
)
|
|
516
507
|
{
|
|
517
|
-
return MarketMathStatic.
|
|
508
|
+
return MarketMathStatic.swapSyForExactYtStatic(market, exactYtOut);
|
|
518
509
|
}
|
|
519
510
|
|
|
520
|
-
function
|
|
511
|
+
function swapExactSyForYtStatic(address market, uint256 exactSyIn)
|
|
521
512
|
public
|
|
522
513
|
returns (
|
|
523
514
|
uint256 netYtOut,
|
|
524
|
-
uint256
|
|
515
|
+
uint256 netSyFee,
|
|
525
516
|
uint256 priceImpact
|
|
526
517
|
)
|
|
527
518
|
{
|
|
528
519
|
return
|
|
529
|
-
MarketMathStatic.
|
|
520
|
+
MarketMathStatic.swapExactSyForYtStatic(market, exactSyIn, getDefaultApproxParams());
|
|
530
521
|
}
|
|
531
522
|
|
|
532
|
-
function
|
|
523
|
+
function swapExactYtForSyStatic(address market, uint256 exactYtIn)
|
|
533
524
|
public
|
|
534
525
|
returns (
|
|
535
|
-
uint256
|
|
536
|
-
uint256
|
|
526
|
+
uint256 netSyOut,
|
|
527
|
+
uint256 netSyFee,
|
|
537
528
|
uint256 priceImpact
|
|
538
529
|
)
|
|
539
530
|
{
|
|
540
|
-
return MarketMathStatic.
|
|
531
|
+
return MarketMathStatic.swapExactYtForSyStatic(market, exactYtIn);
|
|
541
532
|
}
|
|
542
533
|
|
|
543
|
-
function
|
|
534
|
+
function swapYtForExactSyStatic(address market, uint256 exactSyOut)
|
|
544
535
|
external
|
|
545
536
|
returns (
|
|
546
537
|
uint256 netYtIn,
|
|
547
|
-
uint256
|
|
538
|
+
uint256 netSyFee,
|
|
548
539
|
uint256 priceImpact
|
|
549
540
|
)
|
|
550
541
|
{
|
|
551
542
|
return
|
|
552
|
-
MarketMathStatic.
|
|
553
|
-
market,
|
|
554
|
-
exactScyOut,
|
|
555
|
-
getDefaultApproxParams()
|
|
556
|
-
);
|
|
543
|
+
MarketMathStatic.swapYtForExactSyStatic(market, exactSyOut, getDefaultApproxParams());
|
|
557
544
|
}
|
|
558
545
|
|
|
559
546
|
function swapExactYtForBaseTokenStatic(
|
|
@@ -564,7 +551,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
564
551
|
external
|
|
565
552
|
returns (
|
|
566
553
|
uint256 netBaseTokenOut,
|
|
567
|
-
uint256
|
|
554
|
+
uint256 netSyFee,
|
|
568
555
|
uint256 priceImpact
|
|
569
556
|
)
|
|
570
557
|
{
|
|
@@ -579,7 +566,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
579
566
|
external
|
|
580
567
|
returns (
|
|
581
568
|
uint256 netYtOut,
|
|
582
|
-
uint256
|
|
569
|
+
uint256 netSyFee,
|
|
583
570
|
uint256 priceImpact
|
|
584
571
|
)
|
|
585
572
|
{
|
|
@@ -597,7 +584,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
597
584
|
returns (
|
|
598
585
|
uint256 netYtOut,
|
|
599
586
|
uint256 totalPtToSwap,
|
|
600
|
-
uint256
|
|
587
|
+
uint256 netSyFee,
|
|
601
588
|
uint256 priceImpact
|
|
602
589
|
)
|
|
603
590
|
{
|
|
@@ -609,7 +596,7 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
609
596
|
returns (
|
|
610
597
|
uint256 netPtOut,
|
|
611
598
|
uint256 totalPtSwapped,
|
|
612
|
-
uint256
|
|
599
|
+
uint256 netSyFee,
|
|
613
600
|
uint256 priceImpact
|
|
614
601
|
)
|
|
615
602
|
{
|
|
@@ -654,16 +641,16 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
654
641
|
|
|
655
642
|
// ============= OTHER HELPERS =============
|
|
656
643
|
|
|
657
|
-
function
|
|
644
|
+
function mintPYFromSyStatic(address YT, uint256 amountSyToMint)
|
|
658
645
|
public
|
|
659
646
|
returns (uint256 amountPY)
|
|
660
647
|
{
|
|
661
648
|
IPYieldToken _YT = IPYieldToken(YT);
|
|
662
649
|
if (_YT.isExpired()) revert Errors.YCExpired();
|
|
663
|
-
return
|
|
650
|
+
return amountSyToMint.mulDown(_YT.pyIndexCurrent());
|
|
664
651
|
}
|
|
665
652
|
|
|
666
|
-
function
|
|
653
|
+
function redeemPYToSyStatic(address YT, uint256 amountPYToRedeem)
|
|
667
654
|
public
|
|
668
655
|
returns (uint256 amountPY)
|
|
669
656
|
{
|
|
@@ -676,8 +663,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
676
663
|
address baseToken,
|
|
677
664
|
uint256 amountBaseToken
|
|
678
665
|
) external returns (uint256 amountPY) {
|
|
679
|
-
|
|
680
|
-
return
|
|
666
|
+
IStandardizedYield SY = IStandardizedYield(IPYieldToken(YT).SY());
|
|
667
|
+
return mintPYFromSyStatic(YT, SY.previewDeposit(baseToken, amountBaseToken));
|
|
681
668
|
}
|
|
682
669
|
|
|
683
670
|
function redeemPYToBaseStatic(
|
|
@@ -685,8 +672,8 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
685
672
|
uint256 amountPYToRedeem,
|
|
686
673
|
address baseToken
|
|
687
674
|
) external returns (uint256 amountBaseToken) {
|
|
688
|
-
|
|
689
|
-
return
|
|
675
|
+
IStandardizedYield SY = IStandardizedYield(IPYieldToken(YT).SY());
|
|
676
|
+
return SY.previewRedeem(baseToken, redeemPYToSyStatic(YT, amountPYToRedeem));
|
|
690
677
|
}
|
|
691
678
|
|
|
692
679
|
function getPtImpliedYield(address market) public view returns (int256) {
|
|
@@ -722,12 +709,12 @@ contract RouterStatic is Initializable, BoringOwnableUpgradeable, UUPSUpgradeabl
|
|
|
722
709
|
returns (address[] memory tokensIn, address[] memory tokensOut)
|
|
723
710
|
{
|
|
724
711
|
if (pyToken != address(0)) {
|
|
725
|
-
//
|
|
726
|
-
|
|
727
|
-
return (
|
|
712
|
+
// SY interface is shared between pt & yt
|
|
713
|
+
IStandardizedYield SY = IStandardizedYield(IPPrincipalToken(pyToken).SY());
|
|
714
|
+
return (SY.getTokensIn(), SY.getTokensOut());
|
|
728
715
|
} else {
|
|
729
|
-
(
|
|
730
|
-
return (
|
|
716
|
+
(IStandardizedYield SY, , ) = IPMarket(market).readTokens();
|
|
717
|
+
return (SY.getTokensIn(), SY.getTokensOut());
|
|
731
718
|
}
|
|
732
719
|
}
|
|
733
720
|
}
|