The only money you would need is the cost of gas.
The only money you would need is the cost of gas.
flash_loan(int amount_borrowed, func arbitrary_trades)
1. give LOANEE_ADDRESS amount_borrowed
2. call arbitrary_trades()
3. give LOANER_ADDRESS (amount_borrowed + interest)
When 2. is executed, the loanee has the money. When 3. is complete, the loaner has the money back. If the loanee doesn't have the money to give, 3rd step fails. And since its atomic, the whole transaction fails.
A single atomic transaction does:
1) Borrow $80M 2) Use $80M however you want 3) Return $80M + loan fees (e.g. on Aave this would be 0.09%)
The lender is algorithmically guaranteed to get the money back and the borrower can potentially take advantage of large scale transient opportunities, or...just wreak havoc on a poorly secured system.
More info here: https://docs.aave.com/developers/guides/flash-loans
(I don't know what the second question means or what your mental model of a "real" currency is)