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

# Sail Rust Integration Guide

> Walkthrough for integrating Sail Exchange Rust Client

<Info>**Prerequisite** You should have installed Rust (version 1.7 or higher).</Info>

In this section we’ll be going over how you can quickly get started with Sail Rust Client, from initializing Sail, to creating your first order.
The Rust Client is the fastest and most secure way to interact with the exchange.

### 1. Install Sail

<CodeGroup>
  ```bash cargo theme={null}
  cargo add sail_exchange
  ```
</CodeGroup>

### 2. Install Fuels

<CodeGroup>
  ```bash cargo theme={null}
  cargo add fuels
  ```
</CodeGroup>

### 3. Create Sail Instance

<CodeGroup>
  ```rust sail.rs theme={null}
      use sail_exchange::{Sail, LimitOrder};
      use fuels::{accounts::fuel_crypto::SecretKey, prelude::*};

      let testnet_provider = Provider::connect("beta-3.fuel.network").await.unwrap();

      // Create the wallet.
      let trading_wallet = WalletUnlocked::new_from_private_key(ENV_PRIVATE_KEY, Some(provider));

      //Build Sail
      let sail = Sail::builder
          .provider(testnet_provider)
          .wallet(trading_wallet)
          .build();
  ```
</CodeGroup>

### 4. Create Order

<CodeGroup>
  ```rust sail.rs theme={null}
      let order = LimitOrder {
          maker: trading_wallet.address(),
          maker_amount: 10,
          taker_amount: 10,
          maker_token: 'ETH',
          taker_token: 'USDC',
      };
      const order = sail.create_order(order)
  ```
</CodeGroup>

### 5. Take Order

<CodeGroup>
  ```rust sail.rs theme={null}
      let order = LimitOrder {
          maker: trading_wallet.address(),
          maker_amount: 10,
          taker_amount: 10,
          maker_token: 'ETH',
          taker_token: 'USDC',
      };
      const order = sail.take_order(order)
  ```
</CodeGroup>

### 6. Match Order

<CodeGroup>
  ```rust sail.rs theme={null}
      let order = LimitOrder {
          maker: trading_wallet.address(),
          maker_amount: 10,
          taker_amount: 10,
          maker_token: 'ETH',
          taker_token: 'USDC',
      };

      let order1 = LimitOrder {
          maker: trading_wallet.address(),
          maker_amount: 10,
          taker_amount: 10,
          maker_token: 'USDC',
          taker_token: 'ETH',
      };
      const order = sail.match_order(order, order1)
  ```
</CodeGroup>

### 7. Cancel Order

```rust sail.rs theme={null}
    let order = LimitOrder {
        maker: trading_wallet.address(),
        maker_amount: 10,
        taker_amount: 10,
        maker_token: 'ETH',
        taker_token: 'USDC',
    };
    const order = sail.cancel_order(order)
```
