Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
tientran3 committed Sep 12, 2024
1 parent 9d991a8 commit 291b8d8
Show file tree
Hide file tree
Showing 6 changed files with 165 additions and 169 deletions.
84 changes: 41 additions & 43 deletions hosted-sdk-demo/src/migrations/add-liquidity.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
# Add Liquidity
Examples below will add liquidity to stETH (30 Dec 2027) Pool on Ethereum
The examples below will add liquidity to the stETH (30 Dec 2027) Pool on Ethereum.

| Token | Address |
|--------|---------|
|Pool/LP|`0x34280882267ffa6383b363e278b027be083bbe3b`|
|SY|`0xcbc72d92b2dc8187414f6734718563898740c0bc`|
|PT|`0xb253eff1104802b97ac7e3ac9fdd73aece295a2c`|
|stETH|`0xae7ab96520de3a18e5e111b5eaab095312d7fe84`|

| 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
- Pass the SY address into the `tokenIn` parameter.
- Parameter changes:

| Old | New |
|-----|-----|
|receiverAddr|receiver|
|amountSyDesired|amountTokenIn|
|amountPtDesired|amountPtIn|
| receiverAddr | receiver |
| amountSyDesired | amountTokenIn |
| amountPtDesired | amountPtIn |

Example: Add liquidity 1 SY and 1 PT to the pool
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`

Expand All @@ -30,17 +29,17 @@ New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa
## addLiquidityDualTokenAndPt
New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidityDual

- Pass token address into `tokenIn` parameter.
- Pass the token address into the `tokenIn` parameter.
- Parameter changes:

| Old | New |
|-----|-----|
|receiverAddr|receiver|
|tokenInAddr|tokenIn|
|amountTokenDesired|amountTokenIn|
|amountPtDesired|amountPtIn|
| receiverAddr | receiver |
| tokenInAddr | tokenIn |
| amountTokenDesired | amountTokenIn |
| amountPtDesired | amountPtIn |

Example: Add liquidity 1 stETH and 1 PT to the pool
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`

Expand All @@ -49,16 +48,16 @@ New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa
## addLiquiditySinglePt
New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidity

- Pass PT address into `tokenIn` parameter.
- Pass the PT address into the `tokenIn` parameter.
- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`.
- Parameter changes:

| Old | New |
|-----|-----|
|receiverAddr|receiver|
|amountPtIn|amountIn|
| receiverAddr | receiver |
| amountPtIn | amountIn |

Example: Add liquidity 1 PT to the pool
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`

Expand All @@ -67,16 +66,16 @@ New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa
## addLiquiditySingleSy
New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidity

- Pass SY address into `tokenIn` parameter.
- Pass the SY address into the `tokenIn` parameter.
- If `impliedApy` is required in the API response, set `additionalData` to `impliedApy`.
- Parameter changes:

| Old | New |
|-----|-----|
|receiverAddr|receiver|
|amountSyIn|amountIn|
| receiverAddr | receiver |
| amountSyIn | amountIn |

Example: Add liquidity 1 SY to the pool
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`

Expand All @@ -85,18 +84,17 @@ New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa
## addLiquiditySingleSyKeepYt
New API docs: https://api-v2.pendle.finance/core/docs#/SDK/SdkController_addLiquidity

- Pass SY address into `tokenIn` parameter.
- Pass the SY address into the `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|

| receiverAddr | receiver |
| amountSyIn | amountIn |

Example: Add liquidity 1 SY to the pool and keep YT
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`

Expand All @@ -105,18 +103,18 @@ New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa
## 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`.
- Pass the token address into the `tokenIn` parameter.
- If `tokenIn` is not an input token 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|
| receiverAddr | receiver |
| tokenInAddr | tokenIn |
| amountTokenIn | amountIn |

Example: Add liquidity 1 stETH to the pool
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`

Expand All @@ -125,19 +123,19 @@ New query: `https://api-v2.pendle.finance/core/v1/sdk/1/markets/0x34280882267ffa
## 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`.
- Pass the token address into the `tokenIn` parameter.
- Set `zpi` to `true`.
- If `tokenIn` is not an input token 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|
| receiverAddr | receiver |
| tokenInAddr | tokenIn |
| amountTokenIn | amountIn |

Example: Add liquidity 1 stETH to the pool and keep YT
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`

Expand Down
35 changes: 17 additions & 18 deletions hosted-sdk-demo/src/migrations/mint.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
# Mint PT & YT
Examples below will mint PT stETH (30 Dec 2027) and YT stETH (30 Dec 2027) on Ethereum
The 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`|

| 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.
- Pass the SY stETH address into the `tokenIn` parameter.
- Parameter changes:

| Old | New |
|-----|-----|
|receiverAddr|receiver|
|ytAddr|yt|
|amountSyToMint|amountIn|
| receiverAddr | receiver |
| ytAddr | yt |
| amountSyToMint | amountIn |

Example: Mint PT and YT from 1 SY
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`

Expand All @@ -30,18 +29,18 @@ New query: `https://api-v2.pendle.finance/core/v1/sdk/1/mint?receiver=0xbD525dfF
## 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`.
- Pass the token address into the `tokenIn` parameter.
- If `tokenIn` is not an input token of SY stETH, set `enableAggregator` to `true`.
- Parameter changes:

| Old | New |
|-----|-----|
|receiverAddr|receiver|
|ytAddr|yt|
|tokenInAddr|tokenIn|
|amountTokenIn|amountIn|
| receiverAddr | receiver |
| ytAddr | yt |
| tokenInAddr | tokenIn |
| amountTokenIn | amountIn |

Example: Mint PT and YT from 1 stETH
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`

Expand Down
33 changes: 16 additions & 17 deletions hosted-sdk-demo/src/migrations/redeem.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
# Redeem PT & YT
Examples below will redeem PT stETH (30 Dec 2027) and YT stETH (30 Dec 2027) on Ethereum
The 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`|
| 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.
- Pass the SY stETH address into the `tokenOut` parameter.
- Parameter changes:

| Old | New |
|-----|-----|
|receiverAddr|receiver|
|ytAddr|yt|
|amountPyToRedeem|amountIn|
| receiverAddr | receiver |
| ytAddr | yt |
| amountPyToRedeem | amountIn |

Example: Redeem 1 PT and 1 YT to SY
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`

Expand All @@ -29,19 +29,18 @@ New query: `https://api-v2.pendle.finance/core/v1/sdk/1/redeem?receiver=0xbD525d
## 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`.
- Pass the token address into the `tokenOut` parameter.
- If `tokenOut` is not an output token of SY stETH, set `enableAggregator` to `true`.
- Parameter changes:

| Old | New |
|-----|-----|
|receiverAddr|receiver|
|ytAddr|yt|
|amountPyIn|amountIn|
| receiverAddr | receiver |
| ytAddr | yt |
| amountPyIn | amountIn |

Example: Redeem 1 PT and 1 YT from to stETH
Example: Redeem 1 PT and 1 YT 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`
Loading

0 comments on commit 291b8d8

Please sign in to comment.