Skip to content

Support Robinhood Chain (4663) markets and collateral that is not 18 decimals - #104

Merged
krandder merged 2 commits into
mainfrom
feat/robinhood-chain-4663
Nov 12, 2026
Merged

krandder merged 2 commits into
mainfrom
feat/robinhood-chain-4663

Conversation

@krandder

Copy link
Copy Markdown
Contributor

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) and isUniswapChain(). The chain === 1 branches that meant "Uniswap chain" now use it.
  • wagmi chain and transports, the registry chain allowlist, candle endpoint, RPC maps, quoter, swap path (Universal Router + Permit2), TWAP read (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-market minBond, and a gasNeeded ReferenceError 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 build passes; auto-qa unit tests pass (696).
  • Live quote through the updated helper: 1 NVDA → 161.44 USDG on the chain's spot pool.
  • A test market was created on chain 4663 with the updated CLI: six pools, each read back from slot0 at its target price (156.88, 164.92, 80.45, 80.45, 0.5, 0.5).
  • https://api.futarchy.fi/candles/graphql?chainId=4663 serves that market's pools and candles.

Not checked

  • No swap, split, merge or redeem was executed through the UI on chain 4663.
  • TWAP on a new pool needs increaseObservationCardinalityNext first.
  • Explorer links on Ethereum markets now follow the chain (they pointed at GnosisScan before).
  • The Uniswap app link slug for the chain is a guess.

krandder and others added 2 commits November 11, 2026 23:34
- 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.
@netlify

netlify Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for futarchy ready!

Name Link
🔨 Latest commit 35e9d7e
🔍 Latest deploy log https://app.netlify.com/projects/futarchy/deploys/6af4fe251184cd46aa479baf
😎 Deploy Preview https://deploy-preview-104--futarchy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@krandder
krandder merged commit e1bbb96 into main Nov 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant