The tricky thing is that oracles vs market feeds depend on whether your protocol needs accurate short-term or long-term prices.
On-chain markets like Uniswap are relatively easy to manipulate on the short term, since they tend to have less liquidity than big CEXes. If your protocol will crash and burn if, say, the WBTC/ETH exchange rate it sees is 10% off from “correct” for a few minutes, then Uniswap prices are probably not a great data source, and the centralization of something like Chainlink could be a reasonable cost to bear.
Furthermore, because blockchains are slower, stuff like MEV and frontrunning can become bigger issues if you’re using on-chain prices that lag a few minutes behind “real” prices.
But in the long term, DEX prices are very robust, something I talked about more on my post on Melmint stability. In short, long-term market manipulation is essentially impossible whether the on-chain market is highly liquid or not — the attacker still needs to outspend the “rest of the world”.
And I believe that most useful DeFi protocols (e.g. Compound) do not really need precise, up-to-date prices; something like an accurate measurement of the average exchange rate in the past 24 hours should be sufficient unless the protocol is trying to squeeze out every last bit of efficiency.
Now, I think you probably shouldn’t design on-chain protocols that rely on precise real-time data anyway. Precise time on the blockchain is extremely tricky, and even if you trust your oracle completely, there are always things like “hyper-MEV” attacks where miners colluding to delay signalling of major price movements to your contract can lead to massive attacks that benefit miners, and it’s hard to patch up every possible attack.
The “correct” way of doing “defi HFT” might be some sort of off-chain protocol tied on-chain by something like zk proofs that prevent L1 consensus participants from being able to extract any value, but then it probably just kicks the “MEV” problem to whatever L2 ordering mechanism you use.
Maybe short-term trading should actually belong on centralized exchanges, except we might have a highly competitive market of darknet, crypto-only custody-minimizing exchanges connected to users with something like payment channels. Essentially a massive peer-to-peer “OTC” market over the internet.