Skip to main content

CloberMarketFlashCallbackReceiver

CloberMarketFlashCallbackReceiver

cloberMarketFlashCallback

function cloberMarketFlashCallback(address quoteToken, address baseToken, uint256 quoteAmount, uint256 baseAmount, uint256 quoteFeeAmount, uint256 baseFeeAmount, bytes data) external

To use flash(), the user must implement this method. The user will receive the requested tokens via the OrderBook.flash() function before this method. In this method, the user must repay the loaned tokens plus fees, or the transaction will revert.

Parameters

NameTypeDescription
quoteTokenaddressThe quote token address.
baseTokenaddressThe base token address.
quoteAmountuint256The amount of quote tokens the user has borrowed.
baseAmountuint256The amount of base tokens the user has borrowed.
quoteFeeAmountuint256The fee amount in quote tokens for borrowing quote tokens.
baseFeeAmountuint256The fee amount in base tokens for borrowing base tokens.
databytesThe user's custom callback data.