docs / 04
Index price
The index is what funding pulls the mark price toward. Shortcap computes it on-chain, from the token's spot pool on Elysium, on every call.
The TWAP
The pool keeps a price accumulator: the running sum of price × seconds. Reading it now and 5 minutes ago and dividing by the elapsed time gives the time-weighted average price over the window.
A single swap moves the spot price instantly. It moves a 5-minute TWAP by a fraction of that, in proportion to how long the price stays moved.
If the pool is younger than 5 minutes, the TWAP uses all the history it has.
The clamp
The index is the TWAP clamped to ±15% of spot of the instantaneous spot price.
index = min(max(twap, spot × (1 − 15%)), spot × (1 + 15%))
The clamp keeps the index from lagging a real, sustained move by more than 15%. A TWAP alone can stay stale for minutes after a token reprices.
The freeze
When spot moves more than 30% from TWAP away from the TWAP, the market freezes:
frozen = |spot − twap| ÷ twap > 30%
A frozen market refuses new positions and skips funding. It unfreezes as soon as spot is back within the band, either because the price came back or because the TWAP caught up.
Why no external oracle
The tokens Shortcap lists exist nowhere else. There is no CEX price to report and no off-chain feed that would know more than the pool. An external oracle would only add a party to trust.
So nobody runs the oracle. The oracle contract is a pure read of the pool.
Pool migration
A market is bound to one pool at creation. If a token's liquidity moves to a new pool, the old pool thins out, and the guardrails react: open-interest caps shrink with the liquidity, and large dislocations freeze the market.
A market cannot be repointed to another pool on the testnet. On mainnet, a pool migration will be handled by retiring the market and opening a new one on the new pool, through a governance parameter change.
Once a token has a HyperCore spot listing, the index for that token moves to the HyperCore market-data precompile, which Elysium plans about four weeks after mainnet.
Every update to markets, parameters and $SCAP is posted on X.
follow updates on x