Pricing & Funding
Origin operates two distinct price pipelines for two distinct purposes. Index price is sourced from Pyth and is used for funding rate calculation and PnL accounting. Mark price is constructed from a robust three-source median (with one input being a CEX-direct median) and is used for liquidation triggers and margin ratio. Keeping these pipelines separate means that the source used for solvency decisions is independent from the source used for funding, which limits the blast radius of any single data-source failure.
Index Price (Pyth)
Source
Index price is provided by Pyth Network. Pyth supplies high-frequency, first-party price data sourced from major trading firms and exchanges, with confidence intervals and cryptographic attestations.
Use
Index price drives:
- The funding rate calculation (Funding Payments).
- Reference values reported in account state.
- Conversion of non-USD collateral to USD for margining (where Pyth provides the FX feed).
Feed Binding
Each market binds to a specific Pyth feed identifier at listing. The feed binding is recorded in the on-chain Asset Registry and can only be changed via governance.
Mark Price (Three-Source Median)
Formula
Mark price is the median of three independent price estimates, each robust to a different failure mode:
mark_price = median( impact_price, cex_median, ema_orderbook )
Where:
| Input | Definition |
|---|---|
impact_price | Average execution price of a hypothetical fixed-size market order on Origin's own order book, computed for both bid and ask sides and averaged. |
cex_median | Median of recent prices for the underlying instrument across a configured set of major external venues, polled directly by Origin's Oracle Ingestion service. |
ema_orderbook | Exponentially weighted moving average of Origin's order book mid price over a short rolling window (default 10 seconds). |
Sources of cex_median
The CEX price set is configured per market and is independent of the Pyth feed used for index. For crypto perps, the set is the major centralized spot or perp venues for the underlying. For equity and commodity perps, the equivalent reference venues are used. The configured set is published per market and updated only through governance.
This separation matters: even if Pyth experiences degradation or compromise, the mark price (which gates liquidations) does not depend on it.
Why a Three-Source Median
Each input alone has a known weakness:
impact_pricecan be moved by a determined trader willing to take losses on Origin.cex_mediancan lag during fast moves or fail to reflect Origin-specific liquidity.ema_orderbookis exposed to spoofing or thin-book conditions.
The median of all three is robust to any single source being attacked or stale: an attacker would need to move at least two of the three simultaneously, which is materially harder.
Use of Mark Price
Mark price (not last-trade price) is used to calculate:
- Unrealized PnL.
- Margin ratio and account health state.
- Liquidation triggers.
- Conditional order trigger conditions (SL/TP/Stop).
Using mark price prevents wick-based liquidations and triggers caused by transient illiquidity or single-print spikes.
Oracle Heartbeat & Staleness
Heartbeat
The Risk Engine expects fresh price updates at minimum every 5 seconds per market. Both pipelines (Pyth index and CEX-median for mark) carry independent heartbeats.
Stale-Feed Behavior
When a feed is flagged stale:
| Pipeline Stale | System Response |
|---|---|
| Index (Pyth) | Halt funding rate updates for affected market. |
| One of three mark inputs | Mark price falls back to the median of the remaining two valid sources. |
| Two of three mark inputs | Market enters per-market HALTED. |
| Both pipelines | Market enters per-market HALTED. |
In HALTED state, existing positions continue to mark against the last valid mark price but cannot be liquidated. This prevents liquidations driven by missing data rather than genuine market moves.
Feed Recovery
When a feed resumes, the engine resumes mark and index updates and clears any backlog of margin evaluations before re-enabling trading and liquidations. There is a brief grace period (default 30 seconds) during which margin breaches are flagged but not liquidated, giving users time to react to post-recovery prices.
FX Oracle for Virtual Markets
Virtual cross-currency markets (Virtual Cross-Currency Markets) require a separate FX price pipeline for each supported stablecoin pair (e.g., USD/KRW, USD/EUR, USD/JPY). This pipeline is distinct from the asset-level Pyth and CEX sources described above.
Primary source: StableFX $1M RFQ. The FX oracle mark price is anchored to the $1M-notional executable RFQ quote sourced from StableFX. Circle describes StableFX as an Arc-based stablecoin FX engine that combines off-chain RFQ execution with on-chain settlement, receiving competitive quotes from multiple liquidity providers. The $1M RFQ level is used as the primary mark input because it reflects real executable liquidity at an institutionally meaningful size, rather than a theoretical midpoint that may not be achievable. Size buckets are cached:
USD/KRW ask curve (StableFX RFQ):
$100K: 1,382
$1M: 1,385 ← primary mark input
$5M: 1,390
$10M: 1,396
Blended oracle formula. The published FX oracle mark is not a raw RFQ quote in isolation. It is a weighted blend designed to be robust to RFQ sparseness and LP-level manipulation:
fx_oracle_mark = weighted_blend(
StableFX $1M RFQ mid, # primary: executable, size-aware
backup FX oracle feed, # secondary: ensures continuous coverage
internal StableFX fill prices, # reinforces with actual settled rates
5-minute TWAP # smoothing: prevents spike manipulation
)
The $1M RFQ is the dominant weight under normal conditions. If StableFX quotes become unavailable, the oracle falls back to the blended backup with widened haircuts (FX Haircut Pricing: Price Type by Risk Purpose).
Conversion pricing. When actual currency conversion is needed (user withdrawal, liquidation collateral seizure, treasury rebalancing), the protocol does not use the oracle mark. Instead, it requests a live executable RFQ at the actual notional size of the conversion. The oracle mark is for continuous valuation; the live RFQ is for actual settlement. The distinction matters: a $50M liquidation is priced with a $50M RFQ, not with the $1M mark rate.
FX Stablecoin Basis Tracking
There is a meaningful difference between the theoretical fiat FX rate (e.g., USD/KRW on TradFi markets) and the actual stablecoin FX rate (KRW1/USDC on-chain). The protocol tracks this basis explicitly:
stablecoin_fx_basis = stablecoin_fx_rate - reference_fiat_fx_rate
If KRW1 trades at a discount to fiat KRW (a negative basis), collateral value must reflect the KRW1 on-chain rate, not the theoretical fiat rate. The protocol does not value KRW1 as if it were perfectly redeemable at the fiat FX rate unless that rate is executable.
When the stablecoin basis widens beyond a configurable threshold, the collateral haircut for that asset is tightened automatically and the dynamic haircut formula (Dynamic Haircuts) applies the issuer penalty component.
FX Circuit Breakers
Virtual market trading for a given currency pair is automatically suspended under the following conditions:
| Trigger | Action |
|---|---|
| StableFX RFQ unavailable for a currency pair | Disable new virtual orders for that currency; switch to reduce-only |
| Backup oracle deviates from $1M RFQ by > threshold | Pause virtual market; increase collateral haircut; alert operator |
FX bid/ask spread widens beyond circuit_breaker_spread_bps (default 100 bps) | Pause virtual order entry; allow canonical USD trading |
| FX moves > configured bps in configured window | Per-market HALTED for affected virtual pairs |
| Settlement failure rate for an LP exceeds threshold | Remove LP from oracle weighting; reduce quote TTL |
| Stablecoin depeg detected (basis > threshold) | Reduce collateral factor dynamically; disable new deposits in that asset; force reduce-only for affected accounts |
Circuit breaker events are logged on-chain and announced via the system-state WebSocket channel. Canonical USD market trading is unaffected by FX circuit breakers; only the virtual overlays are suspended.
Purpose
The funding rate is the periodic payment exchanged between long and short positions in a perpetual contract. Its purpose is to anchor the contract's mark price to the underlying index price. When perps trade above index, longs pay shorts; when perps trade below, shorts pay longs. There is no protocol skim. Funding is a closed system between traders.
Interval
Funding settles every 1 hour. At each funding interval, the funding payment is calculated from the prevailing funding rate and applied to every open position pro-rata to position size.
Formula
Origin uses the standard premium-plus-interest construction:
funding_rate = premium_index + clamp( interest_rate - premium_index, -0.05%, +0.05% )
Where:
premium_index = TWA( (mark_price - index_price) / index_price ) over the funding interval
interest_rate = small positive constant reflecting cost-of-carry (default 0.01% per interval)
Cap
The funding rate is hard-capped per interval at ±4.00%. The cap is sized to allow funding to forcefully drive perps toward index during sustained dislocations while still bounding the worst-case payment any single position can incur in one settlement.
Settlement
At each interval, funding is calculated on each account's net position, debited from one side, and credited to the other, with all bookkeeping settled on-chain in the Margin Vault as part of the next batch. The funding payment flows directly to realized PnL and collateral (Trading Fees).
Worked Example
Suppose during a 1-hour interval:
- Time-weighted average premium:
+0.30% - Interest rate component:
+0.01% - An account holds long 10 BTC-PERP at mark price $80,000 (notional $800,000).
premium_index = +0.30%
interest_term = clamp( 0.01% - 0.30%, -0.05%, +0.05% )
= -0.05% (clamped to lower bound)
funding_rate = 0.30% + (-0.05%)
= 0.25%
funding_payment = signed_size × mark_price × funding_rate
= +10 × 80,000 × 0.0025
= +2,000 (paid by long; received pro-rata by shorts)
The long account's realized_pnl_lifetime decreases by 2,000 and funding_paid_lifetime decreases by 2,000. Collateral balance decreases by 2,000.
If the same conditions persisted such that the raw rate exceeded 4.00%, it would be capped at exactly 4.00% for that interval.
Discovery Bounds
Discovery Bounds enable 24/7 price discovery for markets with external trading hours (equities, commodities) by allowing the perpetual to drift from the stale external reference price during market closures, while protecting traders with upper and lower price limits. This mechanism is inspired by trade.xyz and adapted for Origin's risk framework.
Purpose
When external markets close (weekends, holidays, after-hours), Origin serves as the primary venue for price discovery. Without external arbitrage loops, the perpetual mark price can diverge from the last known index price. Discovery Bounds provide:
- Price discovery: Allow the mark price to move within bounded ranges to reflect genuine market sentiment
- Trader protection: Prevent runaway price moves that would cause unfair liquidations
- Liquidation safety: Protect positions from being liquidated during bounded discovery periods
- Funding flexibility: Relax funding rate constraints to let the premium adjust to supply/demand imbalances
Discovery Mode Activation
Discovery Mode activates automatically when external market data becomes unavailable:
| Trigger | Condition |
|---|---|
| Scheduled close | Equity markets (NYSE/NASDAQ) close at 4:00 PM ET; commodities per exchange schedules |
| Weekend trading | Friday 4:00 PM ET through Monday 9:30 AM ET for equities |
| Holiday closure | Configured exchange holidays |
| Oracle staleness | CEX-median feed for mark price becomes stale while external markets are expected to be open |
When Discovery Mode activates:
discovery_modeflag is set totruefor the marketreference_priceis set to the last valid external index priceresets_upward_counterandresets_downward_counterreset to 0
When external markets reopen:
discovery_modetransitions tofalse- All reset counters clear to 0
reference_pricereverts to live external index price- Normal funding formula resumes
Instantaneous Bounds
During Discovery Mode, the mark price is constrained within symmetric bounds around the current reference price:
discovery_bound = 1 / max_leverage
upper_bound = reference_price × (1 + discovery_bound)
lower_bound = reference_price × (1 - discovery_bound)
The bound width is derived from the market's maximum leverage tier:
| Tier | Max Leverage | Discovery Bound |
|---|---|---|
| Majors | 20× | ±5.00% |
| Mid | 10× | ±10.00% |
| Longtail | 3× | ±33.33% |
This bound width is chosen because at maximum leverage, a move of 1/leverage exactly equals the initial margin. The bound prevents cascading liquidations caused by mark price drift during discovery periods.
Mark Price Enforcement:
The mark price used for unrealized PnL, margin ratio, and conditional order triggers is clamped to the active bounds:
clamped_mark_price = min(upper_bound, max(lower_bound, raw_mark_price))
Trades execute against the raw order book; the bound clamping applies only to mark price calculations.
Re-Anchoring Mechanism
As the mark price approaches the edge of the current bound and reaches a configured trigger threshold, the reference price re-anchors to that edge, establishing a fresh bound around the new reference. This "ratcheting" allows the market to reflect genuine moves during extended closure periods.
Trigger Formulas:
upper_trigger = reference_price × (1 + discovery_bound × reanchor_threshold)
lower_trigger = reference_price × (1 - discovery_bound × reanchor_threshold)
Where reanchor_threshold (default 0.90) is the percentage of the bound distance that must be crossed before re-anchoring occurs.
Reset Counters:
Each market configures resets_upward and resets_downward independently. When a re-anchor occurs:
reference_priceupdates to the previousupper_bound(for upward moves) orlower_bound(for downward moves)- New bounds are calculated around the updated reference
- The corresponding reset counter increments by 1
- When resets are exhausted, the bound becomes a hard cap
Independence of Directions:
Upward ratchets do not consume downward reset budget and vice versa. If the market re-anchors upward twice and then reverses downward, the downward re-anchors still have their full reset budget available. This allows two-sided volatility to be fully expressed.
Liquidation Protection
During Discovery Mode, positions receive additional protection from unfair liquidations:
Bounded Liquidation Pause:
If a position's liquidation price lies outside the active discovery bounds, the position cannot be liquidated while those bounds are in effect:
if (liquidation_price > upper_bound OR liquidation_price < lower_bound):
liquidation_status = PAUSED_DURING_DISCOVERY
This prevents market participants from pushing the mark price toward liquidation levels during thin-liquidity discovery periods.
Grace Period on Recovery:
When external markets reopen and Discovery Mode ends, there is a 5-minute grace period during which:
- Mark price resumes using live external data
- Liquidations that were paused due to bound protection are re-evaluated
- No liquidations execute until the grace period expires
This gives traders time to add margin or reduce positions before liquidations resume with normal mark prices.
Discovery Mode Funding
During Discovery Mode, the funding rate formula relaxes to allow larger premiums to persist, encouraging market makers to move the price toward perceived fair value without the arbitrage pressure that exists when external markets are open.
Normal Mode Formula:
funding_rate = premium_index + clamp(interest_rate - premium_index, -0.05%, +0.05%)
Discovery Mode Formula:
discovery_funding_rate = premium_index + clamp(interest_rate - premium_index, -0.50%, +0.50%)
Key Changes:
- Clamp bounds widen from ±0.05% to ±0.50% per interval (10× wider)
- Allows funding to drift up to ±0.50% away from premium to reflect cost-of-carry uncertainty
- Overall cap remains ±4.00% per interval
This relaxation acknowledges that during external market closure, there is no spot-perp arbitrage loop to compress the premium. The wider clamp lets funding reflect genuine long/short sentiment divergence while still bounding the worst-case payment.
Discovery Bounds Parameters
Each market configures Discovery Bounds via the following parameters:
| Parameter | Symbol | Description | Example |
|---|---|---|---|
discovery_mode_enabled | - | Whether this market uses Discovery Mode | true for equities/commodities, false for crypto |
discovery_bound_pct | - | 1/max_leverage, derived from tier | 5.00% for Majors (20×) |
resets_upward | N_up | Maximum upward re-anchors | 2 |
resets_downward | N_down | Maximum downward re-anchors | 2 |
reanchor_threshold | T | Trigger threshold (0-1) | 0.90 (90% of bound distance) |
discovery_funding_clamp | C_disc | Funding clamp bounds during Discovery | ±0.50% |
funding_cap | C_max | Hard funding cap (unchanged) | ±4.00% |
Parameters are set at market listing and can only be changed via governance.
Worked Example: GOOGL/USD-PERP
Consider GOOGL/USD-PERP, a Major-tier equity perpetual with 20× max leverage:
Parameters:
- Max leverage: 20×
- Discovery bound: ±5.00%
- Re-anchor threshold: 90%
- Resets per direction: 2
- Friday closing price (initial reference): $100.00
Discovery Bounds Progression:
| Level | Reference Price | Lower Bound | Upper Bound | Tradeable Range | Upper Trigger | Lower Trigger |
|---|---|---|---|---|---|---|
| 0 (initial) | $100.00 | $95.00 | $105.00 | $95.00–$105.00 | $104.50 | $95.50 |
| 1 (up 1 reset) | $105.00 | $99.75 | $110.25 | $99.75–$110.25 | $109.73 | $100.28 |
| 2 (up 2 resets) | $110.25 | $104.74 | $115.76 | $104.74–$115.76 | N/A (hard cap) | N/A (hard cap) |
Step-by-Step Scenario:
-
Friday 4:00 PM ET: External markets close. Discovery Mode activates with reference price $100.00. The mark price can trade within $95.00–$105.00.
-
Saturday morning: Genuine buying pressure pushes the oracle price toward the upper bound. The mark price reaches $104.50 (the 90% trigger at $100 × 1.045).
-
Re-anchor triggered: The reference price moves to $105.00 (the previous upper bound). Upward reset counter = 1. New tradeable range: $99.75–$110.25.
-
Buying continues: The mark price continues from ~$104.50 with room to rise. It reaches $109.73 (the new trigger at $105 × 1.045).
-
Second re-anchor: The reference price moves to $110.25. Upward reset counter = 2 (exhausted). New tradeable range: $104.74–$115.76.
-
Hard cap: If the mark price reaches $115.76, it hits the hard cap. No further upward movement is permitted until external pricing resumes (Monday 9:30 AM ET).
Maximum Discoverable Range:
With 2 resets and 5% bounds:
Maximum upward: $100.00 × 1.05³ ≈ $115.76 (+15.76% from close)
Maximum downward: $100.00 × 0.95³ ≈ $85.74 (-14.26% from close)
Reversal Scenario:
If after reaching Level 1 ($105.00 reference) the market reverses and drops to $100.28 (the lower trigger), a downward re-anchor occurs:
- Reference price moves to $99.75 (previous lower bound)
- Downward reset counter = 1
- Upward reset counter remains = 1 (independent)
- New tradeable range: $94.76–$104.74
This independence ensures both upward and downward price discovery can occur within their respective budgets.
State Machine
External Market Open
↓
[LIVE] discovery_mode = false
↓ (Friday 4:00 PM ET - market close)
[LIVE] discovery_mode = true
reference_price = last_external_close
resets_upward = 0, resets_downward = 0
↓ (mark_price hits upper_trigger, resets_upward < N_up)
Re-anchor: reference_price ← upper_bound
resets_upward += 1
↓ (resets_upward exhausted, mark_price hits upper_bound)
Hard cap at upper_bound
↓ (Monday 9:30 AM ET - market reopens)
[LIVE] discovery_mode = false
All counters reset
5-minute liquidation grace period
↓
Normal trading resumes
Risk Considerations
For Traders:
- Manage risk based on the maximum possible range (e.g., ±15.76% for the GOOGL example), not just the instantaneous bound (±5%)
- Understand that liquidation protection exists only when the liquidation price is outside active bounds
- Be aware that funding rates can be more volatile during Discovery Mode
For Market Makers:
- The relaxed funding clamp allows larger premiums to persist, reflecting genuine cost-of-carry during closure periods
- Re-anchoring provides a predictable mechanism for the market to drift toward perceived fair value
- Hard caps at max resets provide a clear boundary for worst-case position management
Protocol Safety:
- Maximum leverage-derived bounds align with the margin system's risk tolerance
- Independent reset counters prevent one-sided moves from exhausting protection in both directions
- Liquidation protection bounded by hard caps prevents indefinite suspension of liquidations

