diff --git a/hosted-sdk-demo/src/migrations/add-liquidity.md b/hosted-sdk-demo/src/migrations/add-liquidity.md new file mode 100644 index 0000000..13e3348 --- /dev/null +++ b/hosted-sdk-demo/src/migrations/add-liquidity.md @@ -0,0 +1,144 @@ +# Add Liquidity +Examples below will add liquidity to stETH (30 Dec 2027) Pool on Ethereum + +| Token | Address | +|--------|---------| +|Pool/LP|`0x34280882267ffa6383b363e278b027be083bbe3b`| +|SY|`0xcbc72d92b2dc8187414f6734718563898740c0bc`| +|PT|`0xb253eff1104802b97ac7e3ac9fdd73aece295a2c`| +|stETH|`0xae7ab96520de3a18e5e111b5eaab095312d7fe84`| + + +## addLiquidityDualSyAndPt +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidityDual + +- Pass SY address into `tokenIn` parameter +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountSyDesired|amountTokenIn| + |amountPtDesired|amountPtIn| + +Example: Add liquidity 1 SY and 1 PT to the pool + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/addLiquidityDualSyAndPt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountSyDesired=1000000000000000000&amountPtDesired=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/add-liquidity-dual?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xcbc72d92b2dc8187414f6734718563898740c0bc&amountTokenIn=1000000000000000000&amountPtIn=1000000000000000000` + +## addLiquidityDualTokenAndPt +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidityDual + +- Pass token address into `tokenIn` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |tokenInAddr|tokenIn| + |amountTokenDesired|amountTokenIn| + |amountPtDesired|amountPtIn| + +Example: Add liquidity 1 stETH and 1 PT to the pool + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/addLiquidityDualTokenAndPt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&tokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountTokenDesired=1000000000000000000&amountPtDesired=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/add-liquidity-dual?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountTokenIn=1000000000000000000&amountPtIn=1000000000000000000` + +## addLiquiditySinglePt +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidity + +- Pass PT address into `tokenIn` parameter. +- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountPtIn|amountIn| + +Example: Add liquidity 1 PT to the pool + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/addLiquiditySinglePt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountPtIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/add-liquidity?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xb253eff1104802b97ac7e3ac9fdd73aece295a2c&amountIn=1000000000000000000` + +## addLiquiditySingleSy +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidity + +- Pass SY address into `tokenIn` parameter. +- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountSyIn|amountIn| + +Example: Add liquidity 1 SY to the pool + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/addLiquiditySingleSy?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountSyIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/add-liquidity?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xcbc72d92b2dc8187414f6734718563898740c0bc&amountIn=1000000000000000000` + +## addLiquiditySingleSyKeepYt +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidity + +- Pass SY address into `tokenIn` parameter. +- Set `zpi` to `true`. +- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountSyIn|amountIn| + + +Example: Add liquidity 1 SY to the pool and keep YT + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/addLiquiditySingleSyKeepYt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountSyIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/add-liquidity?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xcbc72d92b2dc8187414f6734718563898740c0bc&amountIn=1000000000000000000&zpi=true` + +## addLiquiditySingleToken +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidity + +- Pass token address into `tokenIn` paramter. +- If `tokenIn` is not a input tokens of the pool, set `enableAggregator` to `true`. +- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |tokenInAddr|tokenIn| + |amountTokenIn|amountIn| + +Example: Add liquidity 1 stETH to the pool + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/addLiquiditySingleToken?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&tokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountTokenIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/add-liquidity?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountIn=1000000000000000000&zpi=false` + +## addLiquiditySingleTokenKeepYt +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidity + +- Pass token address into `tokenIn` paramter. +- Set `zpi` to `true`. +- If `tokenIn` is not a input tokens of the pool, set `enableAggregator` to `true`. +- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |tokenInAddr|tokenIn| + |amountTokenIn|amountIn| + +Example: Add liquidity 1 stETH to the pool and keep YT + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/addLiquiditySingleTokenKeepYt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&tokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountTokenIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/add-liquidity?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountIn=1000000000000000000&zpi=true` \ No newline at end of file diff --git a/hosted-sdk-demo/src/migrations/mint.md b/hosted-sdk-demo/src/migrations/mint.md new file mode 100644 index 0000000..c025a7e --- /dev/null +++ b/hosted-sdk-demo/src/migrations/mint.md @@ -0,0 +1,48 @@ +# Mint PT & YT +Examples below will mint PT stETH (30 Dec 2027) and YT stETH (30 Dec 2027) on Ethereum + +| Token | Address | +|--------|---------| +|SY|`0xcbc72d92b2dc8187414f6734718563898740c0bc`| +|PT|`0xb253eff1104802b97ac7e3ac9fdd73aece295a2c`| +|YT|`0x04b7fa1e727d7290d6e24fa9b426d0c940283a95`| +|stETH|`0xae7ab96520de3a18e5e111b5eaab095312d7fe84`| + + +## mintPyFromSy +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_mint + +- Pass SY stETH address into `tokenIn` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |ytAddr|yt| + |amountSyToMint|amountIn| + +Example: Mint PT and YT from 1 SY + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/mintPyFromSy?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&ytAddr=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&amountSyToMint=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/mint?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&yt=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&tokenIn=0xcbc72d92b2dc8187414f6734718563898740c0bc&amountIn=1000000000000000000` + +## mintPyFromToken +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_mint + +- Pass token address into `tokenIn` parameter. +- If `tokenIn` is not a input tokens of SY stETH, set `enableAggregator` to `true`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |ytAddr|yt| + |tokenInAddr|tokenIn| + |amountTokenIn|amountIn| + +Example: Mint PT and YT from 1 stETH + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/mintPyFromToken?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&ytAddr=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&tokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountTokenIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/mint?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&yt=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&tokenIn=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountIn=1000000000000000000` \ No newline at end of file diff --git a/hosted-sdk-demo/src/migrations/redeem.md b/hosted-sdk-demo/src/migrations/redeem.md new file mode 100644 index 0000000..2ac8c79 --- /dev/null +++ b/hosted-sdk-demo/src/migrations/redeem.md @@ -0,0 +1,47 @@ +# Redeem PT & YT +Examples below will redeem PT stETH (30 Dec 2027) and YT stETH (30 Dec 2027) on Ethereum + +| Token | Address | +|--------|---------| +|SY|`0xcbc72d92b2dc8187414f6734718563898740c0bc`| +|PT|`0xb253eff1104802b97ac7e3ac9fdd73aece295a2c`| +|YT|`0x04b7fa1e727d7290d6e24fa9b426d0c940283a95`| +|stETH|`0xae7ab96520de3a18e5e111b5eaab095312d7fe84`| + +## redeemPyToSy +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_redeem + +- Pass SY stETH address into `tokenOut` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |ytAddr|yt| + |amountPyToRedeem|amountIn| + +Example: Redeem 1 PT and 1 YT to SY + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/redeemPyToSy?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&ytAddr=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&amountPyToRedeem=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/redeem?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&yt=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&amountIn=1000000000000000000&tokenOut=0xcbc72d92b2dc8187414f6734718563898740c0bc` + +## redeemPyToToken +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_redeem + +- Pass token address into `tokenOut` parameter. +- If `tokenOut` is not a output tokens of SY stETH, set `enableAggregator` to `true`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |ytAddr|yt| + |amountPyIn|amountIn| + +Example: Redeem 1 PT and 1 YT from to stETH + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/redeemPyToToken?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&ytAddr=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&amountPyIn=1000000000000000000&tokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&slippage=0.001` + + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/redeem?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&yt=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&amountIn=1000000000000000000&tokenOut=0xae7ab96520de3a18e5e111b5eaab095312d7fe84` \ No newline at end of file diff --git a/hosted-sdk-demo/src/migrations/remove-liquidity.md b/hosted-sdk-demo/src/migrations/remove-liquidity.md new file mode 100644 index 0000000..df778fa --- /dev/null +++ b/hosted-sdk-demo/src/migrations/remove-liquidity.md @@ -0,0 +1,101 @@ +# Remove Liquidity + +Examples below will remove liquidity from stETH (30 Dec 2027) Pool on Ethereum: + +| Token | Address | +|--------|---------| +|Pool/LP|`0x34280882267ffa6383b363e278b027be083bbe3b`| +|SY|`0xcbc72d92b2dc8187414f6734718563898740c0bc`| +|PT|`0xb253eff1104802b97ac7e3ac9fdd73aece295a2c`| +|stETH|`0xae7ab96520de3a18e5e111b5eaab095312d7fe84`| + +## removeLiquidityDualSyAndPt +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_removeLiquidityDual + +- Pass SY address into `tokenOut` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountLpToRemove|amountIn| + +Example: Remove 1 LP to SY and PT + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/removeLiquidityDualSyAndPt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountLpToRemove=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/remove-liquidity-dual?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&amountIn=1000000000000000000&tokenOut=0xcbc72d92b2dc8187414f6734718563898740c0bc` + +## removeLiquidityDualTokenAndPt +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_removeLiquidityDual + +- Pass token address into `tokenOut` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountLpToRemove|amountIn| + |tokenOutAddr|tokenOut| + +Example: Remove 1 LP to stETH and PT + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/removeLiquidityDualTokenAndPt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountLpToRemove=1000000000000000000&tokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/remove-liquidity-dual?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&amountIn=1000000000000000000&tokenOut=0xae7ab96520de3a18e5e111b5eaab095312d7fe84` + +## removeLiquiditySinglePt +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_removeLiquidity + +- Pass PT address into `tokenOut` parameter. +- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountLpToRemove|amountIn| + +Example: Remove 1 LP to PT + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/removeLiquiditySinglePt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountLpToRemove=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/remove-liquidity?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&amountIn=1000000000000000000&tokenOut=0xb253eff1104802b97ac7e3ac9fdd73aece295a2c` + +## removeLiquiditySingleSy +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_removeLiquidity + +- Pass SY address into `tokenOut` parameter. +- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountLpToRemove|amountIn| + +Example: Remove 1 LP to SY + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/removeLiquiditySingleSy?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountLpToRemove=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/remove-liquidity?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&amountIn=1000000000000000000&tokenOut=0xcbc72d92b2dc8187414f6734718563898740c0bc` + +## removeLiquiditySingleToken +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_removeLiquidity + +- Pass token address into `tokenOut` parameter. +- If `tokenOut` is not a output tokens of SY stETH, set `enableAggregator` to `true`. +- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountLpToRemove|amountIn| + |tokenOutAddr|tokenOut| + +Example: Remove 1 LP to stETH + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/removeLiquiditySingleToken?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountLpToRemove=1000000000000000000&tokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/remove-liquidity?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&amountIn=1000000000000000000&tokenOut=0xae7ab96520de3a18e5e111b5eaab095312d7fe84` diff --git a/hosted-sdk-demo/src/migrations/swap.md b/hosted-sdk-demo/src/migrations/swap.md new file mode 100644 index 0000000..58a192d --- /dev/null +++ b/hosted-sdk-demo/src/migrations/swap.md @@ -0,0 +1,158 @@ +# Swap + +Examples below will swap tokens in stETH (30 Dec 2027) market on Ethereum: + +| Token | Address | +|--------|---------| +|Pool/LP|`0x34280882267ffa6383b363e278b027be083bbe3b`| +|SY|`0xcbc72d92b2dc8187414f6734718563898740c0bc`| +|PT|`0xb253eff1104802b97ac7e3ac9fdd73aece295a2c`| +|stETH|`0xae7ab96520de3a18e5e111b5eaab095312d7fe84`| + +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_swap + +- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`. +- If `effectiveApy` is required in the API response, set `additionalData` to `effectiveApy`. + +## swapExactPtForSy + +- Pass PT address into `tokenIn` parameter. +- Pass SY address into `tokenOut` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountPtIn|amountIn| + +Example: Swap 1 PT to SY + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/swapExactPtForSy?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountPtIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/swap?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xb253eff1104802b97ac7e3ac9fdd73aece295a2c&tokenOut=0xcbc72d92b2dc8187414f6734718563898740c0bc&amountIn=1000000000000000000` + +## swapExactPtForToken + +- Pass PT address into `tokenIn` parameter. +- Pass token address into `tokenOut` parameter. +- If `tokenOut` is not a output tokens of SY stETH, set `enableAggregator` to `true`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountPtIn|amountIn| + +Example: Swap 1 PT to stETH + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/swapExactPtForToken?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountPtIn=1000000000000000000&tokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/swap?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xb253eff1104802b97ac7e3ac9fdd73aece295a2c&tokenOut=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountIn=1000000000000000000` + +## swapExactSyForPt + +- Pass SY address into `tokenIn` parameter. +- Pass PT address into `tokenOut` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountSyIn|amountIn| + +Example: Swap 1 SY to PT + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/swapExactSyForPt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountSyIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/swap?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xcbc72d92b2dc8187414f6734718563898740c0bc&tokenOut=0xb253eff1104802b97ac7e3ac9fdd73aece295a2c&amountIn=1000000000000000000` + +## swapExactSyForYt + +- Pass SY address into `tokenIn` parameter. +- Pass YT address into `tokenOut` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountSyIn|amountIn| + +Example: Swap 1 SY to YT + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/swapExactSyForYt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountSyIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/swap?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xcbc72d92b2dc8187414f6734718563898740c0bc&tokenOut=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&amountIn=1000000000000000000` + +## swapExactTokenForPt + +- Pass token address into `tokenIn` parameter. +- If `tokenIn` is not a input tokens of the pool, set `enableAggregator` to `true`. +- Pass PT address into `tokenOut` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |tokenInAddr|tokenIn| + |amountTokenIn|amountIn| + +Example: Swap 1 stETH to PT + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/swapExactTokenForPt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&tokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountTokenIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/swap?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&tokenOut=0xb253eff1104802b97ac7e3ac9fdd73aece295a2c&amountIn=1000000000000000000` + +## swapExactTokenForYt + +- Pass token address into `tokenIn` parameter. +- If `tokenIn` is not a input tokens of the pool, set `enableAggregator` to `true`. +- Pass YT address into `tokenOut` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |tokenInAddr|tokenIn| + |amountTokenIn|amountIn| + +Example: Swap 1 stETH to YT + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/swapExactTokenForYt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&tokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenInAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountTokenIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/swap?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&tokenOut=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&amountIn=1000000000000000000` + +## swapExactYtForSy + +- Pass YT address into `tokenIn` parameter. +- Pass SY address into `tokenOut` parameter. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountYtIn|amountIn| + +Example: Swap 1 YT to SY + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/swapExactYtForSy?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountYtIn=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/swap?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&tokenOut=0xcbc72d92b2dc8187414f6734718563898740c0bc&amountIn=1000000000000000000` + +## swapExactYtForToken + +- Pass YT address into `tokenIn` parameter. +- Pass token address into `tokenOut` parameter. +- If `tokenOut` is not a output tokens of SY stETH, set `enableAggregator` to `true`. +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |amountYtIn|amountIn| + |tokenOutAddr|tokenOut| + +Example: Swap 1 YT to stETH + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/swapExactYtForToken?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&marketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&amountYtIn=1000000000000000000&tokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&syTokenOutAddr=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa6383b363e278b027be083bbe3b/swap?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&tokenIn=0x04b7fa1e727d7290d6e24fa9b426d0c940283a95&tokenOut=0xae7ab96520de3a18e5e111b5eaab095312d7fe84&amountIn=1000000000000000000` \ No newline at end of file diff --git a/hosted-sdk-demo/src/migrations/transfer.md b/hosted-sdk-demo/src/migrations/transfer.md new file mode 100644 index 0000000..b901a13 --- /dev/null +++ b/hosted-sdk-demo/src/migrations/transfer.md @@ -0,0 +1,37 @@ +# Transfer + +## Transfer liquidity + +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_transferLiquidity + +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |dstMarketAddr|dstMarket| + |zeroPriceImpact|zpi| + +Example: Transfer 1 LP, 1 PT and 1 YT from stETH (26 Dec 2024) `0xd0354d4e7bcf345fb117cabe41acadb724eccca2` to LP stETH (30 Dec 2027) `0x34280882267ffa6383b363e278b027be083bbe3b` + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/transferLiquidity?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&srcMarketAddr=0xd0354d4e7bcf345fb117cabe41acadb724eccca2&dstMarketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&lpAmount=1000000000000000000&ptAmount=1000000000000000000&ytAmount=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0xd0354d4e7bcf345fb117cabe41acadb724eccca2/transfer-liquidity?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&dstMarket=0x34280882267ffa6383b363e278b027be083bbe3b&lpAmount=1000000000000000000&ptAmount=1000000000000000000&ytAmount=1000000000000000000&redeemRewards=false&zpi=false` + +## Roll over PT + +New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_rollOverPt + +- Parameter changes: + + | Old | New | + |-----|-----| + |receiverAddr|receiver| + |dstMarketAddr|dstMarket| + |zeroPriceImpact|zpi| + +Example: Roll over 1 PT from stETH (29 Jun 2023) `0x9ec4c502d989f04ffa9312c9d6e3f872ec91a0f9` to PT stETH (30 Dec 2027) `0x34280882267ffa6383b363e278b027be083bbe3b` + +Old query: `https://api-v2.pendle.finance/sdk/api/v1/rollOverPt?chainId=1&receiverAddr=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&srcMarketAddr=0x9ec4c502d989f04ffa9312c9d6e3f872ec91a0f9&dstMarketAddr=0x34280882267ffa6383b363e278b027be083bbe3b&ptAmount=1000000000000000000&slippage=0.001` + +New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x9ec4c502d989f04ffa9312c9d6e3f872ec91a0f9/roll-over-pt?receiver=0xbD525dfF925DF9c063C77B29d5Eec8f977B79476&slippage=0.001&dstMarket=0x34280882267ffa6383b363e278b027be083bbe3b&ptAmount=1000000000000000000` \ No newline at end of file