> ## Documentation Index
> Fetch the complete documentation index at: https://docs-d0.donutbrowser.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Perpetual Futures Trading

> Open longs and shorts, manage margin, and set limit orders. The entire perps workflow happens in chat, without opening an exchange interface.

## The Scenario

You want to trade crypto with leverage. Maybe you're bullish on BTC and want to go 10x long, or you see a bearish setup forming on ETH and want to short it with 5x. Normally that means logging into an exchange, working through the margin settings, switching between position tabs and order entry screens, and watching your margin balance to avoid liquidation.

With D0 you do all of it in one conversation: fund the account, place orders, check positions, close trades.

Jump in: *Show me the BTCUSDT perps contract info*, *What's my perps balance?*, or *Open a 10x long on BTC with 0.01 BTC*.

## Complete Perps Workflow

### Step 1: Check the Contract Specs

Before you trade, check the minimum size and max leverage for the pair you want.

> **You:** "Show me the BTCUSDT perps contract info"

> **D0:** "BTCUSDT Contract Info:\
>
> Min quantity: 0.001 BTC\
>
> Max leverage: 50x\
>
> Tick size: 0.1 USDT\
>
> Maker fee: 0.02%\
>
> Taker fee: 0.06%"

Now you know you can trade as small as 0.001 BTC and use up to 50x leverage if you want (though you probably shouldn't max that out).

### Step 2: Check Your Perps Balance

> **You:** "What's my perps balance?"

> **D0:** "Perps Account:\
>
> Equity: \$5,200\
>
> Available balance: \$3,800\
>
> Margin used: \$1,400\
>
> Unrealized PnL: +\$121.00"

You've got \$3,800 available to use. The rest is locked up as margin on your current positions.

### Step 3: Fund Your Account (if needed)

If your perps account is empty or you want to add more capital, you need to deposit from your wallet and transfer it into your trading sub-account.

> **You:** "Deposit 1000 USDT to my perps account"

> **D0:** "Deposit complete! 1,000 USDT deposited to your main perps account."

> **You:** "Transfer 1000 to my trading sub-account"

> **D0:** "Transfer complete! 1,000 USDT moved from main account to trading sub-account. Your sub-account balance is now \$1,000."

The fund flow goes: Wallet → Main Account → Sub-Account → Trading. Your sub-account gets created automatically the first time you place an order, so you don't need to set it up manually.

### Step 4: Place a Trade

#### Market Order (instant execution)

Market orders execute immediately at the current price.

> **You:** "Open a 10x long on BTC with 0.01 BTC"

> **D0:** "Order placed!\
>
> Symbol: BTCUSDT\
>
> Side: BUY (Long)\
>
> Type: MARKET\
>
> Quantity: 0.01 BTC\
>
> Leverage: 10x\
>
> Entry price: \$98,450\
>
> Position value: \$984.50\
>
> Margin required: \$98.45"

You're now long 0.01 BTC with 10x leverage. Your position is worth \$984.50, but you only put up \$98.45 as margin. The rest is borrowed.

#### Limit Order (execute at target price)

Limit orders wait for your target price to hit before executing.

> **You:** "Place a limit buy for 0.01 BTC at \$96,000 with 10x leverage"

> **D0:** "Limit order placed!\
>
> Symbol: BTCUSDT\
>
> Side: BUY\
>
> Type: LIMIT\
>
> Price: \$96,000\
>
> Quantity: 0.01 BTC\
>
> Leverage: 10x\
>
> Order will fill when BTC reaches \$96,000."

Your order sits there until BTC drops to \$96,000. When it hits, D0 executes the trade for you.

### Step 5: Monitor Your Positions

> **You:** "Show my positions"

> **D0:** "Your open positions:"

| Symbol | Side | Size | Entry | Mark | PnL | Lev |
| - | - | - | - | - | - | - |
| BTCUSDT | LONG | 0.01 | \$98,450 | \$99,100 | +\$6.50 | 10x |
| SOLUSDT | LONG | 10 | \$138.50 | \$142.35 | +\$38.50 | 5x |

> Total Unrealized PnL: +\$45.00

You're up on both positions. BTC moved from \$98,450 to \$99,100, netting you \$6.50 with 10x leverage. SOL moved from \$138.50 to \$142.35, giving you \$38.50 with 5x leverage.

### Step 6: Check Your Open Orders

> **You:** "Show my open orders"

> **D0:** "Your open orders:"

| Symbol | Side | Type | Price | Qty | Status |
| - | - | - | - | - | - |
| BTCUSDT | BUY | LIMIT | \$96,000 | 0.01 | Open |

> You have 1 open order.

Your limit buy at \$96,000 is still waiting. It hasn't filled yet because BTC hasn't dropped to that level.

### Step 7: Close a Position

When you're ready to exit, tell D0 to close the position. It uses a reduce-only order so you don't accidentally flip to the opposite side.

> **You:** "Close my BTC long position"

> **D0:** "Closing position: SELL MARKET 0.01 BTCUSDT (reduce-only)\
>
> Exit price: \$99,100\
>
> Realized PnL: +\$6.50\
>
> Position closed!"

You locked in the profit. Your realized PnL is now +\$6.50.

### Step 8: Withdraw Your Profits

To get funds back to your wallet, transfer from sub-account to main account, then withdraw.

> **You:** "Transfer out 500 from sub-account and withdraw"

> **D0:** "Transfer complete: 500 USDT moved from sub-account to main account."

> **You:** "Withdraw 500 from perps"

> **D0:** "Withdrawal complete: 500 USDT returned to your wallet."

The \$500 is back in your wallet now.

## Common Trading Scenarios

### Scenario 1: Bullish Momentum Trade

You see BTC breaking out and want to ride the move.

1. "Show me BTC funding rates and open interest" to check whether the market is already overleveraged
2. "What's the BTC technical analysis?" to confirm the breakout is supported by indicators
3. "Open a 5x long on BTC with 0.005 BTC" to enter with moderate leverage
4. "Alert me when BTC hits \$100,000" to set a take-profit alert
5. "Show my positions" to monitor throughout the day

### Scenario 2: Hedging a Spot Position

You hold SOL in your wallet and you're worried about downside. You don't want to sell your spot, but you want protection.

1. "What's my wallet balance?" to see how much SOL you hold
2. "Open a 2x short on SOL with 10 SOL" to hedge your spot exposure
3. "Show my perps positions" to verify the hedge is active
4. "Close my SOL short" to remove the hedge when you're confident again

### Scenario 3: Range Trading

BTC is bouncing between support and resistance in a clear range. You can trade both sides.

1. Send a chart screenshot to identify the range (\$96K to \$99K)
2. "Place a limit buy for 0.01 BTC at \$96,200 with 5x leverage" to buy at support
3. "Place a limit sell for 0.01 BTC at \$98,800 with 5x leverage" to sell at resistance
4. "Show my open orders" to monitor both orders

## Key Concepts

### Fund Flow

![Fund flow: Wallet, deposit to the main account, transfer in to a sub-account, trade. Withdrawals go the other way.](https://mintcdn.com/donut-6b37471f/CzrLFvWZwo-Q_Uom/media/use-cases/perps-trading/fund-flow-light.png?fit=max\&auto=format\&n=CzrLFvWZwo-Q_Uom\&q=85\&s=7c3b2e06c7ec9a08bb857f5801c596b5)

### Symbol Format

Always use `BTCUSDT`, `ETHUSDT`, `SOLUSDT` (base token + USDT). If you just say "BTC", D0 will ask you to clarify. In the console the same markets appear as BTC-USDT, ETH-USDT, SOL-USDT.

### Two-Step Funding

**Deposit** moves funds from your wallet to the main account. **Transfer** moves funds from main account to your trading sub-account. You need both steps to actually trade.

### Reduce-Only Orders

When you close a position, D0 uses reduce-only orders so you don't accidentally flip to the opposite side. If you're long and you close, it won't open a short by mistake.

## Tips for Trading Perps

* Check the contract specs first, so you know the minimum quantity and max leverage before placing orders.
* Start with lower leverage, 5x or less, while you're learning. High leverage magnifies both gains and losses.
* Watch your margin usage. If your available balance gets too low, you risk liquidation.
* Use limit orders for better entries. Market orders fill instantly at whatever price is available; limit orders let you wait for the price you want.
* Check funding rates. Positive funding means longs pay shorts every 8 hours, so factor that into your hold time.
* Set price alerts at the levels you care about and pair them with your perps plan.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.