This article [1] does a deep dive into how flash loan mechanics are structured using an actual Ethereum transaction as an example. This particular flash loan used dYdX, Uniswap, Aave, and Curve.fi.
Because of the atomicity of the transaction, there's no way to default on the loan. If you can't pay it back, you're never loaned the money in the first place.
Because of the atomicity of the transaction, there's no way to default on the loan. If you can't pay it back, you're never loaned the money in the first place.
[1] https://medium.com/@kentmakishima/the-43k-defi-magic-trick-f...