> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kimia.live/llms.txt
> Use this file to discover all available pages before exploring further.

# Markets

> Supported perpetual markets and their parameters.

Every perpetual market is a distinct on-chain `Market` PDA with its own
orderbook, oracle feed, and parameters. A market is identified by
`market_index` (a `u16`) and seeded as `["market", market_index_le]`.

## V1 market

| Market   | `market_index` | Base        | Quote        | Oracle         | Tick size          |
| -------- | -------------- | ----------- | ------------ | -------------- | ------------------ |
| SOL-PERP | 0              | SOL (9-dec) | USDC (6-dec) | Pyth `SOL/USD` | 10,000 (0.01 USDC) |

V1 ships with SOL-PERP only so every integration pattern can be validated
end-to-end before adding assets.

## Market status

A market moves through a small state machine:

```
 Initialized ──► Active ──► Paused ──► Settlement
```

| Status        | Admin can            | Traders can                         |
| ------------- | -------------------- | ----------------------------------- |
| `Initialized` | Set params           |                                     |
| `Active`      | Adjust params, pause | Trade normally                      |
| `Paused`      | Resume, settle       | **Close only**, no new positions    |
| `Settlement`  | Terminal             | Close positions at oracle, withdraw |

The admin is a two-step-transferable pubkey stored on `ExchangeConfig`.

## Market hours

Unlike TradFi futures, Kimia markets are **24/7**. There are no market-open or
market-close procedures. Oracle uptime is guaranteed by Pyth's publisher set,
with 60-second staleness thresholds on-chain.

## Per-market configurable parameters

| Parameter                        | Who sets | Typical                 |
| -------------------------------- | -------- | ----------------------- |
| `initial_margin_ratio`           | admin    | 1000 bps (10× leverage) |
| `maintenance_margin_ratio`       | admin    | 500 bps                 |
| `taker_fee_bps`, `maker_fee_bps` | admin    | 10, 5                   |
| `liquidation_fee_bps`            | admin    | 500                     |
| `funding_period`                 | admin    | 3600 s                  |
| `oracle_staleness_threshold`     | admin    | 60 s                    |
| `oracle_confidence_max_bps`      | admin    | 250 (2.5%)              |
| `tick_size`                      | admin    | market-dependent        |

All of these can be adjusted via `update_market_params` **without** changing
the oracle account. Oracle swaps require a migration.

## Future markets

On the roadmap:

* **BTC-PERP** (once multi-market routing lands)
* **Majors** (ETH, BNB, etc. via Pyth Hermes)
* **On-chain assets** (JUP, JTO, PYTH) at a later phase
* **Isolated markets** with custom margin ratios
