> For the complete documentation index, see [llms.txt](https://docs.libertyswap.finance/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.libertyswap.finance/liberty-hypermarket/core-architecture.md).

# Core Architecture

Liberty Hypermarket is a front-end built on top of Hyperliquid, specifically its HyperCore execution layer and the HIP-4 event-contract standard. Liberty Hypermarket does not run its own order-matching engine, custody layer, or settlement logic — these are provided by Hyperliquid, and Liberty Hypermarket's role is to present outcome markets to PulseChain-ecosystem users and route their funds and orders into HyperCore.

#### What HIP-4 Event Contracts Are

HIP-4 is Hyperliquid's standard for event contracts — instruments that settle based on the outcome of a real-world event rather than the price of an underlying asset. Each event contract trades as a share priced between $0 and $1:

•       The share price at any time reflects the market's implied probability of the event occurring.

•       At resolution, each share pays $1 if the event occurred, or $0 if it did not.

#### Execution and Settlement

Order matching, pricing, and final settlement of outcome markets happen on HyperCore.

#### Account Model: Perps and Spot Balances

Hyperliquid's account system separates user funds into distinct balance types — commonly referred to as a Perps balance and a Spot balance. Liberty Hypermarket's Portfolio page reflects this underlying account model: when depositing, users choose which balance to fund (see Page 3).
