Self-serve Create Market wizard: planner → real transactor (hub-e19)#93
Draft
krandder wants to merge 1 commit into
Draft
Self-serve Create Market wizard: planner → real transactor (hub-e19)#93krandder wants to merge 1 commit into
krandder wants to merge 1 commit into
Conversation
…dator (hub-e19) - Wallet-connected createProposal (simulate-first) via existing useCreateProposal - R1 liquidity floor gate ($100 trade <3% else DRAFT); R3 zero-trade honesty - validateMetadata: invert-flag vs token0, ticker, JSON round-trip, read-modify-write - 0xAlex TWAP defaults (live-from-start, 120h window, 48h msig buffer) - Static-export fix (was PR #81): /markets/new rendered empty shell in prod - 9/9 node:test units
✅ Deploy Preview for futarchy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Self-serve Create Market wizard: planner → real transactor (hub-e19)
Turns
/markets/newfrom a read-only plan preview into a wallet-connected marketcreation wizard, with the ratified self-serve gates baked in. Part of the
futarchy.fi self-serve program (hub-ilc), Tier 1.
What's new
CreateMarketFlownow connects a wallet(RainbowKit) and creates the proposal via the existing, proven
useCreateProposalhook. Simulate-first: a static call against Gnosis shows"would succeed — new proposal 0x…" with no broadcast, so the flow is demoable
end-to-end without minting a market; "Sign & broadcast" sends the real tx.
$100 trade moves price < 3%; below the floor it reads DRAFT. Computed from
pool math (
src/features/marketCreation/liquidityFloor.js). With a pinhead seedthe gate correctly says DRAFT — "a wizard that mints dead markets would be worse
than no wizard."
validateMetadata.js) — catches the exact bugs thatshipped to production: TWAP invert flags disagreeing with on-chain
token0(the ~22,000× price-display incident), missing
coingecko_ticker(hidden spotprice), and JSON that won't round-trip (the escape-stripping incident). Plus a
read-modify-write helper so
updateExtendedMetadatanever drops keys.resolves by the default rule, not as a market verdict.
48h msig buffer before vote close.
/markets/newwas an empty shell inproduction because the
dynamic(ssr:false)chunk 404'd underoutput:'export'.Now a static import + a mounted-guard on the wallet panel, so the page renders
in SSG and the wallet-connected parts hydrate client-side.
Tests
node --test test/marketCreation.test.mjs— 9/9: wrong invert flag caught + autocorrected, missing ticker caught, invert deferred pre-pools, read-modify-write
preserves keys / refuses unparseable input, deep pool LIVE vs thin pool DRAFT,
zero liquidity → DRAFT.
Not in this PR (staged, shown as the plan below the wizard)
FLM bundle deploy + bootstrap, Snapshot link, and arb activation remain the
described plan steps. The FLM factory is deployed on Gnosis (
0x1814aDfE…) but ispre-audit (one medium open, hub-rslu), so wiring its bootstrap into a one-click
flow waits on that fix. Arb activation = writing
arbitrageContractAddress(shared GNO/sDAI
0xaC59…) into metadata, picked up automatically by the arbautopilot.