# Standalone DEX

This all-in-one contract, managed by `admin`. Each deployed DEX is stored inside the current contract and has its own FA2 token. Access to a specific DEX, implemented by pool ID. This ID is an also LP token ID. Every token metadata is managed by any of the manager's addresses.

### Storage

Contract storage has a complicated structure all info about storage is collected on the page below.

{% content-ref url="/pages/TtvN4KVYD8lnC32cRE47" %}
[Storage and types overview](/smart-contracts/quipuswap-stable-swap-dex/standalone-dex/storage-and-types-overview.md)
{% endcontent-ref %}

### Core methods

Main methods of DEX, that are able to use by anyone. These methods include investing, swapping, and divesting. Also, there are additional methods for staking QUIPU tokens for earning additional rewards and claiming referral rewards.

{% content-ref url="/pages/jVwwAm4e3a1fgbm6rFgP" %}
[DEX methods](/smart-contracts/quipuswap-stable-swap-dex/standalone-dex/dex-methods.md)
{% endcontent-ref %}

### Developer-only methods

The developer section contains [Developer module](/smart-contracts/quipuswap-stable-swap-dex/developer-module.md) entrypoints and additional methods for claiming developer rewards.

{% hint style="warning" %}
These entrypoints should be called only by `developer` address.&#x20;
{% endhint %}

{% content-ref url="/pages/OOgbdccYFLb55qLGpGJ0" %}
[Developer methods](/smart-contracts/quipuswap-stable-swap-dex/standalone-dex/developer-methods.md)
{% endcontent-ref %}

### Admin methods

{% hint style="warning" %}
These entrypoints should be called only by `admin` address.&#x20;
{% endhint %}

The next section is about entrypoints for managing fees, "A" constant change, editing manager list, and changing an admin address.

{% content-ref url="/pages/tjIFtpRpiwljFf1SrU53" %}
[Admin methods](/smart-contracts/quipuswap-stable-swap-dex/standalone-dex/admin-methods.md)
{% endcontent-ref %}

#### Initial setup of contract

These methods should be used **before** global usage of contract. Entrypoints set lambda-functions to its corresponding indexes inside related big maps.

{% content-ref url="/pages/Im047SfQhHVM3lqXvFvB" %}
[Initialization](/smart-contracts/quipuswap-stable-swap-dex/standalone-dex/initialization.md)
{% endcontent-ref %}

#### Create a new DEX pool

Creating a new DEX pool in the standalone variant is an admin function. So only the admin can create a new pool. Admin should approve the needed amount of tokens before calling this method because call includes transfer selected tokens to contract.

{% content-ref url="/pages/2O8XuLgWJZW0HTvCJyid" %}
[Add new dex](/smart-contracts/quipuswap-stable-swap-dex/standalone-dex/add-new-dex.md)
{% endcontent-ref %}

### Examples hint

{% hint style="info" %}
All examples use LP token with `decimals` of $$18$$ ↔ `precision` constant as $$10^{18}$$ and 3 "abstract" tokens `TBC`, `TXZ`, `TEH` that have ratios $$4:2:1$$ respectively.
{% endhint %}


---

# 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.quipuswap.com/smart-contracts/quipuswap-stable-swap-dex/standalone-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.
