Hacker News new | past | comments | ask | show | jobs | submit login

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.

[1] https://medium.com/@kentmakishima/the-43k-defi-magic-trick-f...




In general the fee on a loan is based on two things: risk of default, and the time-value of money. It’s possible for the former to be zero, but lenders are losing money if they set the latter to zero.

Basically if you put $1000 of capital into the pot for making flash loans, then you are foregoing the X% / year that you could earn on interest, i.e. you are losing money.

It’s entirely possible that platforms are running these flash loans as a loss leader to drive adoption, but in a mature market and at scale, you’d expect there to be a small fee.

(Or just that the success-case fee covers the loss in the failure case, but that would break if the % of failed txns increased, so might not be a stable equilibrium. )


The time-value still comes into play in the form of eth transaction fee. If you're flash loaning to take advantage of an open arbitrage opportunity there will be other parties trying to take advantage of it, so you will pay more to get your transaction in before theirs.

For a lot of transactions like this its actually miners who can detect and rewrite these transactions to take advantage of the arbitrage opportunities first, for this reason this cost is called "miner extractable value" or MEV.

However, note this fee doesn't accrue to the lender!


> Basically if you put $1000 of capital into the pot for making flash loans, then you are foregoing the X% / year that you could earn on interest, i.e. you are losing money.

The funds aren't foregoing interest in all cases though. Ex: uniswap, curve, etc all require assets to be deposited, and pay depositors trading fees. These protocols could generate additional income by providing assets for flash loans without affecting the income received for acting as an amm.


I see, good point. If the deposits are there already then it’s no loss to put them to work like this.


What I struggle to understand is why the capital can be used with no fee (dydx - 2 wei). Why would someone contribute to such a pool that pays no interest as opposed to staking or lending somewhere else?




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: