Skip to main content

5.1 Purpose of Market Resolution

Parallelshots markets are perpetual instruments with no expiration event. As a result, price convergence must be enforced continuously through protocol mechanics rather than terminal settlement. The funding mechanism is the primary tool used to align the perpetual market price with the external reference price over time. Market resolution is implemented as a discrete, scheduled state transition that redistributes value between counterparties based on relative pricing imbalance. Funding does not mint or destroy value; it reallocates existing margin between long and short positions.

5.2 Price Inputs

Each market m maintains the following canonical price variables:
P_spot[m]    := oracle_reference_price(m)
P_perp[m]    := mark_price_from_orderbook(m)
price_diff  := P_perp[m] - P_spot[m]
price_ratio := price_diff / P_spot[m]
Where:
  • oracle_reference_price is computed from a bounded, weighted oracle set
  • mark_price_from_orderbook reflects executable mid-market conditions

5.3 Funding Rate Computation (Formalized)

Funding is computed at discrete intervals defined per market.
Inputs:
  alpha[m]        : funding sensitivity coefficient
  P_spot[m]       : spot reference price
  P_perp[m]       : perpetual mark price

Derived:
  price_ratio     = (P_perp[m] - P_spot[m]) / P_spot[m]

FundingRate[m] :=
  alpha[m] * price_ratio
Funding direction is inferred implicitly:
if FundingRate[m] > 0:
    longs_pay_shorts
else if FundingRate[m] < 0:
    shorts_pay_longs
else:
    no_transfer

5.4 Position-Level Funding Application

For each open position i in market m:
PositionNotional[i] :=
  abs(position_size[i]) * P_perp[m]

FundingPayment[i] :=
  PositionNotional[i] * FundingRate[m]
Balance updates are applied as:
if position_side[i] == LONG:
    margin[i] -= FundingPayment[i]
else if position_side[i] == SHORT:
    margin[i] += FundingPayment[i]
Net system collateral remains invariant:
Σ FundingPayment_longs == Σ FundingPayment_shorts

5.5 Creator-Defined Funding Cadence

Each market specifies a funding interval:
FundingInterval[m] ∈ {300s, 600s, 1200s, ...}
Funding execution eligibility:
if block.timestamp - lastFundingTimestamp[m] ≥ FundingInterval[m]:
    applyFunding(m)
Market creators prepay protocol execution fees proportional to:
FundingCost[m] ∝ 1 / FundingInterval[m]
This explicitly prices convergence quality.

5.6 On-Chain Execution Hook

Funding is executed atomically via a privileged protocol call:
function applyFunding(uint32 marketId) external onlyKeeper {
    FundingRate rate = computeFundingRate(marketId);
    applyFundingToAllPositions(marketId, rate);
    lastFundingTimestamp[marketId] = block.timestamp;
}

5.7 Safety Constraints

Funding execution is gated by oracle validity checks:
require(
  abs(price_ratio) ≤ maxOracleDeviation,
  "ORACLE_OUT_OF_BOUNDS"
)
If violated:
  • Funding is skipped
  • Trading continues
  • Liquidation logic remains active