DEV Community

ttt
ttt

Posted on

5 Silent Bugs That Break On-Chain RWA Trading Bots (and How to Handle Them)

I've watched (and built) enough on-chain trading bots to know that the ones that fail rarely blow up spectacularly — they leak. Here are five quiet failure modes I've seen over and over in RWA bot development, and how to handle each one.

  1. Acting on stale reference data
    The classic. The on-chain price looks dislocated, but the off-chain reference is just lagging, so the "opportunity" vanishes the moment you enter. Handle it: only trade when your reference quote is confirmed fresh — a staleness flag (like the one HyperBasis provides) makes this a one-line check.

  2. Ignoring session gaps
    Overnight and during holidays, the reference market is closed but the perp keeps trading. Spreads widen for real, and naive mean-reversion logic gets run over. Handle it: make your strategy session-aware, and widen your thresholds when the reference market is shut.

  3. Treating corporate actions as signals
    A 3% drop from a dividend or a split looks exactly like a breakdown — until it snaps back. Handle it: normalize your reference series for splits and dividends so these events never trigger your entry logic.

  4. Overlooking execution friction
    A spread can be real and still be untradeable if slippage and fees eat the edge. Handle it: model your all-in cost (spread minus slippage minus fees) before you size the position, not after.

  5. No data-source fallback
    If your single data feed hiccups, your bot either trades blind or freezes. Handle it: build in health checks and a sensible "do nothing" default when data is uncertain.

The common thread

Every one of these comes down to the same thing: trusting your data before you trust your signal. Tools like HyperBasis bake a lot of these guards in (staleness flags, session handling, corporate-action normalization), which is why I lean on them instead of re-deriving all of it.

Which of these has bitten you? I'd love to swap war stories in the comments.

Top comments (0)