# A walkthrough trade

Let's follow Alice through a complete trade so you can see the whole flow before we dive into mechanics.

#### 1. Alice connects her wallet

Alice visits the MoveX app and connects her wallet (we use RainbowKit, so MetaMask, Rabby, WalletConnect, and dozens of others work out of the box). MoveX never sees her private key.

#### 2. Alice deposits collateral

Alice has 1,000 USDC in her wallet. She clicks **Deposit**, signs an `approve` transaction (allowing the Hub contract to spend her USDC), then signs a `deposit` transaction (moving the USDC into the Hub).

Now her on-chain account at MoveX has 1,000 USDC of **available** collateral. Her wallet shows 0 USDC.

{% hint style="success" %}
**MoveX is non-custodial.** Your collateral lives in a smart contract that only your signed messages can move. MoveX operators cannot withdraw your funds.
{% endhint %}

#### 3. Alice places an order

The market is `BTC-MOVE-WEEKLY`. The current mark price is **$2,400** (meaning the market is implying BTC will move about $2,400 by the end of the week).

Alice thinks the move will be bigger, she's long volatility. She wants to **buy $300 of notional** at the best available ask, with **2x leverage**.

She fills in the form:

* **Side:** Buy
* **Notional:** $300
* **Leverage:** 2×
* **Order type:** Market (immediate)

The interface tells her: *collateral required: $150* (notional ÷ leverage).

She clicks **Place order**. Her wallet pops up to sign an **EIP-712 intent;** a structured message authorizing the trade. She signs.

#### 4. The sequencer matches the order

The intent travels to MoveX's off-chain **sequencer**. The sequencer:

1. Verifies Alice's signature.
2. Checks she has enough collateral.
3. Walks the order book and finds matching resting sell orders.
4. Executes the match according to price-time priority.
5. Sends the resulting fills to the on-chain `BatchSettler` contract.

#### 5. On-chain settlement

The `BatchSettler` calls `settleTrade` on the `BTC-MOVE-WEEKLY` Market contract, atomically for Alice and each of her counterparties. The contract:

* Verifies Alice's intent signature against the on-chain `IntentVerifier`.
* Locks $150 of Alice's collateral as margin.
* Records her position: **long, $300 notional, entry $2,400, 2× leverage**.
* Does the symmetric bookkeeping for the makers on the other side.

Once the transaction confirms, Alice has an open position visible in the app.

#### 6. The market moves

A week passes. BTC opened the epoch at $60,000 and closes at $54,800; a $5,200 move down. The MOVE settlement price is $5,200, well above Alice's $2,400 entry.

#### 7. Alice claims

The keeper service calls `settleEpoch` on the Market contract. The contract freezes positions at the settlement price of $5,200.

Alice opens the app and clicks **Claim** on her position. Her on-chain PnL is approximately:

```
pnl = (5200 − 2400) × ($300 / $2400) = $350
```

She walks away with her **$150 collateral + $350 profit = $500**, deposited back into her available balance. From there she can deposit it into a new position or withdraw it back to her wallet.

That's the full lifecycle, end to end. Now let's see what's actually happening underneath.

***


---

# Agent Instructions: 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:

```
GET https://docs.movex.market/about-movex/a-walkthrough-trade.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
