FlashLoan Logic
In this section, we will introduce four main types that are essential for implementing Flash Loan via our SDK, which can be accessed using the api.
prefix:
FlashLoanLogicParams: This type represents the params used to configure the parameters required for making Flash Loan quote requests. By using the
loans
orrepays
parameter, you can specify the desired loan or repayment amounts.
FlashLoanLogicFields: This type represents the fields required for FlashLoanLogic, including the unique
id
,loans
and a booleanisLoan
field.
FlashLoanFields: A type that represents the fields required for the flash loan logic.
FlashLoanLogic: An interface that extends the
Logic
interface and represents the flash loan logic. It includes therid
, andfields
properties.
For any FlashLoan-like logic, you will need to create two FlashLoan logics data with a unique ID (such as a UUID):
one with
isLoan = true
, representing the loan taken out from the protocolone with
isLoan = false
, representing the loan repayment
Any additional logics that need to be executed during the FlashLoan process should be wrapped within these two FlashLoan logics.
Remember, the FlashLoan logic with isLoan = true
should be the first one, and the FlashLoan logic with isLoan = false
should be the last one.
Last updated