Repository navigation
Support Robinhood Chain (4663) markets and collateral that is not 18 decimals - #104
Merged
Merged
Conversation
- New src/config/chains.js: per-chain RPCs, explorer, AMM flavour, Uniswap V3 and futarchy addresses; isUniswapChain() replaces chain === 1 branches. - Wagmi chain + transports, registry chain allowlist, candles endpoint, CHAIN_CONFIG, RPC maps and Reality config for chain 4663. - Uniswap quote/swap helpers take the chain's factory, QuoterV2 and Universal Router (non-canonical on 4663) and an Orbit-appropriate gas config. - TWAP widget reads on the market's chain and uses UniV3 observe() there. - Token decimals are read from the market instead of assumed 18: balances, split/merge/redeem amounts, max-amount raw units, swap amounts and sqrtPriceX96 prices (USDG and its outcome tokens have 6 decimals).
…mals - chains.config.json: chain 4663 with its Uniswap V3 and futarchy addresses. - Pool amounts and the initial sqrtPrice now use each token's real decimals. Before, both were computed as if every token had 18, which would have initialised a USDG (6 decimals) pool 10^12 away from the target price. - The CLI refuses to continue when outcome tokens have 18 decimals but the collateral does not. - minBond can be set per market in the config. - Fix a ReferenceError (gasNeeded) in the Uniswap pool-creation path. - config/test-nvda-robinhood.json: the test market created on 2026-11-11.
✅ 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.
What changed
Markets on Robinhood Chain (chain 4663, Uniswap V3) now load, chart and trade, and collateral with other than 18 decimals (USDG has 6) is handled.
src/config/chains.js(new): one per-chain table (RPCs, explorer, Uniswap and futarchy addresses) andisUniswapChain(). Thechain === 1branches that meant "Uniswap chain" now use it.observe()on Uniswap chains), explorer links and chain badge.src/utils/tokenDecimals.js(new): amounts and prices use each token's real decimals.futarchy-sdk/refactorCreateProposal: chain 4663 in the market CLI, real decimals for pool amounts and the initial price, per-marketminBond, and agasNeededReferenceError fix.Why
The futarchy stack was deployed on Robinhood Chain on 2026-11-11 for an NVDA/USDG market. The chain's Uniswap contracts are not at the canonical addresses, and the chain-1 code path hardcoded those.
How it was checked
npm run buildpasses;auto-qaunit tests pass (696).slot0at its target price (156.88, 164.92, 80.45, 80.45, 0.5, 0.5).https://api.futarchy.fi/candles/graphql?chainId=4663serves that market's pools and candles.Not checked
increaseObservationCardinalityNextfirst.