# Trade on Bonfida

Serum (SRM) is a decentralized exchange (DEX) that is built on the Solana blockchain and is completely permissionless.  Serum is open-source and allows for unprecedented speed and low transaction costs to decentralized finance. Experience is similar with trading with a centralized exchange (CEX), but with a few caveats. We will guide you between a few examples of trades on Serum DEX.

Anyone can set up their own Serum-based DEX GUI or embed the Serum Swapper into their UI. For this example we will be using [Bonfida DEX](https://dex.bonfida.org/#/market/ByRys5tuUWDgL73G8JBAEfkdFf8JWBzPBDHsBVQ5vbQA). You can see a list of available GUI [**HERE**](https://docs.projectserum.com/serum-ecosystem/trading-on-serum/trading-guis)

{% hint style="info" %}
You need a SPL wallet and enough SOL for transactions fees. Try to keep it above 0.1 SOL at all times.
{% endhint %}

![Bonfida DEX](/files/-MktftRqIWfgG6duEf7_)

**Step 1: Connecting your wallet**\
&#x20;\
The first difference you will notice is the need to connect your wallet and approve transactions. Every interaction with the dex will need your approval to proceed.\
\
Most sites will have multiple wallets available, you can see a list of our recommended wallets [**HERE**](https://docs.projectserum.com/guides/getting-started/wallet-support/wallet-support-serum-academy)

{% hint style="info" %}
When connecting your wallet you will have the option to automatically approve transactions from the GUI, you won't be able to read the instructions given, but it will skip a few steps like settling depending on the wallet being used.
{% endhint %}

![Wallets available on Bonfida](/files/-Mktg7Tjnt4mgGcIhhBM)

**Step 2: Check your balances**\
\
Once connected you will be able to see your available balances of that pair on the left side of the page.

* **Token account:** Your address of that token, if you have multiples you can select which one from the drop down menu.
* **Wallet Balance:** The funds available on your wallet.
* **Unsettled Balances:** Funds on the intermediary wallet that interacts between you and the DEX, be an order filled or canceled the funds will need to be settled back to your wallet.
* **Deposit Button:** Will show you a window with the token address to send funds to if needed, same as your wallet.
* **Settle Button:** Will transfer your funds from the intermediary wallet to your token address.

![Your token balances for the SRM/USDC pair](/files/-MktgEo03zsx-sOCWN9V)

**Step 3: Make an order**\
\
Similar to a CEX you will be able to create Buy and Sell orders. As an example, a sell order of 2.5 SRM at a price of 8 USDC for a total of 20 USDC will be created:

{% hint style="info" %}
You can populate the fields directly by clicking directly on the orderbook
{% endhint %}

![](/files/-MktgIyPzTDU9QjyHAoC)

{% hint style="info" %}
Similar to a CEX, on POST only orders your order will not be allowed to take, if it would cross the book it will be canceled instead. IOC orders that would not immediately trade will be canceled.
{% endhint %}

\
At this point **your funds are no longer in your wallet** and will now appear as open orders on the DEX. If the order was to be filled, your funds will be on the intermediary wallet as "unsettled balances" until you settle it back to your wallet.

![](/files/-MktjJp5KzEIm4R-NPGJ)

**Step 4: Settling your orders**\
\
Once filled or canceled your funds will show as unsettled balances. For this example the order will be  canceled to show how it looks:

![2.5 SRM as unsettled balances once the order was canceled](/files/-MktgU-lMqnwSf4AONDB)

If wanted to finish your trades here, one could use the settle button to recover the funds from the intermediary wallet. For this example the order will be remade so that it gets immediately filled. As the funds are already on the intermediary account **no funds will leave your wallet.** In case the order was changed to 3 SRM it will need at least 0.5 available and those **will leave your wallet** when the order is created.

![2.5 SRM at a price of 7.45 USDC](/files/-MkthEuBKYj0vNH1f-wJ)

{% hint style="info" %}
**The order will start at the best ask/bid and move up the orderbook until the order is filled. Leftovers at your price will open an order.**
{% endhint %}

Order was filled immediately, so USDC was received and appears as unsettled balances:

![](/files/-MkthMzBPdAg9pmiRX_p)

Now that all trades are done you can settle them back to your wallet

![](/files/-MkthWZ5uYJDysBhTEVv)

{% hint style="info" %}
If a market pair isn't officially listed on the GUI you must [add it as a custom market](https://docs.projectserum.com/serum-ecosystem/building-on-our-vision/add-a-market-on-serum-serum-academy)
{% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.projectserum.com/guides/trade-on-serum-dex/trade-serum-academy/trade-on-bonfida.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
