Repository navigation
bench 295: the threshold says when a position closes, not how far price has to move - #2962
Merged
Merged
Conversation
Bench 295 published Gains at 0.1600% of room at 500x, straight from its 80% liquidation threshold. Eleven real liquidations on pairs 300 and 313 fired at a median 59.4% of collateral, which is 0.1189% of price. The gap is both fee legs: 0.02% of notional on the way in and again on the way out, and at 500x that is 20 points of collateral against an 80 point threshold. percentProfit on the LimitExecuted log is the price move times leverage and nothing else, which the perp-liq-rate harness reproduces on 120 of 120 liquidations, so this is the realised trigger and not a model. The fee now comes from the pair's own fee group, read the way perp-fees reads it in production. The model predicts 60.0% against the measured 59.4%; the rest is borrowing, which accrues with holding time and is not a term at open. COLLATERAL RETURNED IS ZERO, NOT A FIFTH. amountSentToTrader is 0 on all 27 liquidations found, every pair, 7.5x to 500x. The 20 points the threshold leaves never reach the trader, so the column was wrong by 20 points on every Gains row. PAPERTRADE IS NOW MEASURED TOO. Its contract is unverified, so the fields were identified against external truth rather than an ABI: the price matches the live Hyperliquid mid under the per instrument factor from its own tuple, the leverage field caps at exactly the 1000 its docs state, and under the resulting reading the predicted bust distance is never crossed on 384 adverse closes, the closest reaching 92% of it. A ceiling respected 384 times is a measurement. NO ROW IS RANKED. Room comes from holding back less maintenance margin, and the venue that holds back least is the one that keeps everything when it fires. A single ranking rewards that whichever venue wins it, so every row publishes provisional. That also closes the audit's blocker: the product pages were ranking venues from the one view the bench itself calls not comparable. Both units now publish. Gains' own team reads liquidations as a share of collateral and the two units order the venues differently, so showing one alone reads as a contradiction. And the gauges reset each tick. A venue that lowered its maximum would otherwise keep a row on the leverage tabs it no longer offers, at its last value and 100% success.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bench 295 published Gains at 0.1600% of room at 500x, straight from its 80% liquidation threshold. Eleven real liquidations on pairs 300 and 313 fired at a median 59.4% of collateral, which is 0.1189% of price.
The gap is both fee legs. Gains charges 0.02% of notional on the way in and again on the way out, and at 500x that is 20 points of collateral against an 80 point threshold.
percentProfiton theLimitExecutedlog is the price move times leverage and nothing else, which the perp-liq-rate harness reproduces on 120 of 120 liquidations, so this is the realised trigger rather than a model.The fee now comes from the pair's own fee group, word 9 of
pairs()then word 0 offees()at 1e10, the read perp-fees runs in production. The model predicts 60.0% against the measured 59.4%; the rest is borrowing, which accrues with holding time and is not a term at open.Control that validates the method: standard pairs at low leverage read −88.80% at 7.5x and −86.61% at 25x, consistent with their 90% threshold minus small fee legs.
Collateral returned is zero, not a fifth
amountSentToTraderis 0 on all 27 liquidations found, every pair, 7.5x to 500x. The 20 points the threshold leaves never reach the trader. The column was wrong by 20 points on every Gains row, and it is now a real zero, which is also what bench 208 measured over 21,105 liquidations.Papertrade is measured too, so the comparison is symmetric
Its contract is unverified on hyperevmscan, there is no ABI on Sourcify, Etherscan v2 or any Blockscout mirror, and its two busiest events are absent from the public signature database. So the fields were identified against external truth instead:
/state/tradingtuple (BTC 10, ETH 100)longthe predicted bust distance is never crossed on 384 adverse closes, max ratio 0.922; under word 0 it is crossed 10 timesA ceiling respected 384 times out of 384 is a measurement. Papertrade's 0.1524% at 500x is no longer "modelled" against Gains' "measured".
No row is ranked
Room comes from holding back less maintenance margin, and the venue that holds back least is the one that keeps everything when it fires. A single ranking on this metric rewards that, whichever venue wins it. Every provider now carries
ranked: vector(0).That also closes the audit's Blocker 1: the product pages were ranking these venues from the one view the bench itself calls not comparable, so
/products/papertraderead "#4 of 4" off a comparison of four different leverages.I considered ranking on collateral lost instead, where Gains wins at every leverage. I did not: losing less collateral means being liquidated earlier, so it is the same quantity inverted to flatter one venue.
Both units publish
New gauge
perp_liq_collateral_lost_pctand a ledger column beside it. Gains' own team reads liquidations as a share of collateral, and the two units order the venues differently, so publishing one alone reads as a contradiction. At 500x: Gains 0.1200% of price and 60.0% of collateral, Papertrade 0.1524% and 76.2%.Stale series
The gauges
Reset()each tick. A venue that lowered its maximum leverage would otherwise keep a row on the tabs it no longer offers, at its last value and 100% success, contradicting the bench's own rule that such a venue is absent.What the page says now, BTC
Collateral returned: Gains 0, Papertrade 0, dYdX 60%, Hyperliquid 50%.
Gates
gofmt,go build,go vet,go test ./cmd/script/green.OCB_LIVE=1 go test -run TestLeverageTermsLiveprints the eight rows above and asserts the two units agree by construction.pnpm validate247 specs valid.pnpm exec tsc --noEmitclean.Deploy, after merge
Harness deploy, worker rebuild,
mat-reset.sh perp-max-leverage-terms. The gauges gained a metric and the old series are cleared on the first tick, so the bench rebuilds from the new ones.