📌Flashloans
Overview
The FlashLoan
contract is designed to facilitate arbitrage trading using flash loans from a decentralized exchange (like PancakeSwap). It performs a series of token swaps to capitalize on price discrepancies across different liquidity pools.r
Methods
getBalanceOfToken
getBalanceOfToken
Retrieves the balance of a specified token for this contract.
Parameters
Parameter | Type | Description |
|
| Token address to query the balance of. |
Returns
Return | Type | Description |
- |
| The token balance of the contract. |
placeTrade
placeTrade
Executes a trade on PancakeSwap.
Parameters
Parameter | Type | Description |
|
| Address of the token being traded from. |
|
| Address of the token being traded to. |
|
| Amount of |
Returns
Return | Type | Description |
|
| Amount of |
initialArbitrage
initialArbitrage
Initiates an arbitrage trade using a flash loan.
Parameters
Parameter | Type | Description |
|
| Address of the BUSD token to borrow. |
|
| Amount of BUSD to borrow for the flash loan. |
pancakeCall
pancakeCall
Callback function for PancakeSwap flash loan.
Parameters
Parameter | Type | Description |
|
| Address of the sender initiating the flash loan. |
|
| Amount of token0 involved in the loan. |
|
| Amount of token1 involved in the loan. |
|
| Encoded data for the loan. |
Last updated