> For the complete documentation index, see [llms.txt](https://learn.trovemarkets.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.trovemarkets.com/trove-x-polymarkets/keeping-prices-bounded-0-1.md).

# Keeping Prices Bounded (0-1)

A perpetual market can *trade* at any price if someone places an order there.

So it’s important to distinguish between:

* **Trade price:** what someone can place on the orderbook (not strictly bounded by protocol)
* **Mark / Index price:** what drives funding, margin, and settlement mechanics (controllable via HIP-3 oracle ops)

Trove’s goal is:

> Keep the **mark/index** price meaningfully bounded within `[0, 1]` so the market behaves like a probability.

***

### What HIP-3 lets a deployer control

HIP-3 deployers can update:

* `oraclePxs` (oracle/index input)
* `markPxs` (mark updates)
* `externalPerpPxs` (external reference used to prevent sudden mark deviations)

These are submitted via the HIP-3 `setOracle` action.

Important operational constraints include:

* calls must be spaced by at least \~2.5 seconds
* deployers are expected to update roughly every \~3 seconds even if no changes
* mark updates are rate-limited/clamped (e.g., 1% step clamps)

***

### Approach for probability markets on HIP-3

#### Step 1: Keep oracle/index bounded

Define:

* `oraclePx = clamp(p_ref, 0, 1)`

This ensures the “fundamental” reference is always within `[0, 1]`.

#### Step 2: Force mark updates to stay bounded (even if local trading deviates)

Hyperliquid updates mark price using the **median** of:

* deployer-provided mark price inputs, and
* the local mark price (derived from best bid/ask/last trade)

To keep the median bounded, provide **two bounded mark price inputs**:

* `mark_source_1 = clamp(p_ref, 0, 1)`
* `mark_source_2 = clamp(EMA(p_ref), 0, 1)`

With two bounded values and one local value:

* even if local mark prints above 1, the median remains ≤ 1
* even if local mark prints below 0, the median remains ≥ 0

#### Step 3: Bound the external reference

Set:

* `externalPerpPx = clamp(EMA(p_ref), 0, 1)`

This helps limit sudden deviations and keeps the system anchored.

***

### What this does and does not guarantee

#### Guarantees (what Trove can make true)

* **oracle/index inputs** remain within `[0, 1]`
* **deployer mark inputs** remain within `[0, 1]`
* the resulting **mark** is strongly biased to remain within `[0, 1]`

#### Non-guarantees (protocol reality)

* Someone can still place a limit order at 1.20 and match it if a counterparty accepts.
* Trove can prevent this **in Trove UI**, but cannot stop all third-party API usage.

***

### UI guardrails (recommended)

To preserve probability semantics for users:

* Trove UI should restrict order price input to `[0, 1]`
* UI should display price as `0% – 100%`
* UI should clearly label this as a “probability-style perp” with bounded mark/index

***

### Risk parameters

* Conservative **max leverage** and margin tables for binary markets
* Tight **open interest caps** while liquidity is bootstrapping
* Funding multipliers calibrated so prolonged divergence becomes expensive


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://learn.trovemarkets.com/trove-x-polymarkets/keeping-prices-bounded-0-1.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
