# Opium swaps (TMtm)

In financial markets, traders often combine orders to take or reduce exposure in multiple positions at the same time. This was our motivation for designing the TMtm mechanism. It enables a variety of operations such as buying, selling, swapping and creating spreads in simple, but also complex ways.

The swap function executes TMtm-swaps:

{% hint style="info" %}
***TMtm swap:*** user requests to provide {T amount of Opium Tokens + M amount of ERC-20 margin} in exchange for {T amount of Opium Tokens + M amount of ERC-20 margin}
{% endhint %}

With this standard protocol request, it is possible to sell, buy and exchange tokens or spreads. For example:&#x20;

> {4xFuture, 0, 0, 6xUSDT} is a sell order of 4 Futures for 6 USDT Tokens.
>
> {0, 5xDAI, 10xOptions, 0} is a buy order of 10 Options for 5 DAI  Tokens.
>
> {4xFuture, 6xUSDT, 10xOptions, 0} is a combined sell order for \[10 Options - 4 Futures] spread with a price to pay of 6 USDT coins.
>
> {4xFutureA, 0, 8xFutureB, 0} is a buy order of 8 FutureB with paying of 4 FutureA
>
> {1xPortfolio, 0, 0, 1200xDAI} is a sell order of user Portfolio for 1200 DAI coins

Orders are signed by the user and allow the Opium Network to withdraw funds needed to execute the order. &#x20;


---

# 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.opium.network/complex-description/opium-swaps-tmtm.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.
