what $SPX is
$SPX is a supply-elastic ERC-20 token on Robinhood Chain, a permissionless Arbitrum-Orbit L2 where tokenized stocks trade around the clock. The protocol targets the price of the tokenized SPY ETF that trades on that chain: one $SPX targets one SPY.
The contracts are a fork of Ampleforth's uFragments (GPL-3.0). Ampleforth targets the 2019 CPI-adjusted US dollar; $SPX replaces that target with the live price of the SPY stock token, read from Chainlink's SPY/USD feed on Robinhood Chain. Once per day the protocol compares its own market price against that target and, if the two have drifted far enough apart, adjusts the total supply — every wallet, by the same percentage.
live readout: target $… · market — none yet. the target feed is live today; the market leg begins when $SPX lists at genesis, and the deviation exists only once both do.
the mechanism
Once per day, at 02:00 UTC, the protocol reads two prices. The target is Chainlink's SPY/USD feed — time-weighted at the source, and frozen over weekends exactly as the index is. The market is a 24-hour TWAP of $SPX's own pool, converted to US dollars through the Chainlink USDG/USD feed. It computes the deviation between them. At deviations under 5%, nothing happens. At 5% or more — the boundary is inclusive — total supply changes by the deviation divided by a lag factor of 10, hard-capped at ±10% of supply per epoch. Roughly one-tenth of the gap is closed per rebase, so a persistent mispricing is corrected over a number of days rather than in one shock.
deviation = marketTWAP_usd / targetFeed - 1
if |deviation| < 0.05:
supplyDelta = 0 // under the band — no rebase
else: // triggers at exactly 5%
supplyDelta = totalSupply * deviation / lag // lag = 10
supplyDelta = clamp(supplyDelta, ±10% of supply) // immutable per-epoch caphow balances scale
Balances are not edited wallet-by-wallet. Internally, every account holds a fixed quantity of an indivisible unit (“gons”), and the visible balance is that quantity divided by a single global scalar. A rebase changes only the scalar. Every balance in existence scales by the same factor in the same block. On contractions that is the whole story: each holder's share of total supply is exactly constant. On expansions, 10% of the newly created supply is carved out for the geyser, so holders receive 90% of the delta pro-rata and their share dilutes by that skim — and only by that skim. No transfers occur and no per-wallet operations are performed.
worked examples
| market TWAP | deviation | band | supply change that night |
|---|---|---|---|
| $640.00 | −8.57% | outside | −0.86% (≈ −8,571 SPX) |
| $700.00 | +0.00% | inside | none — no rebase |
| $770.00 | +10.00% | outside | +1.00% (≈ +10,000 SPX) |
the honest economics (read this one)
The rebase targets the price of one token. It does not — and cannot — target the value of your holdings. Your wealth is balance × price, and because rebases scale every balance by the same factor (contractions exactly; expansions less the 10% geyser skim), your wealth is essentially your share of the network's market capitalization. Market capitalization is set by demand for $SPX itself. Not by the S&P 500.
worked example
Suppose the target sits at a round $700, the S&P 500 rises 10% and demand for $SPX is flat (market cap unchanged). The target rises to $770; $SPX now trades about 9.1% below it. Over the following nights the protocol contracts supply by roughly one-tenth of the remaining gap per rebase — about 9% cumulatively — until price meets the new target. You hold fewer tokens, each worth more, and your wealth is exactly where it started.
| before | after | |
|---|---|---|
| target | $700.00 | $770.00 |
| price | $700.00 | $770.00 |
| balance | 100.00 SPX | ≈90.91 SPX |
| wealth | $70,000 | $70,000 — unchanged |
countercyclical balances
Note the direction: when the index rallies, balances contract; when the index crashes, balances expand. Holding through an equity bull market with flat demand means watching your token count fall while the unit price climbs. This feels backwards. It is the mechanism working as designed.
The failure mode is the contraction spiral: contraction alarms holders, holders sell, price falls further below target, the next rebase contracts harder. Demand-driven wealth plus countercyclical supply is exactly the combination that has killed most Ampleforth forks. See risks.txt below — this is not a footnote.
oracle design
target oracle
The target is Chainlink's SPY/USD feed — time-weighted at the source, updated around the clock on trading days, and frozen over weekends exactly as the index is. The protocol never holds, custodies, or touches the geo-fenced stock token itself — it only reads the feed. Staleness and validity are checked on every read; a stale or paused feed does not produce a bad rebase, it produces no rebase.
market oracle
The market price is a 24-hour TWAP of $SPX's own canonical pool (SPX/USDG on Uniswap v2), converted to US dollars through the Chainlink USDG/USD feed so a stablecoin wobble is never mistaken for an $SPX mispricing. If USDG trades outside [$0.98, $1.02], the oracle reports invalid and the rebase is skipped.
execution
An orchestrator contract executes the rebase and then calls sync() on registered AMM pools in the same transaction, so pool reserves reprice atomically with the supply change and no sandwich window opens between the two. The rebase call itself is permissionless — anyone can trigger it once the daily window opens. There is no caller reward; we run a keeper so it happens on time.
manipulation analysis
Moving a 24-hour TWAP requires out-trading the pool for the better part of a day — sustained capital at risk, not a single-block flash loan. The canonical pool is a standard Uniswap v2 pool with the standard 0.30% fee, so every round trip a manipulator makes pays real fees. (Arcus RFQ, the chain's zero-fee venue, is not part of the oracle and the protocol never trades there.) The honest caveat is depth: a thin pool makes sustained manipulation cheaper regardless of fees. Thin pools are a real exposure and are listed under risks.
source governance
The economics — band, lag, skim, per-epoch cap — are immutable. The oracle sources are the one governed surface: a guardian behind a 48-hour timelock can re-point the target feed, the USDG conversion feed, or the market pool, until the guardian role ossifies (published target: within 12 months). The two legs are not protected to the same standard, and the difference matters enough to spell out.
the pool is pinned. the feeds are not.
Market pool: pinned by identity. The contract accepts a pair only if it is the canonical Uniswap v2 factory's own pair for exactly {SPX, USDG}, and it re-checks that the pair's two tokens are exactly ours. The guardian cannot substitute a pool it controls, because there is only one address that satisfies the check.
Price feeds: validated by shape, not identity. A replacement feed must be a contract that reports decimals() between 6 and 18, answers description(), and returns a positive latestRoundData(). That is the whole test. It is not an allowlist, not a codehash check, and not a comparison against Chainlink's registry. After the 48-hour timelock elapses, a guardian can point the target or USDG feed at any contract that answers like an aggregator, including one that reports whatever price the guardian wants.
The documented upgrade path is a pool-TWAP target once real on-chain SPY depth exists. If sources go stale or diverge beyond sanity bounds, the rebase is skipped rather than executed on bad data — but “sanity bounds” means staleness and peg checks, not proof that a feed is the feed it claims to be.
parameters
| parameter | value | notes |
|---|---|---|
| target | Chainlink SPY/USD feed | k = 1: one $SPX targets one SPY; weekend-frozen like the index |
| rebase time | 02:00 UTC, daily | permissionless call via the orchestrator — no caller reward; we run a keeper |
| deadband | ±5% | rebase triggers at deviations of 5% or more |
| lag | 10 | ≈1/10 of the gap closed per rebase |
| per-epoch cap | ±10% of supply | hard cap on any single rebase — immutable |
| expansion skim | 10% of new supply | funds the geyser; contractions are pure |
| market TWAP window | 24 h | USD-converted via the USDG/USD feed |
| USDG peg band | $0.98 – $1.02 | outside it the oracle is invalid — rebase skips |
| market pool | pinned | only the canonical factory pair for {SPX, USDG} is accepted — cannot be re-pointed |
| oracle guardian | 48 h timelock | can re-point price feeds to any aggregator-shaped contract (shape check only, not an allowlist), until ossification |
the economics above are immutable at deploy. guardian source changes are timelocked 48 h and documented here before they execute. the feed row is a real trust assumption, not a formality — see source governance above.
deployment
$SPX deploys on Robinhood Chain (chain id 4663). The canonical contract addresses are published in this table before they appear anywhere else.
| contract | address |
|---|---|
| spx token | — |
| wspx wrapper | — |
| canonical pair (spx/usdg) | — |
| monetary policy | — |
| oracle adapter | — |
| orchestrator | — |
| geyser | — |
| skim forwarder | — |
Liquidity policy: 100% of the genesis supply is paired with the USDG seed in the canonical pool, and the LP tokens are burned inside the genesis transaction itself — there is no lock-up period and no key that can ever withdraw the pool, because the position stops existing the moment it is created. The consequence cuts both ways: the pool's 0.30% swap fees accrue to those burned LP tokens and are unclaimable by anyone, including this project.
risks (the complete set)
economic
Holder wealth is driven entirely by demand for $SPX, not by the index it prices itself in. If demand stagnates while the index rises, balances contract and wealth goes nowhere; if demand collapses, contraction can feed on itself as selling deepens the deviation and each rebase cuts balances further. Most Ampleforth forks died in exactly this spiral. The mechanism does not prevent it; the mechanism is it.
oracle
The market oracle is a pool TWAP, and a TWAP is only as strong as the pool beneath it. A shallow pool makes a 24-hour TWAP cheaper to move — the pool's standard 0.30% fee taxes every manipulating round trip, but depth, not fees, is the real defense. The target side adds Chainlink dependencies: the SPY/USD feed and the USDG/USD conversion feed. A stale or paused feed, or a USDG depeg beyond the peg band, halts the rebase — a skip, never a bad rebase. And a TWAP lags fast moves by construction, so the market leg can trail sharp swings.
guardian
Until the guardian role ossifies, whoever holds it can — after a 48-hour timelock — re-point the SPY/USD and USDG/USD feeds at any contract shaped like a Chainlink aggregator. The contract checks the shape of a feed, not its identity: it cannot tell a real Chainlink feed from a convincing impostor. A compromised guardian key is therefore a route to repeated false rebases, bounded at ±10% per epoch but not bounded across epochs. The market pool cannot be swapped this way — it is pinned to the canonical factory pair — so this risk is specific to the two price feeds.
technical
The code modifies Ampleforth's audited uFragments base, and modifications to the audited base undergo independent review — but a modified audited contract is only as safe as the review of the modification itself. Separately, rebase tokens violate assumptions that integrators routinely make — that balances only change on transfer. AMPL's integration with Aave is the canonical precedent: lending markets, LP accounting, and bridges have all mishandled elastic supply. Assume any contract that has not explicitly handled rebasing will handle it wrong.
regulatory
A supply-elastic token that targets the price of an equity index product should expect scrutiny from securities regulators and from frameworks aimed at algorithmic stablecoins. Nothing in these docs is legal advice, the project has received none worth citing, and geographic restrictions may apply.
license & prior art
$SPX is a fork of Ampleforth's uFragments contracts and inherits their GPL-3.0 license; this fork is distributed under the same terms.
lineage & precedents
| project | target | note |
|---|---|---|
| Ampleforth (AMPL) | 2019 CPI-adjusted USD | the original uFragments rebase |
| DIGG | 1 BTC | BTC-target rebase, BadgerDAO |
| BASE Protocol | total crypto market cap × 10⁻¹² | index-target rebase |
| $BASED | moving peg | DeFi-summer rebase game theory |
| $SPX (this project) | tokenized SPY price | SPY-target rebase, Robinhood Chain |