> For the complete documentation index, see [llms.txt](https://doc.ave.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.ave.ai/ave-ai-perp-dex/on-chain-perpetual-dex-perp-dex.md).

# On-Chain Perpetual DEX (Perp DEX)

The on-chain perpetual ecosystem is rapidly evolving. Ave AI is *delivering CEX-level performance with on-chain transparency and capital efficiency.*

**Perp Trading Flow on DEX**

1. Connect wallet (e.g., Phantom, OKX Wallet)
2. Select asset (BTC, ETH, etc.) and leverage
3. Deposit margin → system calculates max position size and risk
4. Open position (long/short)
5. Funding rate settlement (based on perp vs. spot price)
6. Manage position: close, add margin, or get liquidated
7. PnL settlement → funds returned to wallet

***

**DEX vs. CEX Comparison**

* **Custody**&#x20;

CEX: assets held by platform&#x20;

DEX: non-custodial, wallet-based

* **Transparency**&#x20;

DEX: positions and risk mechanisms are verifiable

* **Trading Model**&#x20;

DEX: AMM / hybrid / on-chain order book&#x20;

CEX: centralized matching engine

* **Liquidity & Cost**&#x20;

CEX: deeper liquidity, lower slippage&#x20;

DEX: trustless but may face liquidity constraints

* **Risk Profile**&#x20;

CEX: platform and regulatory risk&#x20;

DEX: smart contract, oracle, and liquidation risks

***

**Risk Management Guidelines**

* **Manage Margin Carefully:** Ensure sufficient collateral to avoid forced liquidation
* **Monitor Funding Rates:** Persistent unfavorable funding can erode profits
* **Choose Strong Platforms:** Look for deep liquidity, robust liquidation systems, and reliable oracles
* **Control Leverage:** Higher leverage ≠ better returns; use stop-loss and position sizing
* **Account for On-Chain Costs:** Gas fees, slippage, and execution delays can impact outcomes
* **Review Protocol Security:** Prefer audited, transparent protocols with strong track records
