Closed jkbpvsc closed 8 months ago
One consideration I'm having is if we should have all the borrows and repays happen in the fl_start
and fl_end
ixs, to prevent any unexpected combinations of flashloan ixs and bank state updates.
Thoughts @losman0s?
Flashloans
How they work
Flashloans work by deferring health checks for an account to the end of the flashloan. This is achieved with two new instructions.
flashloan_start
andflashloan_end
.flashloan_start
- performs a number of security checks, set theIN_FLASHLOAN_FLAG
flashloan_end
- checks the account health, and clears theIN_FLASHLOAN_FLAG
Security checklist
end_flashloan
ix index is afterstart_flashloan
ix indexend_flashloan
ix presentend_flashloan
ix is for the marginfi programend_flashloan
ix is for the same marginfi accountConsiderations