Conversation
Charge live mint and close transitions from a frozen 100-bucket capital coordinate. Refresh rebuilds from an inline cell array so a full book stays under the object-cache ceiling. The configured rate defaults to zero. Co-authored-by: Cursor <cursoragent@cursor.com>
This was referenced Aug 21, 2026
Store the 99 rungs as strike/forward and slide them at quote time so spot drift no longer needs a keeper refresh. Co-authored-by: Cursor <cursoragent@cursor.com>
The first mint already has a live pricer, so init and that trade are one transaction. The empty-book race and the grid keeper both go away. Co-authored-by: Cursor <cursoragent@cursor.com>
Keep the mechanism and tests; the notebooks and public write-up were bloating the PR. Co-authored-by: Cursor <cursoragent@cursor.com>
P-32 still treated keeper refresh, off-chain cuts, and a reused D033 as live work. Record the first-mint invert as D034 and leave only calibration and liquidation as remaining gates. Co-authored-by: Cursor <cursoragent@cursor.com>
Later mints cut the ratio ladder once from stored logs and center K on the stored incremental E, so the user path no longer walks every cell edge. Mint, close, and create events now carry the K pair and scale so a later tape can retune the rate. Co-authored-by: Cursor <cursoragent@cursor.com>
Warm-start each later rung from the last step and stop at 0.5 bp so the first charged mint no longer bisects against 10,000× forward. Co-authored-by: Cursor <cursoragent@cursor.com>
On-chain invert spent most of the computation cap. The keeper now supplies the 1% ladder; create only verifies 1% ± 1 bp. Co-authored-by: Cursor <cursoragent@cursor.com>
tonylee08
marked this pull request as draft
September 1, 2026 18:11
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.
Summary
K = average(top 5 bucket maxima) − E) and a capped convex potential. The configured rate is zero, so the path is live and the charge is still zero.initialize_inventory_grid/refresh_inventory_gridare authenticated keeper entry points. Callers submit 99 interiorstrike/forwardratios; the contract materializes the absolute ladder against its own forward and checks each bucket mass in[0.99%, 1.01%].Why
Inventory impact prices the extra concentrated capital a mint or close leaves on the book. The earlier L-based design with rebates was withdrawn; this replacement freezes a 1%-mass grid at initialize/refresh and charges only when centered capital rises. The rate stays at zero so the machinery can land and be gas-tested without turning the fee on. Refresh used to walk the payout tree and hit the object-cache wall around 1,000 nodes; the inline cell array is the path that completes a full book.
Linear / Context
Key decisions
inventory_impact_max_rate = 0. This is not a turn-on. Calibration ofB_K/r_Kis out of scope.inventory_cellsvector lives on the market object so refresh reads zero payout-tree children. IncrementalEuses the same snapped cell-span probability as apply, so refresh onto the same snapshot does not jumpK.Eat close is re-derived from the current frozen snapshot, not stored at mint.Scope / Descoped
max_costwiring, harness keeper / PTB / campaign traces, simulation event decode for the new charge field.B_K/r_Kcalibration, flat-vs-convex policy, liquidation inventory-charge policy, late-life cell resolution, nonzero-rate quote gas.Test plan
sui move test --path packages/predict --gas-limit 100000000000— 513 passed, including inventory-grid, inventory-cells, and inventory-impact flow tests.sui move test --path packages/sessions --gas-limit 100000000000— 24 passed (redeem_livenow takesmax_cost).sui move build --path packages/predict --warnings-are-errors— clean.capacity-treewithKEEPER_INVENTORY_GRID=1— grid init ~40M compute; refresh at a full book peaked at 626M compute (13% of the 5,000M cap) and did not abort on the object-cache wall.Risk / Rollout
inventory_grid:2if a submitted ratio ladder fails the mass check after an SVI roll; the next keeper tick retries.redeem_livegained amax_costargument. Callers of that entry must update with this package upgrade.Made with Cursor