# The Decentralized Counterparty Exchange (DEx)

This tutorial takes you through the process of buying and consequently selling a Counterparty-issued asset (or token/coin) from Freewallet. \
\ <mark style="color:yellow;">By "Counterparty-issued" we mean "issued on the Counterparty platform by its users" as the Counterparty Project does not issue assets (XCP is the only asset that was issued by the Project).</mark>

First, let's summarize how things work:

All Counterparty assets can be traded on the Counterparty Decentralized Exchange and most Freewallet sellers denominate their asset in XCP. It is possible also to sell your asset A for another asset B using the Counterparty Decentralized Exchange. Some main advantages of decentralized crypto-exchanges are obviously decentralization (no counterparty risk) and a lower cost of filled orders.

Some popular Counterparty-listed assets (such as PEPECASH and XCP) are available on traditional crypto-exchanges such as [Zaif](https://zaif.jp/) and [DexTrade](https://dex-trade.com/) where they are usually available denominated in BTC. <mark style="color:red;">Those are entirely different than the Counterparty DEx and are centralized exchanges.</mark>\
\
This article covers only the DEx as seen in Freewallet, but just so that you know the same asset can be traded on the DEx (usually denominated in XCP) and externally (usually denominated in BTC). Some advantages of centralized crypto-exchanges may include the speed of trading and may or may not have a better liquidity.

It is possible to trade on the Counterparty decentralized exchange directly inside Freewallet. You can trade any token against any other token, including XCP.

Please also check out this [informative overview video](https://www.youtube.com/watch?v=4fEnNU4iUrg) by RobotLoveCoffee for a generalized understanding of how the Counterparty DEx works and how to navigate it.

{% embed url="<https://www.youtube.com/watch?v=4fEnNU4iUrg>" %}

The Exchange tab first shows “BTC” pairs which to be filled will have to use the BTCpay function as described in detail in the section titled: [Understanding BTCpay and the BTC/TOKEN on the DEx](/freewallet.io-user-manual/exploring-balances-history-exchange-and-dispensers/understanding-btcpay-and-btc-token-on-the-dex.md)

Keep in mind most users who see these exchange types assume it is the same as other BTC markets on other exchanges or decentralized markets. <mark style="color:red;">They are not the same</mark> and function very differently as this BTCpay function is a very historic and old functionality that requires some deep technical knowledge of how this works.\
\ <mark style="color:yellow;">These pairs are denoted with the BTC/TOKEN or TOKEN/BTC pairs and DO NOT function the same as all other pairs (XCP/TOKEN, and TOKEN1/TOKEN2 pairs)</mark> and are NOT the same functionality like Dispensers are.

<figure><img src="/files/8Fx1j43rKsNM13w50vI9" alt=""><figcaption><p>BTC/TOKEN markets page on Freewallet (which use different functionality than the XCP pairs and other Token markets)</p></figcaption></figure>

The next tab is the <mark style="color:green;">XCP tab</mark> which shows all Counterparty DEx orders with the XCP/TOKEN or TOKEN/XCP pairs. \
\
These (and rest of the markets) are not BTCpay markets because they do not trade with BTC as one of the tokens in the market pair and these Counterparty Token Pairs function much differently and <mark style="color:green;">are more commonly used than BTC pairs by the community</mark>.

You can also explore popular pairs like BITCRYSTALS, PEPECASH, WILLCOIN and other pairs in the market which are considered TOKEN/TOKEN1 or TOKEN1/TOKEN pairs.

You can also use the Search bar in the upper right to find open markets of any Counterparty asset (including XCP)

<figure><img src="/files/SGXdpssv4i7ZobIXoPnL" alt=""><figcaption><p>The XCP market pairs as shown on Freewallet Exchange tab</p></figcaption></figure>

If you would like to make your own custom Market tab and track sales from any Counterparty asset, simply click the “Gear Wheel” icon next to the search bar and select “Add Market”

You can also customize your viewing options to include or exclude Named, Subasset and Numeric tokens

<figure><img src="/files/wGSottbXdIaPmihiFw8j" alt=""><figcaption><p>Filtering Settings Tab for Exchange Markets as well as Refresh and Add Market buttons</p></figcaption></figure>

Here you can add the Token name of the Market you wish to track and it will appear as a new Markets tab

<figure><img src="/files/otq9MPeivouvh3AxIlSX" alt=""><figcaption><p>The Add Market Feature to track any Token the user chooses to add</p></figcaption></figure>

<mark style="color:yellow;">Remember you can always manually search a Market with the search function in the upper left. This is the same search function on Tokenscan and the data shown is the same.</mark>\
\
This is the easiest way to explore a market pair of any type.

<figure><img src="/files/nIKCl7fWY2Sf37qjK9y8" alt=""><figcaption><p>If you would like to find a market for a card or a pair that has no order history yet, simply manually type the pair into the search bar.</p></figcaption></figure>

To learn how to use, trade and create orders on the DEx please reference the [Buying and Selling XCP and Tokens on the DEx](/freewallet.io-user-manual/exploring-balances-history-exchange-and-dispensers/buying-and-selling-xcp-and-tokens-on-the-dex.md) section of this User Manual.

You can also start new exchange pairs if no orders have been put up for it by referencing [Starting an Exchange Pair with No Order History](/freewallet.io-user-manual/freewallet-functions/starting-an-exchange-pair-that-has-no-orders-up-yet-on-the-dex.md) in the Freewallet Functions section of this User Manual.


---

# 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://davestaxcp.gitbook.io/freewallet.io-user-manual/exploring-balances-history-exchange-and-dispensers/the-decentralized-counterparty-exchange-dex.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.
