> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/drift-labs/protocol-v2/llms.txt
> Use this file to discover all available pages before exploring further.

# Trading Instructions

> Trading operation instructions in Drift Protocol

Trading instructions handle order placement, modification, and cancellation.

## Core Instructions

### place\_perp\_order

Places a perpetual futures order.

```rust theme={null}
pub fn place_perp_order(
    ctx: Context<PlaceOrder>,
    params: OrderParams,
) -> Result<()>
```

<ParamField path="params" type="OrderParams" required>
  Order parameters including price, size, type, and conditions
</ParamField>

### cancel\_order

Cancels an existing order.

```rust theme={null}
pub fn cancel_order(
    ctx: Context<CancelOrder>,
    order_id: Option<u32>,
) -> Result<()>
```

### modify\_order

Modifies an existing order.

```rust theme={null}
pub fn modify_order(
    ctx: Context<CancelOrder>,
    order_id: Option<u32>,
    modify_order_params: ModifyOrderParams,
) -> Result<()>
```

### place\_and\_take\_perp\_order

Places an order and immediately attempts to fill it.

```rust theme={null}
pub fn place_and_take_perp_order(
    ctx: Context<PlaceAndTake>,
    params: OrderParams,
    success_condition: Option<u32>,
) -> Result<()>
```

## SDK Usage

<CardGroup cols={2}>
  <Card title="Placing Orders" href="/guides/placing-orders">
    Order placement guide
  </Card>

  <Card title="Order Params API" href="/api/trading/order-params">
    Order parameter reference
  </Card>
</CardGroup>
