# Guide: Wallet Trade Integration

## Token Support

If your wallet fully supports CIP-56 tokens you can freely integrate all Tradecraft pools for trading, along with add and remove liquidity options (which return CIP-56 compliant Tradecraft LP tokens).

If your wallet supports only a whitelist of Canton tokens you will need to manually limit your interface to only allow trading of your wallet's supported tokens.

## Pools API

To build a trading interface that supports all pools listed on Tradecraft, start by using the [Pools](/api/routes/pools.md#get-pools) API to fetch a list of all pools. Note that multi-hop trades are not yet supported.&#x20;

To get a list of tradable token pairs for a given token, run a reduce function on the list of pools and construct a mapping of each unique token to a list of other tokens. Every time a token appears in a pool entry, add it's paired token to its list of tradable tokens. With the two pools we have online now, your output would look like this:

```javascript
const tradableTokens = {
    'CC': ['USDCx', 'CBTC'],
    'USDCx': ['CC'],
    'CBTC': ['CC']
}
```

Now you can create a widget with token drop-downs similar to a standard swap widget that looks something like the below image. Each entry in `tradableTokens` can be added to the first drop-down, and the second drop-down can be populated with the array value for that token.

<figure><img src="/files/1o84PIyXFIZioJ7nGbGG" alt=""><figcaption></figcaption></figure>

## Quote API

{% hint style="warning" %}
**Important**

While the API is currently named "quote", these quotes should be presented to users as *estimates*. Since the on-chain portion of a trade is only initiated after the user sends funds and after Tradecraft gets to their order and begins execution, the price returned from the quote API may not be the price the user receives. A solution for this is in progress.
{% endhint %}

There are two API's for getting trade quotes–one to specify amount in, and one to specify amount out. Use either or both as your interface requires. For example in the widget above, the API for amount in would be used when the user types in the first input, showing response in the second, and when the user types in the second input, the response would be shown in the first input. Both APIs can be found on the [Quotes](/api/routes/quotes.md) API page.

## Trade Addresses

The official source of Tradecraft Pool Addresses can be found on our [Pools & Pool Addresses](/using-tradecraft/pools-and-pool-addresses.md) page. You will need to create a mapping from the user's selected tokens to get the correct Pool Address.

Depending on your chosen interface, you may either present the Pool Address to the user, or obscure these inner workings and send the tokens behind the scenes. Note that with the later option, the user will still need to manually accept incoming CIP-56 tokens (excluding CC), unless you have built a custom automation to accept those transfers.


---

# 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.tradecraft.fi/integrations/integrate-tradecraft/guide-wallet-trade-integration.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.
