---
title: Oracle and risk engine
description: "How HardBasis forms the price a fill is quoted against, and how margin and liquidation are enforced. Methodology wording follows counsel."
---

# Oracle and risk engine

Every price on HardBasis starts from an external oracle, and every position is
held to margin rules the engine enforces on its own. This page will carry the
methodology in full; the sections marked below wait on counsel's review, and
the rules already published are linked where they live.

## The index price

Fills are priced from the oracle mid, moved against the trader by a spread and
a skew term and never better than mid plus spread. The formula is on
[Trading and fees](/trading).

<Gated label="COUNSEL-GATED: index constituents, weights, and staleness removal">

Which sources make up the index, how they are weighted, and how a stale source
is removed follow counsel's review.

</Gated>

## Halts and manual settlement

Withdrawals of free balance work in every halt mode.

<Gated label="COUNSEL-GATED: the halt rule, the manual settlement rule, and change notice">

When trading halts, how a market would be settled by hand, and how much notice
a methodology change gets follow counsel's review.

</Gated>

## Margin and liquidation

Initial margin, maintenance margin and the liquidation trigger are published
with their current figures on [Trading and fees](/trading#margin-leverage-and-liquidation),
and explained step by step in [How to trade perps](/learn/how-to-trade-perps).

<Gated label="COUNSEL-GATED: insurance fund, socialised loss policy, and their history">

Whether an insurance fund exists, the policy for losses beyond a position's
margin, and any history of either follow counsel's review.

</Gated>
