> For the complete documentation index, see [llms.txt](https://docs.middlestaking.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.middlestaking.fr/contracts/swap-contract/details.md).

# Details

swaped\_tokens : list all tokens that have liquidity with MID token&#x20;

All pools are created with $MID as first token.

The swap function will allow to swap in both way&#x20;

MID <-> MEX or MEX <-> MID

first\_fee from a pool is applied on tokens sent by the user and used to increase liquidity.

second\_fee is applied on amount of tokens that the user receive and added as $MID staking rewards.

MID to MEX : MID are added to liquidity and MEX added as staking rewards

Dualswap function can use 2 pools position in one time . eg wegld to mex will be done in one time doing WEGLD <-> MID <-> MEX takin the fees only one time instead of two.

WEGLD to MEX : WEGLD are added to liquidity and MEX added as staking rewards.
