PtHandler
Inherits: IonHandlerBase, IPMarketSwapCallback
This contract allows for easy creation of leverage positions for PT collateralized Ion markets.
State Variables
MARKET
SY
PT
YT
flashswapInitiated
Functions
constructor
Creates a new PtHandler
instance
Parameters
Name | Type | Description |
---|---|---|
|
| The related IonPool. |
|
| The related GemJoin. |
|
| The whitelist contract. |
|
| The related Pendle market. |
ptLeverage
Allows a borrower to create a leveraged position on Ion Protocol
Transfer PT from user -> Flashswap PT token -> Deposit all PT into IonPool -> Borrow base asset -> Mint SY using base asset -> Repay Flashswap with SY.
swapCallback
This function should never be called directly.
On small enough swaps, the SY to send back can be 0. This function can only be called by the market. This function can only be called by market if the swap was initiated by this contract.
Parameters
Name | Type | Description |
---|---|---|
|
| Amount of PT sent from the perspective of the pool (negative means pool is sending, positive means user is receiving) |
|
| Amount of SY sent from the perspective of the pool (negative means pool is sending, positive means user is receiving) |
|
| Arbitrary data passed by the market |