01
The scenario is fixed
Absolute prices, hashed. After execution the account is valued at these same prices again, not shocked anew from wherever the market went.
Live · Hideki
Cross-margin stress, priced rescues, guarded fills.
Margin Rescue shocks BTC and ETH together on a dreamDEX cross-margin account, compares concrete reductions, executes one through a reduce-only guard, and recomputes the same scenario from the real fills.
built on Perps testnet · Somnia Hideki · chain 50383
Rescue lifecycle
Four records, each checked against the next.
The figures are the fork run in the console above, unedited: a real 6-market account, forked from block 33,472,615 and read at 33,472,616.
01
Absolute prices, hashed. After execution the account is valued at these same prices again, not shocked anew from wherever the market went.
scenario 2d73979b848ff9b5…
reference block 33,472,616 · 0x10d2a7b4…
model mr-model/1 · static · funding frozen
BTC 79,976.86 to 73,578.71 −8%
ETH 2,316.66 to 2,038.66 −12%
SOL XRP BNB SUI held at reference
target buffer at least 0.00 USDso
Hashed with SHA-256; the recompute values the account at these same prices.
02
Each candidate is filled now against the order book read at the reference block, then the remainder is valued at the scenario prices. The smallest cut that meets the target is preferred.
| Candidate | Cut now | Buffer at scenario | Goal |
|---|---|---|---|
| No action | 0.00 | (262.05) | Fails |
| BTC −25% | 1,110.08 | (145.39) | Fails |
| BTC −50% | 2,220.96 | (28.66) | Fails |
| BTC −75% | 3,331.84 | 88.05 | Meets |
| BTC −100% | 4,442.71 | 204.76 | Meets |
| ETH −25% | 945.66 | (127.78) | Fails |
| ETH −50%Preferred | 1,891.55 | 6.48 | Meets |
| ETH −75% | 2,837.21 | 140.70 | Meets |
| ETH −100% | 3,783.10 | 274.95 | Meets |
ETH −50% removes 1,891.55 of notional; the cheapest BTC fix, −75%, would remove 3,331.84.
03
The guard executes only if the live position still equals the one confirmed, and reverts the whole transaction if the position flips or grows.
Sell 0.8165 ETH · IOC · limit 2,305.06 · deadline 120 s
PositionMismatch(1.633, 0.8165)Fork: 38 / 38 Solidity tests against the real venue, with traces.
04
The receipt is bound to the confirmation first: sender, guard, calldata, nonce, the guard's event and the taker's fills. Then 17 ledger checks explain every change to the account before anything is credited.
| At the scenario prices | Health equity | Maintenance | Buffer |
|---|---|---|---|
| Before | 209.81 | 471.87 | (262.05) |
| Forecast | 436.73 | 430.25 | 6.48 |
| Actual, from the fills | 436.73 | 430.25 | 6.48 |
| Now, at current marks | 1,019.13 | 444.81 | 574.32 |
17 of 17 ledger checks hold · no outside change · reconciles exactly · goal met
Not around it: every read and every order goes through the venue's own contracts and tools.
dreamDEX is a fully onchain central limit order book on Somnia, open to apps built on top of it. Margin Rescue reads accounts through the venue's own bank, pools and SDK, and acts only through the operator grant dreamDEX already offers to bots. Nothing of the venue is forked, wrapped or re-hosted.
placeOrderFor, the same grant dreamDEX's “Link a bot” writes. It admits the guard, and is revoked afterwards.0x6B2F…8D3a0x4787…13941,203 of 7,677 accounts held two or more.
On dreamDEX, every position in an account draws on the same USDso collateral. A move in BTC changes how much margin is left for ETH, SOL and the rest, and a short can be the leg that keeps a long alive.
So the question is not which position is losing the most, but which concrete reduction restores the buffer for the whole account under the move you fear. In the fork example the instinctive fix, cutting the larger BTC leg, needs three quarters of it; halving ETH does the job with less exposure removed.
Margin Rescue checks every leg, every resting order and every stop, and says when its answer cannot be trusted.
Accounts by markets held
Live, read-only · indexer scan 26 Oct 2026| Markets held | Accounts |
|---|---|
| 1 | 6,474 |
| 2 | 322 |
| 3 | 329 |
| 4 | 230 |
| 5 | 193 |
| 6 | 64 |
| 7 | 25 |
| 8 | 11 |
| 9 | 8 |
| 10 | 7 |
| 11 | 1 |
| 12 | 1 |
| 13 | 2 |
| 14 | 3 |
| 15 | 1 |
| 16 | 1 |
| 17 | 1 |
| 18 | 0 |
| 19 | 1 |
| 20 | 1 |
| 21 | 2 |
Fixture, fork or live: every entry says which.
Fixture means synthetic data in unit tests. Fork means a local fork of the real venue at a recorded block. Live means Somnia Hideki itself.
Short answers. The guide has the long ones.
No. The site and the app read public chain data only. A reduction is signed in your own terminal, with your own wallet, from a plan you review; the browser never sees a key.
No. It is an independent tool built on dreamDEX's perps testnet: it uses the venue's contracts, SDK and operator grant as they are, and is not affiliated with or endorsed by dreamDEX or Somnia.
dreamDEX perps on the Somnia Hideki testnet, chain 50383. Any other chain is refused, and nothing touches mainnet or real funds.
The whole account at one pinned block: the bank's collateral and health, every position in all 21 pools, resting orders, the stop list and the BTC and ETH books. Then the block hash is checked again, so the snapshot cannot mix two blocks. That is why it takes 15 to 25 seconds.
Then there is no recommendation. A stale mark, an inexact reconciliation, a stop list the indexer has not caught up on, or a linked child account blocks it, and the reason is shown.
Yes. The live write, one guarded reduction on the project's own test account: goal met and cleanup verified, independently read back from the chain. The read-only parts have run as well: four real accounts reconcile exactly, and 7,700 of 7,700 holders match the bank's rounding. The app shows the run's transactions, its recomputation and its cleanup.
Paste any dreamDEX account, choose the move, and read what is left of its buffer, which reduction would restore it, and what a real execution looked like.
This is a static what-if at stated prices on the Somnia Hideki testnet. It does not predict prices, the path to them, liquidation, or fills of resting orders and stops along the way; an expected fill is not a guaranteed fill. The preferred reduction is the best of the candidates evaluated, not a global optimum. Nothing here is financial advice or concerns real funds.