4️PTB Functions
The PTB functions are designed to seamlessly integrate with other PTB codebases. These functions can be easily imported and used in various environments outside of the SDK, offering flexibility for broader application in your projects.
Deposit Coin
Deposits a specified coin into the pool.
Deposits a coin with account cap restrictions.
Withdraw Coin
Note: These PTB functions return a coin object, which needs to be either used or explicitly dropped within the PTB code.
Withdraws a specified amount of coin from the pool.
Withdraws a coin with account cap restrictions.
Borrow Coin
Borrows a specified amount of coin from the pool.
Repay Debt
Repays a specified debt amount using a coin object.
Flashloan
Initiates a flashloan from the pool with a specified amount.
Repays the flashloan using the provided receipt and repayment coin.
A flashloan demo is also provided: Sample TX
Liquidation
This function liquidates a position by paying debt and receiving collateral.
collateralBalance
is collateral coin what liquidator get after paying for the debt.remainDebtBalance
is repay coin left after paying for debt.
Claim Reward
Update Oracle PTB
Last updated