> For the complete documentation index, see [llms.txt](https://docs.afx.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.afx.xyz/how-to-guides/how-to-trade-perpetuals-on-chain-a-step-by-step-guide.md).

# How to Trade Perpetuals On-Chain: A Step-by-Step Guide

Trading perpetuals on-chain takes four steps: connect a self-custody wallet, deposit USDC as collateral, choose a market, and open a leveraged long or short position. No email, no account, no KYC required at the protocol level — your funds remain in your control throughout. This guide covers each step, what to watch while a trade is open, and the key risks to understand before you start.

> **Not financial advice (NFA).** Perpetual futures are leveraged products that carry a high risk of loss. Availability may vary by jurisdiction.

### What You Need Before You Start

You only need two things to trade perpetuals on-chain:

1. **A self-custody wallet** — a wallet where you hold your own private keys, such as MetaMask, Rabby, or a hardware wallet. This is your on-chain identity; no separate account is created.
2. **USDC** — the stablecoin used as collateral on most on-chain perp platforms. USDC is what you deposit to open positions and what you receive when you close them.

If you're coming from a centralized exchange, withdraw USDC to your self-custody wallet first. If you're new to self-custody wallets, see [What Is a Perpetual DEX?](/basics/what-is-a-perpetual-dex.md) for background on how on-chain trading differs from a CEX.

### Step 1 — Connect Your Wallet

Navigate to an on-chain perpetuals platform. On [AFX](https://app.afx.xyz/trade), click **"Connect Wallet"** in the top-right corner and select your wallet provider.

Your wallet signs a message to verify ownership — no password is created, no personal data is collected. Once connected, the platform recognizes your wallet address as your account. Every position you open and every dollar of collateral you deposit is tied to that address on-chain.

**What this means in practice:** if you disconnect or switch browsers, your positions don't disappear. Connect the same wallet address from any device and your account state is exactly where you left it.

### Step 2 — Deposit USDC as Collateral

Before opening a trade, you need to deposit USDC into the protocol.

In the trading interface, find the [**Deposit**](https://docs.afx.xyz/deposit) or **Transfer** button and enter the amount of USDC you want to use as margin. You'll be prompted to approve and then confirm a transaction in your wallet — this sends USDC from your wallet to the protocol's smart contract.

A few things to understand at this stage:

* **Your deposited USDC is your total risk capital.** You can only lose what you deposit.
* **Deposits and withdrawals are permissionless.** You can withdraw unused collateral at any time, without waiting for approval.
* **Start small while learning.** You don't need a large amount to begin — small positions let you understand how leverage and funding rates behave before scaling up.

### Step 3 — Choose a Market

Once collateral is deposited, browse the available markets. On AFX, these include:

* **Crypto perpetuals** — [BTC](https://app.afx.xyz/trade/BTCUSDC), [ETH](https://app.afx.xyz/trade/ETHUSDC), [SOL](https://app.afx.xyz/trade/SOLUSDC), and other major tokens
* **Tokenized equity perpetuals** — [MSTR](https://app.afx.xyz/trade/MSTRUSDC), [NVDA](https://app.afx.xyz/trade/NVDAUSDC), [TSLA](https://app.afx.xyz/trade/TSLAUSDC), [AAPL](https://app.afx.xyz/trade/AAPLUSDC) and other stock-linked perps, trading 24/7 with no market-hours restrictions
* **Metal perpetuals** — [XAU](https://app.afx.xyz/trade/XAUUSDC) (gold), [XAG](https://app.afx.xyz/trade/XAGUSDC) (silver), settled in USDC
* **Index perpetuals** — SPX (S\&P 500), giving directional exposure to a broad equity index

Select a market based on what you want exposure to. Each market shows the current **mark price** (used for PnL calculation and liquidation), the **24h change**, and the current **funding rate**.

> On-chain perpetuals don't expire, so you're not choosing a contract month — you're simply opening a position that you can hold for seconds, days, or as long as you choose.

For equity-market exposure, see [How to Trade Stock Perpetuals On-Chain](/how-to-guides/trade-stock-perpetuals-on-chain.md). It explains how stock perps differ from buying shares.

### Step 4 — Set Your Leverage and Open a Position

This is where you define the actual trade.

#### Long or Short?

* **Long** — you profit if the price rises above your entry
* **Short** — you profit if the price falls below your entry

#### Setting Leverage

Leverage determines how much notional exposure you get per dollar of collateral.

* At **1x leverage**: $100 USDC controls $100 of notional exposure
* At **5x leverage**: $100 USDC controls $500 of notional exposure
* At **10x leverage**: $100 USDC controls $1,000 of notional exposure

Higher leverage amplifies both gains **and losses**, and brings your liquidation price closer to your entry. For beginners, starting at 2x–5x gives meaningful exposure while leaving room for price movement before a liquidation threshold is reached.

#### Market vs Limit Orders

* **Market order**: executes immediately at the best available price. Simple, but you may get slight slippage during fast-moving markets.
* **Limit order**: executes only at the price you specify. Useful when you want to enter at a specific level and are willing to wait.

#### Before You Confirm, Check Three Numbers

1. **Margin required** — the USDC that will be locked as collateral for this position
2. **Liquidation price** — the mark price at which your position would be automatically closed and margin lost
3. **Current funding rate** — the periodic payment between longs and shorts (more on this below)

Once satisfied, confirm the order in your wallet and the position opens.

### Managing an Open Position

#### Funding Rate

A funding rate is a small, periodic payment exchanged between long and short traders — typically every few hours — that keeps the perpetual's price anchored to the spot market.

* If funding is **positive**, longs pay shorts.
* If funding is **negative**, shorts pay longs.

Funding accumulates as long as you hold the position. A high positive funding rate in a strongly bullish market can erode a long position's profits over time. See [What Is a Funding Rate?](/basics/what-is-funding-rate.md) for a full explanation.

#### Liquidation Price

Your liquidation price is set the moment you open a trade. If the mark price reaches that level, the protocol automatically closes your position and your deposited margin is taken.

You can **raise** your liquidation threshold by adding more collateral to the position (reducing effective leverage), giving the trade more room to breathe. See [What Is Liquidation?](/basics/what-is-liquidation.md) for more detail.

#### Closing a Position

To close, place an order in the opposite direction of the same size:

* If you're long 0.1 BTC worth of exposure, open a short of 0.1 BTC
* Or use the platform's one-click **Close** button if available

After closing, your realized PnL (profit or loss minus fees and funding paid) is credited back to your collateral balance, which you can withdraw to your wallet at any time.

### Key Risks

Perpetual futures on-chain carry the same directional risks as their centralized equivalents, plus a few that are specific to the on-chain environment:

* **Leverage amplifies losses.** A 10x leveraged position can be liquidated by a 10% adverse price move.
* **Liquidation is permanent.** If your margin is liquidated, it is gone — there is no margin call notice the way a bank would give you.
* **Funding rate drag.** Holding a position in a persistently one-sided market means paying ongoing funding, which erodes returns over time.
* **Smart contract risk.** On-chain protocols depend on smart contracts. While audited platforms reduce this risk, it is never zero. See [AFX's audit reports](https://docs.afx.xyz/audits) for the security reviews covering the bridge contract.
* **Mark price moves.** Your liquidation is based on the mark price (oracle-derived), not the last trade price. In fast markets, the two can diverge briefly.

### Why Trade Perpetuals On-Chain vs a CEX?

On-chain perps add properties that centralized exchanges structurally cannot offer:

|                  | On-Chain Perps                          | CEX Perps                    |
| ---------------- | --------------------------------------- | ---------------------------- |
| **Custody**      | You hold keys until deposit             | Exchange holds your funds    |
| **Account**      | Not required                            | Email + password             |
| **Transparency** | All positions & liquidations on-chain   | Exchange reports only        |
| **Availability** | 24/7 including weekends                 | May have maintenance windows |
| **Asset range**  | Crypto + stock perps + metals + indices | Typically crypto only        |
| **Withdrawal**   | Permissionless, any time                | Subject to platform rules    |

For a deeper comparison, see [On-Chain Perps vs CEX Perps](/basics/on-chain-vs-cex-perps.md).

### FAQ

**How do you trade perpetuals?** Connect a self-custody wallet to an on-chain perp platform, deposit USDC as margin, select a market, set your leverage and direction (long or short), and submit an order. Your position stays open until you close it or it's liquidated.

**Is perp trading risky?** Yes — particularly with leverage. A leveraged position can lose its entire collateral if the market moves far enough against you. Funding rates can also add ongoing costs to a position held for extended periods. Treat perpetuals as high-risk instruments and only use capital you can afford to lose entirely. (NFA)

**Why trade perps instead of spot?** Perpetuals let you go short (profit when price falls), use leverage to amplify exposure without borrowing tokens, and trade assets like gold or stock-linked perps that have no spot equivalent on-chain. Spot trading only lets you profit when price rises, requires holding the underlying token, and offers no leverage.

**Is $5,000 enough to trade futures on-chain?** Position size requirements depend on the platform and the market, but many on-chain perp platforms have no stated minimum deposit. Smaller amounts are workable at low leverage. That said, the right position size depends on your risk tolerance, leverage level, and how much margin you're comfortable having liquidated — consult a financial professional for advice tailored to your situation. (NFA)

***

### Related guides

* [What Is a Perpetual DEX?](/basics/what-is-a-perpetual-dex.md) — understand the protocol mechanics behind on-chain perps.
* [How to Trade Stock Perpetuals On-Chain](/how-to-guides/trade-stock-perpetuals-on-chain.md) — learn how equity perps differ from buying shares.

**Ready to trade?** [Open AFX →](https://app.afx.xyz/trade) *(NFA — perpetual futures carry a high risk of loss. Availability varies by jurisdiction.)*


---

# 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://docs.afx.xyz/how-to-guides/how-to-trade-perpetuals-on-chain-a-step-by-step-guide.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.
