If you mean ETH/DeFi flash loans then, yes, they're quite simple. lol.
Here's how you can re-finance a loan
Say I have a Maker vault (CDP) with $100 of ETH locked in it, and I drew a loan of 40 DAI from it—so I’ve got a $60 net position minus my debt.
Now say I want to refinance into Compound for a better interest rate. Normally I’d need to go out and repurchase that 40 DAI to close out my CDP, which requires some up-front capital.
Instead, I can flash borrow 40 DAI, close out the $100 CDP, deposit $60 of my unlocked ETH into Compound, convert the other $40 of ETH back into DAI through Uniswap, and use that to repay the flash loan.
When are "flash loans" a legit function of a smart contract, and when are they "Attacks"?
Read this (the above quote comes from
this article).
This question/thread should be in Altcoins.