@pendle/core-v2 6.1.2 → 6.1.3-sweed
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/GaugeController/PendleGaugeControllerBaseUpg.sol/PendleGaugeControllerBaseUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerMainchainUpg.sol/PendleGaugeControllerMainchainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/LiquidityMining/GaugeController/PendleGaugeControllerSidechainUpg.sol/PendleGaugeControllerSidechainUpg.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/MarketMathCore.sol/MarketMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/PendleGauge.sol/PendleGauge.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/v3/PendleMarketFactoryV3.sol/PendleMarketFactoryV3.dbg.json +1 -1
- package/build/artifacts/contracts/core/Market/v3/PendleMarketV3.sol/PendleMarketV3.dbg.json +1 -1
- package/build/artifacts/contracts/core/StandardizedYield/PYIndex.sol/PYIndexLib.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/InterestManagerYT.sol/InterestManagerYT.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendlePrincipalToken.sol/PendlePrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldContractFactory.sol/PendleYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/core/YieldContracts/PendleYieldToken.sol/PendleYieldToken.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20.sol/PendleERC20.dbg.json +1 -1
- package/build/artifacts/contracts/core/erc20/PendleERC20Permit.sol/PendleERC20Permit.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.dbg.json +4 -0
- package/build/artifacts/contracts/interfaces/IMarketSweed.sol/IMarketSweed.json +141 -0
- 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/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPActionMarketCoreStatic.sol/IPActionMarketCoreStatic.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/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/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPCommonPoolDeployHelperV2.sol/IPCommonPoolDeployHelperV2.json +93 -0
- package/build/artifacts/contracts/interfaces/IPGauge.sol/IPGauge.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarket.sol/IPMarket.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactory.sol/IPMarketFactory.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketFactoryV3.sol/IPMarketFactoryV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPMarketV3.sol/IPMarketV3.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPYLpOracle.sol/IPPYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPPrincipalToken.sol/IPPrincipalToken.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/interfaces/IPYieldContractFactory.sol/IPYieldContractFactory.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
- package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/BalanceReader.sol/BalanceReader.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/ExpiredLpPtRedeemer.sol/ExpiredLpPtRedeemer.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/LimitBackendHelperV2.sol/LimitBackendHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.dbg.json +4 -0
- package/build/artifacts/contracts/offchain-helpers/MarketSweed.sol/MarketSweed.json +338 -0
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapper.sol/PendleLPWrapper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/PendleLPWrapperFactory.sol/PendleLPWrapperFactory.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol/PendleCommonPoolDeployHelperV2.json +108 -2
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/deploy/PendlePoolDeployHelperV2.sol/PendlePoolDeployHelperV2.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
- package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendleLpOracleLib.sol/PendleLpOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYLpOracle.sol/PendlePYLpOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/PendlePYOracleLib.sol/PendlePYOracleLib.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracle.sol/PendleChainlinkOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleFactory.sol/PendleChainlinkOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/chainlink/PendleChainlinkOracleWithQuote.sol/PendleChainlinkOracleWithQuote.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringLpSeller.sol/BoringLpSeller.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkAssetOracle.sol/BoringPYUsdChainlinkAssetOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPYUsdChainlinkSYOracle.sol/BoringPYUsdChainlinkSYOracle.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/PtYtLpOracle/samples/BoringPtSeller.sol/BoringPtSeller.dbg.json +1 -1
- package/build/artifacts/contracts/oracles/internal/PendleSparkLinearDiscountOracleFactory.sol/PendleSparkLinearDiscountOracleFactory.dbg.json +1 -1
- package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
- package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
- package/build/artifacts/contracts/router/base/CallbackHelper.sol/CallbackHelper.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxEstimateLib.sol/MarketApproxEstimateLib.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
- package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
- package/contracts/interfaces/IMarketSweed.sol +23 -0
- package/contracts/interfaces/IPCommonPoolDeployHelperV2.sol +9 -0
- package/contracts/offchain-helpers/MarketSweed.sol +239 -0
- package/contracts/offchain-helpers/deploy/PendleCommonPoolDeployHelperV2.sol +21 -7
- package/package.json +1 -1
- package/typechain-types/IPCommonPoolDeployHelperV2.ts +66 -0
- package/typechain-types/IPReentrancyGuardUpg.ts +89 -0
- package/typechain-types/MarketSweed.ts +39 -0
- package/typechain-types/PendleCommonPoolDeployHelperV2.ts +87 -0
- package/typechain-types/PendleERC20Upg.ts +21 -0
- package/typechain-types/PendleMarket.ts +82 -32
- package/typechain-types/PendleMarketFactoryUpg.ts +773 -0
- package/typechain-types/PendleMarketFactoryV3Upg.ts +760 -0
- package/typechain-types/PendleReentrancyGuardUpg.ts +100 -0
- package/typechain-types/PendleYieldContractFactoryUpg.ts +820 -0
- package/typechain-types/factories/IPCommonPoolDeployHelperV2__factory.ts +93 -0
- package/typechain-types/factories/IPReentrancyGuardUpg__factory.ts +43 -0
- package/typechain-types/factories/MarketSweed__factory.ts +74 -1
- package/typechain-types/factories/PendleCommonPoolDeployHelperV2__factory.ts +107 -1
- package/typechain-types/factories/PendleERC20Upg__factory.ts +13 -0
- package/typechain-types/factories/PendleMarketFactoryUpg__factory.ts +732 -0
- package/typechain-types/factories/PendleMarketFactoryV3Upg__factory.ts +719 -0
- package/typechain-types/factories/PendleMarket__factory.ts +81 -27
- package/typechain-types/factories/PendleReentrancyGuardUpg__factory.ts +56 -0
- package/typechain-types/factories/PendleYieldContractFactoryUpg__factory.ts +692 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import "./IPAllActionV3.sol";
|
|
5
|
+
|
|
6
|
+
interface IMarketSweed {
|
|
7
|
+
struct ApproxSweedParams {
|
|
8
|
+
uint256 targetLnImpliedRate;
|
|
9
|
+
uint256 eps;
|
|
10
|
+
uint256 maxPtToSwap;
|
|
11
|
+
int256 guessOffchain;
|
|
12
|
+
uint256 maxIteration;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function seedAtImpliedRate(
|
|
16
|
+
address receiver,
|
|
17
|
+
address market,
|
|
18
|
+
uint256 minLpOut,
|
|
19
|
+
uint256 minYtOut,
|
|
20
|
+
TokenInput calldata input,
|
|
21
|
+
ApproxSweedParams calldata sweedParams
|
|
22
|
+
) external payable returns (uint256 netLpOut, uint256 netYtOut, int256 guessedAmountPtToSwap);
|
|
23
|
+
}
|
|
@@ -27,4 +27,13 @@ interface IPCommonPoolDeployHelperV2 is IPPoolDeployHelperV2 {
|
|
|
27
27
|
uint256 amountToSeed,
|
|
28
28
|
address syOwner
|
|
29
29
|
) external returns (PoolDeploymentAddrs memory);
|
|
30
|
+
|
|
31
|
+
function deployCommonMarketById(
|
|
32
|
+
bytes32 id,
|
|
33
|
+
bytes memory constructorParams,
|
|
34
|
+
PoolConfig memory config,
|
|
35
|
+
address tokenToSeedLiqudity,
|
|
36
|
+
uint256 amountToSeed,
|
|
37
|
+
address syOwner
|
|
38
|
+
) external returns (PoolDeploymentAddrs memory);
|
|
30
39
|
}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
|
|
3
|
+
pragma solidity ^0.8.17;
|
|
4
|
+
|
|
5
|
+
import "../interfaces/IPMarket.sol";
|
|
6
|
+
import "../router/math/MarketApproxLibOnchain.sol";
|
|
7
|
+
import "../router/base/ActionBase.sol";
|
|
8
|
+
import "../interfaces/IMarketSweed.sol";
|
|
9
|
+
|
|
10
|
+
contract MarketSweed is ActionBase, IMarketSweed {
|
|
11
|
+
using PMath for uint256;
|
|
12
|
+
using PMath for int256;
|
|
13
|
+
using PYIndexLib for PYIndex;
|
|
14
|
+
using MarketMathCore for MarketState;
|
|
15
|
+
using PYIndexLib for IPYieldToken;
|
|
16
|
+
|
|
17
|
+
address public immutable router;
|
|
18
|
+
|
|
19
|
+
struct MarketTokens {
|
|
20
|
+
IStandardizedYield SY;
|
|
21
|
+
IPPrincipalToken PT;
|
|
22
|
+
IPYieldToken YT;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
constructor(address _router, address _dustReceiver) ActionBase(_dustReceiver) {
|
|
26
|
+
router = _router;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function seedAtImpliedRate(
|
|
30
|
+
address receiver,
|
|
31
|
+
address market,
|
|
32
|
+
uint256 minLpOut,
|
|
33
|
+
uint256 minYtOut,
|
|
34
|
+
TokenInput calldata input,
|
|
35
|
+
ApproxSweedParams calldata sweedParams
|
|
36
|
+
) external payable returns (uint256 netLpOut, uint256 netYtOut, int256 guessedAmountPtToSwap) {
|
|
37
|
+
MarketTokens memory tokens;
|
|
38
|
+
(tokens.SY, tokens.PT, tokens.YT) = IPMarket(market).readTokens();
|
|
39
|
+
|
|
40
|
+
_mintSyFromToken(address(this), address(tokens.SY), 1, input);
|
|
41
|
+
|
|
42
|
+
uint256 netPtOut;
|
|
43
|
+
(netPtOut, netYtOut, guessedAmountPtToSwap) = _swap(receiver, market, tokens, sweedParams);
|
|
44
|
+
|
|
45
|
+
uint256 netYtFromSeed;
|
|
46
|
+
(netLpOut, netYtFromSeed, ) = _seed(receiver, market, tokens.SY, tokens.YT, _selfBalance(tokens.SY), netPtOut);
|
|
47
|
+
netYtOut += netYtFromSeed;
|
|
48
|
+
|
|
49
|
+
if (netLpOut < minLpOut) revert("Slippage: INSUFFICIENT_LP_OUT");
|
|
50
|
+
if (netYtOut < minYtOut) revert("Slippage: INSUFFICIENT_YT_OUT");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function mintPYFromToken__noCall(
|
|
54
|
+
address YT,
|
|
55
|
+
TokenInput calldata input
|
|
56
|
+
) external payable returns (uint256 netPYOut) {
|
|
57
|
+
address SY = IPYieldToken(YT).SY();
|
|
58
|
+
_mintSyFromToken(YT, SY, 1, input);
|
|
59
|
+
netPYOut = IPYieldToken(YT).mintPY(msg.sender, msg.sender);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function _seed(
|
|
63
|
+
address receiver,
|
|
64
|
+
address market,
|
|
65
|
+
IStandardizedYield SY,
|
|
66
|
+
IPYieldToken YT,
|
|
67
|
+
uint256 netSyIn,
|
|
68
|
+
uint256 netPtIn
|
|
69
|
+
) internal returns (uint256 netLpOut, uint256 netYtOut, uint256 netSyMintPy) {
|
|
70
|
+
MarketState memory state = _readMarket(market);
|
|
71
|
+
|
|
72
|
+
uint256 netSyDual = 0;
|
|
73
|
+
if (netPtIn > 0) {
|
|
74
|
+
/** Add dual SY + PT */
|
|
75
|
+
uint256 netPtDual;
|
|
76
|
+
(, , netSyDual, netPtDual) = _readMarket(market).addLiquidity(netSyIn, netPtIn, block.timestamp);
|
|
77
|
+
if (netPtIn > netPtDual || netSyDual == netSyIn) {
|
|
78
|
+
revert("MS: Bought too much PT");
|
|
79
|
+
}
|
|
80
|
+
netSyIn -= netSyDual;
|
|
81
|
+
_transferOut(YT.PT(), market, netPtDual);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
PYIndex pyIndex = YT.newIndex();
|
|
85
|
+
netSyMintPy =
|
|
86
|
+
(netSyIn * state.totalPt.Uint()) /
|
|
87
|
+
(state.totalPt.Uint() + pyIndex.syToAsset(state.totalSy.Uint()));
|
|
88
|
+
|
|
89
|
+
uint256 netSyAddLiquidity = netSyIn - netSyMintPy;
|
|
90
|
+
|
|
91
|
+
// transfer SY to mint PY
|
|
92
|
+
_transferOut(address(SY), address(YT), netSyMintPy);
|
|
93
|
+
|
|
94
|
+
// PT goes to market, YT goes to receiver
|
|
95
|
+
netYtOut = YT.mintPY(market, receiver);
|
|
96
|
+
|
|
97
|
+
// the rest of SY goes to market
|
|
98
|
+
_transferOut(address(SY), market, netSyAddLiquidity + netSyDual);
|
|
99
|
+
|
|
100
|
+
(netLpOut, , ) = IPMarket(market).mint(receiver, netSyAddLiquidity, netYtOut);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function _swap(
|
|
104
|
+
address receiver,
|
|
105
|
+
address market,
|
|
106
|
+
MarketTokens memory tokens,
|
|
107
|
+
ApproxSweedParams memory sweedParams
|
|
108
|
+
) internal returns (uint256 amountPtToAccount, uint256 amountYTToAccount, int256 guessedSwap) {
|
|
109
|
+
PYIndex index = _getPYIndex(market);
|
|
110
|
+
MarketState memory state = _readMarket(market);
|
|
111
|
+
MarketPreCompute memory comp = state.getMarketPreCompute(index, block.timestamp);
|
|
112
|
+
|
|
113
|
+
if (state.lastLnImpliedRate > sweedParams.targetLnImpliedRate) {
|
|
114
|
+
// Normalize maxPtToSwap
|
|
115
|
+
sweedParams.maxPtToSwap = PMath.min(
|
|
116
|
+
sweedParams.maxPtToSwap,
|
|
117
|
+
MarketApproxPtOutLibOnchain.calcMaxPtOut(comp, state.totalPt)
|
|
118
|
+
);
|
|
119
|
+
|
|
120
|
+
int256 amountSyToAccount;
|
|
121
|
+
|
|
122
|
+
(guessedSwap, amountSyToAccount) = _calcAmountPtToBuy(state, index, sweedParams);
|
|
123
|
+
amountPtToAccount = guessedSwap.Uint();
|
|
124
|
+
|
|
125
|
+
_transferOut(address(tokens.SY), market, amountSyToAccount.abs());
|
|
126
|
+
IPMarket(market).swapSyForExactPt(address(this), guessedSwap.abs(), EMPTY_BYTES);
|
|
127
|
+
} else {
|
|
128
|
+
// Normalize maxPtToSwap
|
|
129
|
+
sweedParams.maxPtToSwap = PMath.min(
|
|
130
|
+
sweedParams.maxPtToSwap,
|
|
131
|
+
MarketApproxPtInLibOnchain.calcSoftMaxPtIn(state, comp)
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
guessedSwap = _calcAmountPtToSell(state, index, sweedParams);
|
|
135
|
+
|
|
136
|
+
uint256 amountPtToSell = guessedSwap.abs();
|
|
137
|
+
amountYTToAccount = amountPtToSell;
|
|
138
|
+
|
|
139
|
+
_transferOut(address(tokens.SY), address(tokens.YT), index.assetToSyUp(amountPtToSell));
|
|
140
|
+
uint256 amountPYOut = tokens.YT.mintPY(market, receiver);
|
|
141
|
+
|
|
142
|
+
assert(amountPYOut >= amountPtToSell);
|
|
143
|
+
|
|
144
|
+
// this amount of SY will be used to add liquidity in later step
|
|
145
|
+
IPMarket(market).swapExactPtForSy(address(this), amountPtToSell, EMPTY_BYTES);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function _calcAmountPtToBuy(
|
|
150
|
+
MarketState memory state,
|
|
151
|
+
PYIndex index,
|
|
152
|
+
ApproxSweedParams memory sweedParams
|
|
153
|
+
) internal view returns (int256 amountPtToSwapToAccount, int256 amountSyToAccount) {
|
|
154
|
+
int256 refAmt = sweedParams.maxPtToSwap.Int();
|
|
155
|
+
int256 accPtToAccount = 0;
|
|
156
|
+
|
|
157
|
+
for (uint256 iter = 0; iter < sweedParams.maxIteration; ++iter) {
|
|
158
|
+
int256 guess;
|
|
159
|
+
if (iter == 0 && _isValidGuessOffchain(sweedParams, true)) {
|
|
160
|
+
guess = sweedParams.guessOffchain;
|
|
161
|
+
} else {
|
|
162
|
+
refAmt /= 2;
|
|
163
|
+
guess = accPtToAccount + refAmt;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
MarketState memory localState = _deepCopy(state);
|
|
167
|
+
|
|
168
|
+
// // Will not revert. maxPtToBuy should already be normalized
|
|
169
|
+
(int256 localAmountSyToAccount, , ) = localState.executeTradeCore(index, guess, block.timestamp);
|
|
170
|
+
|
|
171
|
+
if (PMath.isAApproxB(localState.lastLnImpliedRate, sweedParams.targetLnImpliedRate, sweedParams.eps)) {
|
|
172
|
+
return (guess, localAmountSyToAccount);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
if (localState.lastLnImpliedRate > sweedParams.targetLnImpliedRate) {
|
|
176
|
+
accPtToAccount += refAmt;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
revert("_calcAmountPtToBuy: failed");
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function _calcAmountPtToSell(
|
|
183
|
+
MarketState memory state,
|
|
184
|
+
PYIndex index,
|
|
185
|
+
ApproxSweedParams memory sweedParams
|
|
186
|
+
) internal view returns (int256 amountPtToSwapToAccount) {
|
|
187
|
+
int256 refAmt = sweedParams.maxPtToSwap.Int();
|
|
188
|
+
int256 accPtToAccount = 0;
|
|
189
|
+
|
|
190
|
+
for (uint256 iter = 0; iter < sweedParams.maxIteration; ++iter) {
|
|
191
|
+
int256 guess;
|
|
192
|
+
if (iter == 0 && _isValidGuessOffchain(sweedParams, false)) {
|
|
193
|
+
guess = sweedParams.guessOffchain;
|
|
194
|
+
} else {
|
|
195
|
+
refAmt /= 2;
|
|
196
|
+
guess = accPtToAccount - refAmt;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
MarketState memory localState = _deepCopy(state);
|
|
200
|
+
|
|
201
|
+
// Will not revert. maxPtToSell should already be normalized
|
|
202
|
+
localState.executeTradeCore(index, guess, block.timestamp);
|
|
203
|
+
|
|
204
|
+
if (PMath.isAApproxB(localState.lastLnImpliedRate, sweedParams.targetLnImpliedRate, sweedParams.eps)) {
|
|
205
|
+
return guess;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if (localState.lastLnImpliedRate < sweedParams.targetLnImpliedRate) {
|
|
209
|
+
accPtToAccount -= refAmt;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
revert("_calcAmountPtToSell: failed");
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function _getPYIndex(address market) internal returns (PYIndex) {
|
|
216
|
+
(, , IPYieldToken YT) = IPMarket(market).readTokens();
|
|
217
|
+
return PYIndex.wrap(YT.pyIndexCurrent());
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function _deepCopy(MarketState memory state) internal pure returns (MarketState memory copiedState) {
|
|
221
|
+
copiedState.totalPt = state.totalPt;
|
|
222
|
+
copiedState.totalSy = state.totalSy;
|
|
223
|
+
copiedState.totalLp = state.totalLp;
|
|
224
|
+
copiedState.treasury = state.treasury;
|
|
225
|
+
|
|
226
|
+
copiedState.scalarRoot = state.scalarRoot;
|
|
227
|
+
copiedState.expiry = state.expiry;
|
|
228
|
+
|
|
229
|
+
copiedState.lnFeeRateRoot = state.lnFeeRateRoot;
|
|
230
|
+
copiedState.reserveFeePercent = state.reserveFeePercent;
|
|
231
|
+
copiedState.lastLnImpliedRate = state.lastLnImpliedRate;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function _isValidGuessOffchain(ApproxSweedParams memory sweedParams, bool isBuyingPt) internal pure returns (bool) {
|
|
235
|
+
if (sweedParams.guessOffchain == 0) return false;
|
|
236
|
+
if (isBuyingPt != (sweedParams.guessOffchain > 0)) return false;
|
|
237
|
+
return sweedParams.guessOffchain.abs() <= sweedParams.maxPtToSwap;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -7,13 +7,15 @@ import "../../interfaces/IOwnable.sol";
|
|
|
7
7
|
import "../../core/libraries/BoringOwnableUpgradeableV2.sol";
|
|
8
8
|
|
|
9
9
|
contract PendleCommonPoolDeployHelperV2 is PendlePoolDeployHelperV2, BoringOwnableUpgradeableV2 {
|
|
10
|
-
|
|
11
|
-
bytes32 public constant
|
|
12
|
-
bytes32 public constant
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
bytes32 public constant
|
|
16
|
-
bytes32 public constant
|
|
10
|
+
|
|
11
|
+
bytes32 public constant ERC4626_DEPLOY_ID = keccak256("PendleERC4626SYV2"); // 0x1278efc0e6754cd30fef2df25ff5ced072ebb194d348b0b1b9548166d24352ef
|
|
12
|
+
bytes32 public constant ERC4626_NOT_REDEEMABLE_DEPLOY_ID = keccak256("PendleERC4626NotRedeemableToAssetSYV2"); // 0x6f089cd4afdd945c5c26b3f4542d0c294d19ec0e339c6ce4f8eafa94d700d05d
|
|
13
|
+
bytes32 public constant ERC20_DEPLOY_ID = keccak256("PendleERC20SY"); // 0xfcf22a9a515753d83e4f2a81cf368c7226408c64f52411ae95241ebf5ed53304
|
|
14
|
+
|
|
15
|
+
bytes32 public constant ERC4626_WITH_ADAPTER_ID = keccak256("PendleERC4626WithAdapterSY"); // 0x73f41560741d6765943d3c955034291fe23d9141e3a4719bc97422d5bf019adc
|
|
16
|
+
bytes32 public constant ERC4626_NO_REDEEM_WITH_ADAPTER_ID = keccak256("PendleERC4626NoRedeemWithAdapterSY"); // 0x3b8dd2b992f773444e5422ba1db289c4657c57110d740dca7975dc095632ef23
|
|
17
|
+
bytes32 public constant ERC20_WITH_ADAPTER_ID = keccak256("PendleERC20WithAdapterSY"); // 0xe5cce2b1999bf8c2cc4cf6d96d0569a24d8b782ba1647c09a8e1aa8bbfb98996
|
|
18
|
+
bytes32 public constant ERC4626_NO_DEPOSIT_NO_REDEEM = keccak256("PendleERC4626NoRedeemNoDepositUpgSY"); // 0x5c1cddc0128e0b02bb711f84a022bf1c13177d4ab028830b702f3a77280025ea
|
|
17
19
|
|
|
18
20
|
address public immutable syFactory;
|
|
19
21
|
|
|
@@ -31,6 +33,18 @@ contract PendleCommonPoolDeployHelperV2 is PendlePoolDeployHelperV2, BoringOwnab
|
|
|
31
33
|
__BoringOwnableV2_init(_owner);
|
|
32
34
|
}
|
|
33
35
|
|
|
36
|
+
function deployCommonMarketById(
|
|
37
|
+
bytes32 id,
|
|
38
|
+
bytes memory constructorParams,
|
|
39
|
+
PoolConfig memory config,
|
|
40
|
+
address tokenToSeedLiqudity,
|
|
41
|
+
uint256 amountToSeed,
|
|
42
|
+
address syOwner
|
|
43
|
+
) external returns (PoolDeploymentAddrs memory) {
|
|
44
|
+
address SY = IPCommonSYFactory(syFactory).deploySY(id, constructorParams, syOwner);
|
|
45
|
+
return deploy5115MarketAndSeedLiquidity(SY, config, tokenToSeedLiqudity, amountToSeed);
|
|
46
|
+
}
|
|
47
|
+
|
|
34
48
|
// Those 3 are all not payable as they should not accept tokenIn as native
|
|
35
49
|
|
|
36
50
|
function deployERC4626Market(
|
package/package.json
CHANGED
|
@@ -87,6 +87,7 @@ export interface IPCommonPoolDeployHelperV2Interface extends utils.Interface {
|
|
|
87
87
|
contractName: "IPCommonPoolDeployHelperV2";
|
|
88
88
|
functions: {
|
|
89
89
|
"deploy5115MarketAndSeedLiquidity(address,(uint32,uint256,uint256,uint256,uint256),address,uint256)": FunctionFragment;
|
|
90
|
+
"deployCommonMarketById(bytes32,bytes,(uint32,uint256,uint256,uint256,uint256),address,uint256,address)": FunctionFragment;
|
|
90
91
|
"deployERC20Market(bytes,(uint32,uint256,uint256,uint256,uint256),address,uint256,address)": FunctionFragment;
|
|
91
92
|
"deployERC4626Market(bytes,(uint32,uint256,uint256,uint256,uint256),address,uint256,address)": FunctionFragment;
|
|
92
93
|
"deployERC4626NotRedeemableMarket(bytes,(uint32,uint256,uint256,uint256,uint256),address,uint256,address)": FunctionFragment;
|
|
@@ -101,6 +102,17 @@ export interface IPCommonPoolDeployHelperV2Interface extends utils.Interface {
|
|
|
101
102
|
BigNumberish
|
|
102
103
|
]
|
|
103
104
|
): string;
|
|
105
|
+
encodeFunctionData(
|
|
106
|
+
functionFragment: "deployCommonMarketById",
|
|
107
|
+
values: [
|
|
108
|
+
BytesLike,
|
|
109
|
+
BytesLike,
|
|
110
|
+
IPPoolDeployHelperV2.PoolConfigStruct,
|
|
111
|
+
string,
|
|
112
|
+
BigNumberish,
|
|
113
|
+
string
|
|
114
|
+
]
|
|
115
|
+
): string;
|
|
104
116
|
encodeFunctionData(
|
|
105
117
|
functionFragment: "deployERC20Market",
|
|
106
118
|
values: [
|
|
@@ -136,6 +148,10 @@ export interface IPCommonPoolDeployHelperV2Interface extends utils.Interface {
|
|
|
136
148
|
functionFragment: "deploy5115MarketAndSeedLiquidity",
|
|
137
149
|
data: BytesLike
|
|
138
150
|
): Result;
|
|
151
|
+
decodeFunctionResult(
|
|
152
|
+
functionFragment: "deployCommonMarketById",
|
|
153
|
+
data: BytesLike
|
|
154
|
+
): Result;
|
|
139
155
|
decodeFunctionResult(
|
|
140
156
|
functionFragment: "deployERC20Market",
|
|
141
157
|
data: BytesLike
|
|
@@ -206,6 +222,16 @@ export interface IPCommonPoolDeployHelperV2 extends BaseContract {
|
|
|
206
222
|
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
|
207
223
|
): Promise<ContractTransaction>;
|
|
208
224
|
|
|
225
|
+
deployCommonMarketById(
|
|
226
|
+
id: BytesLike,
|
|
227
|
+
constructorParams: BytesLike,
|
|
228
|
+
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
229
|
+
tokenToSeedLiqudity: string,
|
|
230
|
+
amountToSeed: BigNumberish,
|
|
231
|
+
syOwner: string,
|
|
232
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
233
|
+
): Promise<ContractTransaction>;
|
|
234
|
+
|
|
209
235
|
deployERC20Market(
|
|
210
236
|
constructorParams: BytesLike,
|
|
211
237
|
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
@@ -242,6 +268,16 @@ export interface IPCommonPoolDeployHelperV2 extends BaseContract {
|
|
|
242
268
|
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
|
243
269
|
): Promise<ContractTransaction>;
|
|
244
270
|
|
|
271
|
+
deployCommonMarketById(
|
|
272
|
+
id: BytesLike,
|
|
273
|
+
constructorParams: BytesLike,
|
|
274
|
+
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
275
|
+
tokenToSeedLiqudity: string,
|
|
276
|
+
amountToSeed: BigNumberish,
|
|
277
|
+
syOwner: string,
|
|
278
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
279
|
+
): Promise<ContractTransaction>;
|
|
280
|
+
|
|
245
281
|
deployERC20Market(
|
|
246
282
|
constructorParams: BytesLike,
|
|
247
283
|
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
@@ -278,6 +314,16 @@ export interface IPCommonPoolDeployHelperV2 extends BaseContract {
|
|
|
278
314
|
overrides?: CallOverrides
|
|
279
315
|
): Promise<IPPoolDeployHelperV2.PoolDeploymentAddrsStructOutput>;
|
|
280
316
|
|
|
317
|
+
deployCommonMarketById(
|
|
318
|
+
id: BytesLike,
|
|
319
|
+
constructorParams: BytesLike,
|
|
320
|
+
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
321
|
+
tokenToSeedLiqudity: string,
|
|
322
|
+
amountToSeed: BigNumberish,
|
|
323
|
+
syOwner: string,
|
|
324
|
+
overrides?: CallOverrides
|
|
325
|
+
): Promise<IPPoolDeployHelperV2.PoolDeploymentAddrsStructOutput>;
|
|
326
|
+
|
|
281
327
|
deployERC20Market(
|
|
282
328
|
constructorParams: BytesLike,
|
|
283
329
|
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
@@ -323,6 +369,16 @@ export interface IPCommonPoolDeployHelperV2 extends BaseContract {
|
|
|
323
369
|
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
|
324
370
|
): Promise<BigNumber>;
|
|
325
371
|
|
|
372
|
+
deployCommonMarketById(
|
|
373
|
+
id: BytesLike,
|
|
374
|
+
constructorParams: BytesLike,
|
|
375
|
+
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
376
|
+
tokenToSeedLiqudity: string,
|
|
377
|
+
amountToSeed: BigNumberish,
|
|
378
|
+
syOwner: string,
|
|
379
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
380
|
+
): Promise<BigNumber>;
|
|
381
|
+
|
|
326
382
|
deployERC20Market(
|
|
327
383
|
constructorParams: BytesLike,
|
|
328
384
|
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
@@ -360,6 +416,16 @@ export interface IPCommonPoolDeployHelperV2 extends BaseContract {
|
|
|
360
416
|
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
|
361
417
|
): Promise<PopulatedTransaction>;
|
|
362
418
|
|
|
419
|
+
deployCommonMarketById(
|
|
420
|
+
id: BytesLike,
|
|
421
|
+
constructorParams: BytesLike,
|
|
422
|
+
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
423
|
+
tokenToSeedLiqudity: string,
|
|
424
|
+
amountToSeed: BigNumberish,
|
|
425
|
+
syOwner: string,
|
|
426
|
+
overrides?: Overrides & { from?: string | Promise<string> }
|
|
427
|
+
): Promise<PopulatedTransaction>;
|
|
428
|
+
|
|
363
429
|
deployERC20Market(
|
|
364
430
|
constructorParams: BytesLike,
|
|
365
431
|
config: IPPoolDeployHelperV2.PoolConfigStruct,
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import {
|
|
5
|
+
BaseContract,
|
|
6
|
+
BigNumber,
|
|
7
|
+
BytesLike,
|
|
8
|
+
CallOverrides,
|
|
9
|
+
PopulatedTransaction,
|
|
10
|
+
Signer,
|
|
11
|
+
utils,
|
|
12
|
+
} from "ethers";
|
|
13
|
+
import { FunctionFragment, Result } from "@ethersproject/abi";
|
|
14
|
+
import { Listener, Provider } from "@ethersproject/providers";
|
|
15
|
+
import type {
|
|
16
|
+
TypedEventFilter,
|
|
17
|
+
TypedEvent,
|
|
18
|
+
TypedListener,
|
|
19
|
+
OnEvent,
|
|
20
|
+
} from "./common";
|
|
21
|
+
|
|
22
|
+
export interface IPReentrancyGuardUpgInterface extends utils.Interface {
|
|
23
|
+
contractName: "IPReentrancyGuardUpg";
|
|
24
|
+
functions: {
|
|
25
|
+
"reentrancyGuardEntered()": FunctionFragment;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
encodeFunctionData(
|
|
29
|
+
functionFragment: "reentrancyGuardEntered",
|
|
30
|
+
values?: undefined
|
|
31
|
+
): string;
|
|
32
|
+
|
|
33
|
+
decodeFunctionResult(
|
|
34
|
+
functionFragment: "reentrancyGuardEntered",
|
|
35
|
+
data: BytesLike
|
|
36
|
+
): Result;
|
|
37
|
+
|
|
38
|
+
events: {};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface IPReentrancyGuardUpg extends BaseContract {
|
|
42
|
+
contractName: "IPReentrancyGuardUpg";
|
|
43
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
44
|
+
attach(addressOrName: string): this;
|
|
45
|
+
deployed(): Promise<this>;
|
|
46
|
+
|
|
47
|
+
interface: IPReentrancyGuardUpgInterface;
|
|
48
|
+
|
|
49
|
+
queryFilter<TEvent extends TypedEvent>(
|
|
50
|
+
event: TypedEventFilter<TEvent>,
|
|
51
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
52
|
+
toBlock?: string | number | undefined
|
|
53
|
+
): Promise<Array<TEvent>>;
|
|
54
|
+
|
|
55
|
+
listeners<TEvent extends TypedEvent>(
|
|
56
|
+
eventFilter?: TypedEventFilter<TEvent>
|
|
57
|
+
): Array<TypedListener<TEvent>>;
|
|
58
|
+
listeners(eventName?: string): Array<Listener>;
|
|
59
|
+
removeAllListeners<TEvent extends TypedEvent>(
|
|
60
|
+
eventFilter: TypedEventFilter<TEvent>
|
|
61
|
+
): this;
|
|
62
|
+
removeAllListeners(eventName?: string): this;
|
|
63
|
+
off: OnEvent<this>;
|
|
64
|
+
on: OnEvent<this>;
|
|
65
|
+
once: OnEvent<this>;
|
|
66
|
+
removeListener: OnEvent<this>;
|
|
67
|
+
|
|
68
|
+
functions: {
|
|
69
|
+
reentrancyGuardEntered(overrides?: CallOverrides): Promise<[boolean]>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
reentrancyGuardEntered(overrides?: CallOverrides): Promise<boolean>;
|
|
73
|
+
|
|
74
|
+
callStatic: {
|
|
75
|
+
reentrancyGuardEntered(overrides?: CallOverrides): Promise<boolean>;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
filters: {};
|
|
79
|
+
|
|
80
|
+
estimateGas: {
|
|
81
|
+
reentrancyGuardEntered(overrides?: CallOverrides): Promise<BigNumber>;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
populateTransaction: {
|
|
85
|
+
reentrancyGuardEntered(
|
|
86
|
+
overrides?: CallOverrides
|
|
87
|
+
): Promise<PopulatedTransaction>;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
@@ -85,10 +85,15 @@ export declare namespace IMarketSweed {
|
|
|
85
85
|
export interface MarketSweedInterface extends utils.Interface {
|
|
86
86
|
contractName: "MarketSweed";
|
|
87
87
|
functions: {
|
|
88
|
+
"mintPYFromToken__noCall(address,(address,uint256,address,address,(uint8,address,bytes,bool)))": FunctionFragment;
|
|
88
89
|
"router()": FunctionFragment;
|
|
89
90
|
"seedAtImpliedRate(address,address,uint256,uint256,(address,uint256,address,address,(uint8,address,bytes,bool)),(uint256,uint256,uint256,int256,uint256))": FunctionFragment;
|
|
90
91
|
};
|
|
91
92
|
|
|
93
|
+
encodeFunctionData(
|
|
94
|
+
functionFragment: "mintPYFromToken__noCall",
|
|
95
|
+
values: [string, TokenInputStruct]
|
|
96
|
+
): string;
|
|
92
97
|
encodeFunctionData(functionFragment: "router", values?: undefined): string;
|
|
93
98
|
encodeFunctionData(
|
|
94
99
|
functionFragment: "seedAtImpliedRate",
|
|
@@ -102,6 +107,10 @@ export interface MarketSweedInterface extends utils.Interface {
|
|
|
102
107
|
]
|
|
103
108
|
): string;
|
|
104
109
|
|
|
110
|
+
decodeFunctionResult(
|
|
111
|
+
functionFragment: "mintPYFromToken__noCall",
|
|
112
|
+
data: BytesLike
|
|
113
|
+
): Result;
|
|
105
114
|
decodeFunctionResult(functionFragment: "router", data: BytesLike): Result;
|
|
106
115
|
decodeFunctionResult(
|
|
107
116
|
functionFragment: "seedAtImpliedRate",
|
|
@@ -139,6 +148,12 @@ export interface MarketSweed extends BaseContract {
|
|
|
139
148
|
removeListener: OnEvent<this>;
|
|
140
149
|
|
|
141
150
|
functions: {
|
|
151
|
+
mintPYFromToken__noCall(
|
|
152
|
+
YT: string,
|
|
153
|
+
input: TokenInputStruct,
|
|
154
|
+
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
|
155
|
+
): Promise<ContractTransaction>;
|
|
156
|
+
|
|
142
157
|
router(overrides?: CallOverrides): Promise<[string]>;
|
|
143
158
|
|
|
144
159
|
seedAtImpliedRate(
|
|
@@ -152,6 +167,12 @@ export interface MarketSweed extends BaseContract {
|
|
|
152
167
|
): Promise<ContractTransaction>;
|
|
153
168
|
};
|
|
154
169
|
|
|
170
|
+
mintPYFromToken__noCall(
|
|
171
|
+
YT: string,
|
|
172
|
+
input: TokenInputStruct,
|
|
173
|
+
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
|
174
|
+
): Promise<ContractTransaction>;
|
|
175
|
+
|
|
155
176
|
router(overrides?: CallOverrides): Promise<string>;
|
|
156
177
|
|
|
157
178
|
seedAtImpliedRate(
|
|
@@ -165,6 +186,12 @@ export interface MarketSweed extends BaseContract {
|
|
|
165
186
|
): Promise<ContractTransaction>;
|
|
166
187
|
|
|
167
188
|
callStatic: {
|
|
189
|
+
mintPYFromToken__noCall(
|
|
190
|
+
YT: string,
|
|
191
|
+
input: TokenInputStruct,
|
|
192
|
+
overrides?: CallOverrides
|
|
193
|
+
): Promise<BigNumber>;
|
|
194
|
+
|
|
168
195
|
router(overrides?: CallOverrides): Promise<string>;
|
|
169
196
|
|
|
170
197
|
seedAtImpliedRate(
|
|
@@ -187,6 +214,12 @@ export interface MarketSweed extends BaseContract {
|
|
|
187
214
|
filters: {};
|
|
188
215
|
|
|
189
216
|
estimateGas: {
|
|
217
|
+
mintPYFromToken__noCall(
|
|
218
|
+
YT: string,
|
|
219
|
+
input: TokenInputStruct,
|
|
220
|
+
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
|
221
|
+
): Promise<BigNumber>;
|
|
222
|
+
|
|
190
223
|
router(overrides?: CallOverrides): Promise<BigNumber>;
|
|
191
224
|
|
|
192
225
|
seedAtImpliedRate(
|
|
@@ -201,6 +234,12 @@ export interface MarketSweed extends BaseContract {
|
|
|
201
234
|
};
|
|
202
235
|
|
|
203
236
|
populateTransaction: {
|
|
237
|
+
mintPYFromToken__noCall(
|
|
238
|
+
YT: string,
|
|
239
|
+
input: TokenInputStruct,
|
|
240
|
+
overrides?: PayableOverrides & { from?: string | Promise<string> }
|
|
241
|
+
): Promise<PopulatedTransaction>;
|
|
242
|
+
|
|
204
243
|
router(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
205
244
|
|
|
206
245
|
seedAtImpliedRate(
|