Somnia Data Streams Could Prevent Your Next Liquidation
Liquidation bots can subscribe to a lending protocol’s collateral health feed, receiving automatic updates when positions approach unsafe territory.
The crypto market moves fast and the volatility can make trading very dangerous. Protecting your position often comes down to milliseconds, especially during flash crashes like the one we saw in October.
In theory, stop losses and liquidation bots can save you, but it doesn’t always play out like this in practice.
Stop losses usually fail during times of extreme volatility, even on the most reputable exchanges, and onchain liquidation bots are usually unable to react in time because of slow infrastructure.
This is all starting to change with Somnia, which has the high-speed infrastructure needed to build more efficient liquidation bots. The key feature to enable this breakthrough is Somnia Data Streams. With Data Streams, applications can subscribe to real-time price feeds and execute responses automatically, allowing liquidation bots to operate with the speed and reliability needed to actually protect users during volatile market conditions.
Risky Protection Mechanisms
Stop losses are great for simple everyday trading, but it’s not the kind of mechanism that you want to protect your entire portfolio with. If you set a stop at $100 and a flash crash happens, your trade might execute at $800 because you’re competing against thousands of other orders trying to fill at prices that no longer exist. This can be extremely painful if the price bumps back up to $90 after you get stopped out of your position. If you have a trading strategy, the infrastructure that you’re using to carry it out needs to work and it needs to be precise.
Your stop loss orders are also visible on centralized exchanges so market makers know exactly where the stop loss clusters sit. When prices approach those levels, sophisticated traders can execute trades ahead of those clusters, turning what should have been a protective mechanism into a target. This is why it’s always a good idea to set stop losses at odd numbers instead of round figures, because you will be separated from the large batches, but this still won’t save you during a flash crash.
Even with onchain solutions that operate transparently, polling creates blind spots. Most liquidation bots check the blockchain repeatedly, waiting for responses. In many cases, the market has already moved by the time they detect a threshold breach and submit a transaction. This delay becomes fatal during flash crashes, with positions falling into liquidation territory while bots are still processing old price data.
The Data Streams Advantage
Data Streams solves these problems through a fundamentally different approach. Instead of constantly checking prices, applications subscribe to the feeds they need and receive automatic updates the moment state changes occur. Liquidation bots can subscribe to a lending protocol’s collateral health feed, receiving automatic updates when positions approach unsafe territory.
This subscription model creates a major speed advantage when combined with Somnia’s sub-second finality. Detection, execution, and confirmation all happen in under a second, which is faster than most blockchains can even produce a new block. Most onchain liquidation bots get price updates only when new blocks are produced, which creates windows where crashes can happen undetected. Data Streams bots would be able to react within milliseconds of state changes because they’re notified as it happens.
It’s not just about speed though, the subscription model enables more sophisticated protection strategies. Data Streams bots can implement graduated responses because they don’t need to deal with the expense of constant monitoring. As collateral ratios decline, a bot might reduce exposure incrementally rather than triggering full liquidation. A 5% drop might trigger partial position closure, 10% could close more, and 15% could entirely close the position. This nuanced approach gives positions room to recover during temporary volatility while preventing catastrophic losses.
As we covered previously, data streams could also enable more efficient arbitrage bots, which could give arbitrage traders on Somnia an advantage while making the market as a whole more efficient.
If you have an interesting idea for leveraging Data Streams to build something cool on Somnia, join our Hackathon and show us what you dreamed up.



