# Work Procedures

### NFT Trading

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

The figure above shows the interaction between nft traders and the protocol in Midaswap. It mainly involves the following modules:

* `MidasRouter` is the trade routing, according to the trade path to the liquidity pool that needs to be traded.
* `Pair` is the liquidity pool module, which is responsible for trading liquidity according to the price curve set by LP
* `NFTVault` is a built-in asset vault module for Pair. All NFT assets in all liquidity pools are held in them. At the same time, the Treasury will record the price range corresponding to each position to ensure that its assets are traded within the price range set by it.
* `FT assets` are assets on the other side of NFTS in the liquidity pool. Theoretically, FT assets can be any kind of Fungible Token asset. At this stage, Midaswap supports ETH/WETH/USDC and others as FT assets.

As shown in the figure above:

* NFT sellers offer NFTS that point to the pair via `MidasRouter` to trade FT assets at the current floor price;
* NFT buyers select target NFTS and provide FT assets corresponding to their calibrated price to the `Pair` to obtain NFTS.
* Any transaction involving an NFT asset will interact with `NFTVault` to generate the asset and update the data recorded in it.

### Liquidity Management

<figure><img src="/files/6myDOvG8xYdggTN7h2Rj" alt=""><figcaption></figcaption></figure>

The figure above illustrates the interaction between the liquidity provider and the protocol in Midaswap. It mainly involves the following modules:

It mainly involves the following modules:

* `NFTVault` modules are consistent with the functions involved in the trading process.
* `MidasRouter` provides an interface for increasing and decreasing liquidity
* `Pair` is the liquidity management module of Midaswap, mainly responsible for creating liquidity pools, increasing/decreasing liquidity, and minting/burning LP tokens.

As shown in the figure above:

* When providing NFT liquidity, the price ceiling it sets will determine the price of the last NFT it trades, while the floor is the price of the first NFT it trades. All of these NFTS are priced by default in a proportional fashion.
* When providing FT liquidity, the upper limit of the price it sets is the price of the first NFT it liquidated in exchange for, while the lower limit is the price of the last NFT. All of this liquidity is still priced in proportion by default.


---

# 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://midaswap.gitbook.io/docs/technical-reference/work-procedures.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.
