> For the complete documentation index, see [llms.txt](https://docs.oisy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.oisy.com/using-oisy-wallet/oisy-trade.md).

# OISY Trade

<figure><img src="/files/vUIGpnoDTyaBvf9E9HkA" alt=""><figcaption></figcaption></figure>

**OISY Trade** lets you trade tokens on a fully onchain order-book exchange, directly from your OISY wallet. Deposited funds are held by the OISY Trade canister on the Internet Computer rather than by a centralized company. But as with any onchain protocol, this comes with smart-contract risk: you're trusting the canister's code, not handing custody to a person or company.

It's a separate way to trade alongside OISY's existing **Swap**: Swap gives you an instant trade at the best price a liquidity pool offers right now. OISY Trade lets you set the price you're willing to trade at and place a limit order — it waits until the market reaches your price (or fills right away if your price already crosses the book).

#### What are limit orders

A limit order says "buy or sell this token at this price or better," instead of trading immediately at whatever the market offers. You choose:

* a **pair** — e.g. ICP priced in ckUSDC (the *base* token is what you're trading, the *quote* token is what the price is measured in)
* a **side** — Buy or Sell
* an **amount** of the base token
* a **price** you're willing to trade at

Your order then rests in the order book until another trader's order matches it, or you cancel it. If your price already crosses the current best price on the book, it fills right away instead of resting — but you're always the one who set the price.

#### How it works, in general

1. **Deposit** a supported token from your OISY wallet into OISY Trade.
2. **Place a limit order** — pick a pair, a side, an amount, and a price.
3. Your order **rests** until it's matched (filled) or you cancel it; you can track its status.
4. **Withdraw** funds back to your OISY wallet any time — you can withdraw whatever isn't currently tied up in an open order.

#### Where to find it in OISY

OISY Trade lives in a **Trading** tab under **Assets**, alongside Tokens, NFTs, and Earning. It has two sections: **My assets** (what you've deposited into OISY Trade, with an "Available" amount showing what isn't reserved by open orders) and **Orders** (Active and History). Balances held in OISY Trade also count toward your total net worth shown in the wallet.

The existing **Swap** button is unaffected — it still opens the regular Swap flow. OISY Trade is entirely separate and reached only through the Trading tab.

**Deposit**

From the Trading tab, **"+ Deposit"** opens a form where you pick one of your wallet tokens that OISY Trade supports and enter an amount. Depositing takes two onchain steps (approve, then deposit), so a small network fee applies before the funds are ready to trade with.

**Withdraw**

Each deposited token has a **Withdraw** link that opens a form pre-filled with that token. Enter how much to withdraw — only your available (free) balance can be withdrawn; anything reserved by an open order can't be, until that order fills or is canceled. A small network fee applies, so what lands back in your wallet is slightly less than what you entered.

**Create a limit order**

From the Trading tab's Orders section, **"+ Limit order"** opens the order form. Choose Buy or Sell, pick the token you're trading and the token you're pricing it in, enter the amount, and set your price — you can use a quick preset relative to the current price, or match the best available price on the book. Review the order (it flags if your price will fill immediately), then place it.

**Cancel a limit order**

Tap any order in your Active list to open its details. From there, **"Cancel order"** is available for any order that hasn't filled yet. Confirming releases the funds that were reserved for it back to your available balance.

***

#### Technical details

*For developers, integrators, and anyone who wants the underlying mechanics.*

**Architecture**

OISY Trade is a separate onchain order-book exchange (a DEX) built on the Internet Computer. It implements a central limit order book (CLOB): all order state, matching, and settlement happen inside a single canister, with an event-sourced state log for auditability. OISY's wallet UI is a client — order matching itself runs entirely inside the DEX canister.

Full technical documentation: <https://dfinity.github.io/oisy-trade/introduction.html>

**Governance & control**

The OISY Trade mainnet canister (`sy2xe-miaaa-aaaar-qb7sq-cai`) lists the **NNS Root** canister as one of its controllers — the same governance root that solely controls the ckBTC Minter, and the same NNS governance that controls the Chain Fusion Signer used elsewhere in OISY. In practice, this means upgrades to the canister that holds deposited funds are expected to go through NNS proposals rather than a single team-held key, the same governance model OISY already relies on for its native-asset signing.

**Deposit-first model & balances**

Tokens must be deposited into the DEX before they can be traded. Depositing requires an ICRC-2 approval on the token's ledger, followed by a `deposit` call to the DEX canister — both steps incur the ledger's standard transfer fee. The DEX tracks balances per user and token as:

* `free` — available for new orders or withdrawal
* `reserved` — locked by open orders

**Order matching & lifecycle**

Placing an order (`add_limit_order`) returns an order ID immediately; the matching engine processes it on its next tick. Orders move through four states: `Pending` (accepted, awaiting matching), `Open` (resting in the book), `Filled` (fully executed), or `Canceled`.

**Trading pairs & order limits**

Each pair defines a base token (what's traded) and a quote token (what the price is denominated in), plus:

* `tick_size` — smallest allowed price increment
* `lot_size` — smallest allowed quantity increment
* `min_notional` / `max_notional` — minimum and maximum order value (price × quantity)

**Fees**

Each pair sets a maker fee and a taker fee, in basis points, deducted from the proceeds at fill time (from the asset the filling side receives). Maker fees apply when an order was already resting and got matched; taker fees apply when an order matched immediately against a resting order. OISY always displays these as a percentage (e.g. "0.20%"), converted from basis points.

**API reference**

For direct canister interaction (CLI or programmatic), see the full method reference and walkthrough: <https://dfinity.github.io/oisy-trade/usage/for-users.html>


---

# 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 that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.oisy.com/using-oisy-wallet/oisy-trade.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
