Bits & Trends
all articles
pillar 12 min read

Per-Coin Freefall Protection: Stopping a Single-Coin Liquidation Before It Eats Your Capital

When one alt crashes 20% in 5 minutes, your DCA bot dumps 4× capital into a falling knife. Per-coin freefall protection blocks safety orders during single-coin liquidations. Gate 2 of the nine-gate framework: detection mechanics, threshold tuning by coin tier, and what the gate doesn't catch.

A trading bot that's healthy at the portfolio level can still lose half its capital on a single coin if one alt liquidates while everything else is calm. The portfolio metrics — Crash Score, fleet drawdown, average win rate — all look fine. The cascade detector doesn't fire because only one coin is falling. The daily loss lockout doesn't fire because the dollar damage hasn't crossed the threshold yet. But on this one coin, a cluster of bots is hitting safety orders deeper and deeper, eating capital, and the operator has no visibility because the dashboard says "all green".

This is the failure mode that per-coin freefall protection is designed for. It's Gate 2 in the nine-gate framework — the localized counterpart to the fleet-wide cascade detector covered in the previous article. Where cascade detection watches the whole fleet, freefall protection watches each coin individually. They're complementary: cascade catches synchronized failures across coins; freefall catches single-coin liquidations that don't reach fleet-wide significance.

This article walks through what freefall events actually look like in production, why per-coin tracking is the right granularity (not per-strategy, not per-bot, not portfolio-level), how detection works mechanically, and what the gate doesn't catch even when correctly tuned.

What a single-coin freefall looks like

A freefall isn't a slow grind down — it's a fast, localized capitulation event. Picture an alt that's trading at $1.20 with normal 2-3% daily volatility. A wallet decides to dump 15% of supply over a 5-minute window. Price drops to $0.95 — a 21% move that the rest of the market doesn't share. BTC barely moves. ETH barely moves. Other alts barely move. Just this one coin, gapping down on whatever liquidity exists in its order book.

If your bot has DCA strategies running on this coin with 1.5× safety orders at 2% steps, here's what happens in those 5 minutes:

  • First safety order fires at -2% (price $1.176)
  • Second safety order at -4% (price $1.152)
  • Third at -6% (price $1.128)
  • Fourth at -8% (price $1.104)
  • …safety orders keep firing as the price keeps dropping, deploying capital deeper into a falling knife

By the time the price stabilizes at $0.95, the bot has burned through 6-8 safety orders, deployed 4-5× the original capital, and is sitting on a position that's 20% underwater. None of this triggered cascade detection because no other coin moved. None of it triggered daily loss lockout because the loss is unrealized — the bot is still holding, hoping for recovery.

If recovery comes, fine. The averaging worked, the bot eventually exits at break-even or a small profit, lesson-free. If recovery doesn't come — and on a 21% local crash, recovery often takes weeks or never arrives — the bot has now committed 4× capital to a stuck position. That capital can't be redeployed elsewhere. Operating capital efficiency drops. Other strategies get starved. The whole fleet suffers because of one coin's freefall.

The fix is to detect the freefall as it's happening and stop new safety orders from firing on that coin until conditions stabilize.

Why "per-coin" is the right granularity

There are several places you could put a freefall gate:

  • Per-bot. Track each individual bot's drawdown, fire when crossed. This is just stop-loss; it's the bot's existing exit mechanism. Adds nothing beyond what the bot already does.
  • Per-strategy. Track all bots running a particular strategy. Useful for strategy-level diagnosis but misses the localized coin event — a strategy with bots on 10 different coins doesn't notice when one coin is in freefall.
  • Per-portfolio. Track total fleet drawdown. This is what cascade detection does. Works well for synchronized failures but misses single-coin events that don't aggregate to portfolio significance.
  • Per-coin. Track price velocity for each individual coin in the fleet's universe. Localized to the actual asset that's moving.

Per-coin is the right granularity because the failure mode is localized to one coin's order book. The bots in trouble share a coin, not a strategy. A scalp bot, a DCA bot, and a momentum bot can all be in trouble on the same coin if that coin is in freefall — the bots don't share strategy, they share asset. Filtering by anything other than the asset itself dilutes the signal.

The implementation cost is also lower at per-coin granularity. You're already fetching prices per coin for entry signals; the price stream is already there. Computing velocity is just a rolling window over the existing price stream. No new data acquisition needed. Per-strategy or per-portfolio aggregations require additional reduction passes.

Detection mechanics

The signal is a rolling price velocity measurement: how much has this coin moved in the last N minutes? When the absolute negative velocity crosses a threshold, fire the gate.

Concretely, the signal pipeline:

  1. Maintain a price history buffer per coin — a ring buffer of (price, timestamp) tuples covering the last 5-10 minutes. Updated every scan cycle.
  2. Compute velocity as (current_price - oldest_price_in_window) / oldest_price_in_window. Negative values mean falling; magnitude is the percentage drop.
  3. Compare to threshold. A typical setting: trigger when velocity ≤ -3% over a 5-minute window. Different coin types want different thresholds (more on this below).
  4. Set the gate. When triggered, mark this coin as "in freefall" with a timestamp.
  5. Clear the gate when stabilization conditions are met. This is the subtle part — see the next section.

The detection itself is cheap. A typical bot fleet runs scans every 1-5 minutes; each scan, you do a one-liner velocity calculation per coin. With 30 coins under watch, this is 30 calculations per scan, each O(1). Total runtime cost: under a millisecond.

The hard part: when to clear the gate

Setting the gate is easy. Knowing when to clear it is where most freefall implementations get sloppy.

The naïve approach is time-based: gate is set, wait 5 minutes, gate clears automatically. Problem: 5 minutes after a freefall, the coin might still be falling. Auto-clearing on a timer just means new entries resume into the falling knife.

A better approach is stabilization-based: keep the gate set until price has been stable for some minimum window. "Stable" can be defined as: price hasn't moved more than 1% in either direction over the last 3 minutes. The gate clears only when this stabilization condition holds.

This works better but introduces a subtle issue: if the coin enters a sustained bear trend (slow grind down rather than a sharp freefall), the gate clears between fast moves but immediately re-fires on the next fast move. The bot doesn't recover from the gate; it just re-fires endlessly. New entries are blocked but the operator gets log spam and never knows when the coin is "actually safe".

The robust approach combines both: gate clears when EITHER (a) stabilization holds for the configured window OR (b) total time since gate set exceeds a maximum (say, 30 minutes). The maximum-time fallback prevents stuck-gate scenarios where a coin in slow decline never satisfies stabilization. After the time fallback fires, the gate clears, but the coin enters a "watched" state where any single safety order requires manual approval. This isn't a perfect solution but it removes the worst behaviors of pure-time and pure-stabilization approaches.

In practice, the time-fallback rarely fires. Coins that are actually freefalling stabilize within 5-15 minutes; the gate cleanly clears via stabilization. Coins that genuinely keep falling are usually rare events — the time fallback handles them as edge cases rather than normal operation.

What "blocked" means specifically

When the freefall gate is set on a coin, the system should block:

  • New bot launches that target this coin
  • New safety order fires on existing bots holding this coin (this is the most important block — it prevents averaging into the falling knife)

The system should NOT block:

  • Take-profit exits on existing positions — if any deal manages to hit TP during a freefall (unlikely but possible during sharp rebounds), let it close cleanly
  • Stop-loss exits on existing positions — SL is the existing safety mechanism; freefall gate is in addition to, not in replacement of, SL
  • Strategies on other coins — the gate is per-coin, so other coins continue normally

The most subtle block is the safety-order suppression. Most DCA bot implementations have a fire-and-forget safety order schedule: when price drops X%, fire SO at Y size. Adding a per-coin gate means each safety order check needs to consult the freefall flag for that coin first. This is one extra lookup but architecturally requires touching every place the bot fires a safety order — usually a single function in the bot's tick loop, but worth verifying.

Tuning thresholds by coin type

Different coins want different thresholds because their normal volatility differs. A 3% drop in 5 minutes is a five-sigma event for BTC; for a thin-volume alt, it's just a Tuesday.

Practical guidelines for spot bots:

  • Major caps (BTC, ETH). Velocity threshold around -1.5% to -2% over 5 minutes. These coins shouldn't move that fast except on macro news. When they do, you genuinely don't want to be averaging in.
  • Top 50 alts (SOL, BNB, XRP, ADA, DOGE). -3% over 5 minutes is the typical setting. Volatility is higher than majors, so the threshold is wider.
  • Long-tail alts (rank 50-500). -5% to -7% over 5 minutes. These coins routinely move 10%+ on volume spikes; tighter thresholds produce false positives constantly.
  • Memecoins / new listings. -10% or higher, or disable freefall entirely on these coins. The signal-to-noise is so bad that any reasonable threshold either fires constantly (operator ignores it) or never fires when it should.

The "right" threshold for a specific coin is found empirically: log every freefall fire for 30 days, examine each one, classify as "correct catch" vs "false positive". Tighten the threshold if false positives dominate; loosen if real freefalls are slipping through. This is a per-coin tuning exercise that takes ongoing operator attention; one-shot tuning at deploy time always gets it wrong on at least a few coins.

What freefall protection doesn't catch

Like every other gate in the framework, freefall protection has a specific job. It misses several adjacent failure modes:

Slow grinds. A coin that drops 1% per hour for 8 hours never crosses the velocity threshold but ends the day down 8%. The bot averages all the way down. Daily loss lockout (Gate 3) catches this; freefall doesn't.

Sudden recovery into another freefall. Coin drops 5%, gate fires. Coin recovers 4% within 3 minutes — stabilization triggers, gate clears. Coin then drops another 5% in the next 3 minutes — gate re-fires, but the bot's safety orders fired during the brief gap. This is rare in practice (sharp V-recoveries followed by another leg down are unusual) but it does happen. The fix is widening the stabilization window, but that introduces other tradeoffs.

Coordinated multi-coin freefalls. When multiple alts crash simultaneously (e.g., regulatory news hitting the whole sector), each coin's freefall fires independently. This is correct behavior at the per-coin level but misses the meta-pattern: many coins are in freefall together, which is a cascade. The per-coin gate fires correctly on each, but the operator has to watch the dashboard to notice that 8 different coins all gated within the same minute. The fleet-level cascade gate (Gate 1) catches this directly.

Liquidation cascades on futures. This series is about spot bots; futures freefall events have additional complexity from forced liquidations. The detection signal (price velocity) works the same, but the response logic differs because exits aren't fully under the bot's control.

Exchange API issues during the freefall. If your price feed is delayed during a fast-moving freefall, the gate fires late or not at all. Robust implementations subscribe to multiple price sources or use derivative venues for confirmation. For simple paper-trading setups, the spot exchange ticker is "good enough" but a known limitation.

What success looks like

A well-tuned freefall gate fires several times per week on a typical bot fleet — not once every six months, not three times a day. Every fire should correspond to a price chart that visibly drops sharply during the gate window, and the gate window should align with the period when the price is actually falling.

The clearest signal of correct tuning is the post-event review. Pull the deal log for any day where freefall fired. For each fire, look at:

  1. The price chart for that coin during the gate window. Did it actually drop sharply?
  2. The deal log for that coin during the gate window. Were any safety orders blocked? (They should be.)
  3. The deal outcomes for any positions held during the gate. Did they hit SL more often than usual?

If the price charts show clear freefalls, the safety orders show clear blocks, and the outcomes show contained losses (no extreme drawdowns), the gate is working. If any of these three is missing — gates firing on calm price action, no safety orders actually blocked, or losses still extreme despite the gate — something is miscalibrated.

For paper-trading systems, this review can happen on a weekly cadence. For live systems, daily review during the first month, weekly thereafter, with alerts for any unexpected gate behavior.

Implementation recipe

If you're adding this to an existing bot architecture, the rough plan:

  1. Add a price-history ring buffer keyed by coin symbol. Updated on every scan; capped at a few-minute window. This is shared infrastructure — many other gates and signals will also use it.

  2. Add a freefall state map keyed by coin symbol. Each entry has gated_since: timestamp and last_price_at_gate. Defaults to empty; entries created when freefall fires.

  3. Compute velocity per scan for every coin in the active universe. If velocity ≤ threshold and coin is not currently gated, set the gate.

  4. Compute stabilization per scan for every gated coin. If price has been stable for the configured window OR maximum gate time has elapsed, clear the gate.

  5. Wire the gate into bot launch and safety-order paths. Every new bot creation checks freefallState[coin]. Every safety order fire checks the same. If gated, log skip and return early.

  6. Log every gate transition (set/clear) with the velocity that triggered it and the resulting state. This log is what you'll review weekly to tune thresholds.

  7. Test with historical data before deploying live. Replay 30 days of price history through the velocity calculation and confirm the gate fires when you'd expect — major dump events should trigger; calm days should not.

The whole implementation is maybe 100-150 lines of code. Like cascade detection, the leverage is enormous for the size: this single gate prevents the most damaging single-coin failure mode in DCA bot operation.

Connection to the broader framework

Freefall protection is one defense in a layered system. It catches localized capitulation events. It doesn't catch slow drawdowns (Gate 3 — daily loss lockout), drift in strategy edge (Gate 7 — drift detection), or strategic-level concentration (Gate 9 — multi-bot coordination). The full framework is in Pillar #1: Why Most Crypto Trading Bots Fail, and Gate 1 (cascade detection) was covered in the previous article of this series.

Gate 3 — Daily Loss Lockout — comes next. It's the slow-cousin of these two fast-event gates: where freefall fires on minutes-scale localized events and cascade fires on hours-scale fleet-wide events, daily loss lockout fires on day-scale account-level damage. Together these three gates cover the majority of "how big can a bot fleet lose in N time" scenarios.

Subscribe at the home page to get the next installment.

Disclaimer

Nothing in this article constitutes financial, investment, legal, or tax advice. Numbers cited from the bot are paper-trading data and not predictive of live performance. Cryptocurrency markets are volatile and you may lose all of your invested capital. Past performance — paper or live — does not predict future results. The methodology described works in development; it may not work for you in production. Do your own research, consult a licensed advisor, and start small.

Get the next article

No spam. Long-form articles only — about once per week.