In the case of flash loans/swaps, the answer is yes. It's 0. Further, I never have any capital at risk, all of my bots use flash loans/swaps. These transactions are atomic, which means that either all parts of it succeed or they all fail (it's a "revert" in blockchain parlance). So I can borrow $200 million without any prior permission and do an arb/liquidation or anything else I want with it for the life of my transaction, with the only requirement being that I must return it by the end. If my arb/liquidation/whatever succeeds and I return the loan, I keep the profits. If not, it's as if the whole thing never happened. The only risk is the transaction fee, which on the chains I do this on are miniscule.
I realize that it sounds unbelievable, but it exists. My code does thousands of these daily. I am not the only one doing this. See https://eigenphi.io/ . With the exception of sandwich transactions, every one of the bots you see on there is making profits without any capital at risk.
The risk of the trade on chain defaulting is virtually non-existent, agreed. Custody risk is never zero. Dollar in / dollar out returns involve lots of counterparties.