# AFX Docs

## AFX Docs

- [About AFX](https://docs.afx.xyz/about-afx.md)
- [Core contributors](https://docs.afx.xyz/about-afx/core-contributors.md)
- [Deposit](https://docs.afx.xyz/deposit.md): AFX accepts one asset on one network: USDC on Arbitrum. Here is how to get it there from any starting point, and how to avoid the mistakes that trip people up.
- [Trading Rules](https://docs.afx.xyz/trading-rules.md)
- [Supported Assets](https://docs.afx.xyz/trading-rules/supported-assets.md)
- [Leverage](https://docs.afx.xyz/trading-rules/leverage.md)
- [Margin Modes](https://docs.afx.xyz/trading-rules/margin-modes.md)
- [Position Modes](https://docs.afx.xyz/trading-rules/position-modes.md)
- [Order Types](https://docs.afx.xyz/trading-rules/order-types.md)
- [Order Matching](https://docs.afx.xyz/trading-rules/order-matching.md)
- [Slippage](https://docs.afx.xyz/trading-rules/slippage.md)
- [Take profit and stop loss (TP/SL)](https://docs.afx.xyz/trading-rules/take-profit-and-stop-loss-tp-sl.md)
- [Risk Limits](https://docs.afx.xyz/trading-rules/risk-limits.md)
- [Liquidation](https://docs.afx.xyz/trading-rules/liquidation.md)
- [Liquidation Process](https://docs.afx.xyz/trading-rules/liquidation-process.md)
- [ADL](https://docs.afx.xyz/trading-rules/adl.md)
- [Oracle Price](https://docs.afx.xyz/trading-rules/oracle-price.md)
- [Mark Price](https://docs.afx.xyz/trading-rules/mark-price.md)
- [Funding Rate](https://docs.afx.xyz/trading-rules/funding-rate.md)
- [Vaults](https://docs.afx.xyz/vaults.md)
- [LP Vault](https://docs.afx.xyz/vaults/lp-vault.md)
- [User Vaults](https://docs.afx.xyz/vaults/user-vaults.md)
- [Affiliate Program](https://docs.afx.xyz/affiliate-program.md)
- [VIP Program](https://docs.afx.xyz/vip-program.md)
- [Points](https://docs.afx.xyz/points.md)
- [Season 1](https://docs.afx.xyz/points/season-1.md)
- [Testnet Points](https://docs.afx.xyz/points/testnet-points.md)
- [Audits](https://docs.afx.xyz/audits.md)
- [Welcome to AFX Learn](https://docs.afx.xyz/welcome-to-afx-learn.md): Free, plain-English guides on perpetual futures trading: how perps work, how to trade on-chain, funding rates, liquidation, stock and gold perps, and more. Start learning with AFX.
- [What Is a Perpetual DEX? Guide to On-Chain Perpetual Futures](https://docs.afx.xyz/basics/what-is-a-perpetual-dex.md): Learn what a perpetual DEX (perp DEX) is and how on-chain perpetual futures trading works. Explore funding rates, leverage, liquidations, benefits, risks, and self-custody.
- [What Is a Funding Rate? How It Works in Perpetual Futures](https://docs.afx.xyz/basics/what-is-funding-rate.md): Learn how funding rates work in perpetual futures, who pays them, how they affect holding costs, and why their calculation varies by platform.
- [What Is Liquidation in Perpetual Trading? How It Works & How to Avoid It](https://docs.afx.xyz/basics/what-is-liquidation.md): Liquidation is the automatic closure of a leveraged position when your margin falls below the required level. Learn what triggers it, what happens to your funds, and how to avoid it.
- [On-Chain Perps vs CEX Perps: Key Differences Explained (2026) ](https://docs.afx.xyz/basics/on-chain-vs-cex-perps.md): On-chain perps keep your funds in your own wallet; CEX perps hand custody to the exchange. Compare custody, fees, transparency, liquidity, and asset access — and see when each makes sense.
- [Trade Stock Perpetuals On-Chain: A Complete Guide (2026) ](https://docs.afx.xyz/how-to-guides/trade-stock-perpetuals-on-chain.md): Learn how to trade stock perpetuals on-chain. Explore equity perpetual futures, USDC collateral, long and short positions, funding rates, leverage, and liquidation risk.
- [How to Trade Perpetuals On-Chain: A Step-by-Step Guide](https://docs.afx.xyz/how-to-guides/how-to-trade-perpetuals-on-chain-a-step-by-step-guide.md): Learn how to trade perpetual futures on-chain in four steps: connect a self-custody wallet, deposit USDC, choose a market, and open a leveraged position. No account required.
- [How to Trade BTC On-Chain: A Step-by-Step Guide for AFX](https://docs.afx.xyz/how-to-guides/how-to-trade-btc-on-chain.md): Learn how to trade Bitcoin on-chain in 8 steps: deposit USDC on Arbitrum, open a BTC-PERP position on AFX, and withdraw anytime. No CEX, no BTC custody.
- [Bitcoin vs Gold: Which Is the Better Inflation Hedge?](https://docs.afx.xyz/markets-assets/bitcoin-vs-gold-which-is-the-better-inflation-hedge.md): Gold hit an all-time high in early 2026 while Bitcoin pulled back from its peak. We break down how each asset behaves as an inflation hedge — and how to trade both on-chain.
- [SpaceX Perpetuals on AFX (SPCX): Trade SpaceX On-Chain Without Owning Private Shares](https://docs.afx.xyz/markets-assets/spacex-perpetuals-spcx.md): SPCX-PERP on AFX tracks SpaceX's private market valuation. Trade SpaceX exposure on-chain with USDC margin — no accredited investor status, no brokerage required.
- [Crude Oil Perpetuals (CL-PERP) on AFX: Trade WTI On-Chain 24/7](https://docs.afx.xyz/markets-assets/crude-oil-perpetuals-cl.md): CL-PERP lets you trade WTI crude oil on-chain with USDC margin, no expiry, and 24/7 access. Learn how crude oil perpetuals work and how to trade them on AFX.
- [What Is an Inflation Hedge? Definition & Examples (2026)](https://docs.afx.xyz/glossary/inflation-hedge.md): An inflation hedge is an asset that preserves purchasing power when prices rise. Learn how gold and Bitcoin work as inflation hedges and how to trade both on AFX.
- [What Is Oracle Price in Crypto? Definition & How It Works](https://docs.afx.xyz/glossary/oracle-price.md): Oracle price is the external reference price fed into a perpetual DEX to anchor contracts to real-world asset values. Learn how it works on AFX for BTC, gold, oil, and SpaceX.
- [What Is a Perpetual Contract? Definition & How It Works (2026)](https://docs.afx.xyz/glossary/perpetual-contract.md): A perpetual contract is a derivative that tracks an asset's price with no expiry date. Learn how perpetual futures work, funding rates, and how to trade them on AFX.

## API Reference

- [API Reference](https://docs.afx.xyz/api-reference/index.md): Programmatic interface for perpetual contract trading on the AFX DEX.
- [Quick Start](https://docs.afx.xyz/api-reference/quickstart.md): Place your first trade on AFX DEX in 5 minutes.
- [Exchange API](https://docs.afx.xyz/api-reference/exchange.md): Trading operations — place, replace, bracket, and cancel orders; set leverage; manage vaults.
- [Builder Code](https://docs.afx.xyz/api-reference/exchange/builder-code.md)
- [Models](https://docs.afx.xyz/api-reference/exchange/models.md)
- [Info API](https://docs.afx.xyz/api-reference/info.md): Query account, orders, positions, trades, kline, funding rate, and more.
- [Account](https://docs.afx.xyz/api-reference/info/account.md)
- [Orders](https://docs.afx.xyz/api-reference/info/orders.md)
- [Positions](https://docs.afx.xyz/api-reference/info/positions.md)
- [Trades](https://docs.afx.xyz/api-reference/info/trades.md)
- [Products](https://docs.afx.xyz/api-reference/info/products.md)
- [Kline](https://docs.afx.xyz/api-reference/info/kline.md)
- [Funding Rate](https://docs.afx.xyz/api-reference/info/funding-rate.md)
- [Vault](https://docs.afx.xyz/api-reference/info/vault.md)
- [Referral](https://docs.afx.xyz/api-reference/info/referral.md)
- [Explorer](https://docs.afx.xyz/api-reference/info/explorer.md)
- [Models](https://docs.afx.xyz/api-reference/info/models.md)
- [WebSocket](https://docs.afx.xyz/api-reference/websocket.md): Real-time market data and account updates via WebSocket.
- [Connection](https://docs.afx.xyz/api-reference/websocket/connection.md)
- [Market Data](https://docs.afx.xyz/api-reference/websocket/market-data.md)
- [Explorer](https://docs.afx.xyz/api-reference/websocket/explorer.md)
- [User Data](https://docs.afx.xyz/api-reference/websocket/user-data.md)
- [Models](https://docs.afx.xyz/api-reference/websocket/models.md)
- [Signing](https://docs.afx.xyz/api-reference/signing.md): EIP-712 structured signing for Agent and Master wallet operations.
- [Agent Safety](https://docs.afx.xyz/api-reference/agent-safety.md): Operational safety guidance for Master wallets, Agent wallets, and automated trading systems.
- [Python SDK](https://docs.afx.xyz/api-reference/sdk.md): Install the official AFX Python SDK and run examples.
- [Agent Artifacts](https://docs.afx.xyz/api-reference/agent-artifacts.md): Machine-readable files and AI-agent entry points for AFX DEX.

## Announcements

- [System Updates](https://docs.afx.xyz/announcements/system-updates.md)
- [Listings](https://docs.afx.xyz/announcements/listings.md)
- [AFX New Futures Listing - BTCUSDC](https://docs.afx.xyz/announcements/listings/afx-new-futures-listing-btcusdc.md)
- [AFX New Futures Listing - ETHUSDC](https://docs.afx.xyz/announcements/listings/afx-new-futures-listing-ethusdc.md)
- [Delistings](https://docs.afx.xyz/announcements/delistings.md)
- [AFX Futures Delisting - KORUUSDC](https://docs.afx.xyz/announcements/delistings/afx-futures-delisting-koruusdc.md)

## Support

- [Help Center](https://docs.afx.xyz/support/readme.md)


---

# 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, you can query the documentation dynamically by asking a question.
Perform an HTTP GET request on a page URL with the `ask` query parameter:
```
GET https://docs.afx.xyz/about-afx.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.
