# add\_pool

This entrypoint allows anyone to deploy a new own DEX pool.

{% hint style="info" %}
QUIPU token should be approved (updated operators) before calling this method.
{% endhint %}

### Call parameters

Parameters logically close to Standalone variant of [Add new dex](/smart-contracts/quipuswap-stable-swap-dex/standalone-dex/add-new-dex.md), but there is no "`reserves`" field in tokens\_info mapping (because invest performs at second step - [start\_dex](/smart-contracts/quipuswap-stable-swap-dex/factory/initialize-new-dex-flow/start_dex.md)) and some additional config parameters.

* `default_referral` - the address that would be the default referral at the new pool.
* `managers` - a set of addresses that allowed to manipulate LP token metadata at the new pool.
* `metadata` - metadata of deployed contract.
* `token_metadata`  - metadata of the LP token at the new pool.

<table><thead><tr><th width="188">Field</th><th width="247" align="center">Type</th><th width="448.2">Description</th></tr></thead><tbody><tr><td>a_constant</td><td align="center"><code>nat</code></td><td>constant "A" as represented as <span class="math">A*n^{n-1}</span>.</td></tr><tr><td>input_tokens</td><td align="center"><code>set(token_t)</code></td><td>sorted set of <code>FA2/FA1.2</code> tokens to add as DEX.</td></tr><tr><td>tokens_info</td><td align="center"><code>map(token_pool_idx_t,token_prec_info_t)</code></td><td>map of rates and precisions config</td></tr><tr><td>default_referral</td><td align="center"><code>address</code></td><td>default referral that will be used in operations with the referral.</td></tr><tr><td>managers</td><td align="center"><code>set(address)</code></td><td>set of managers that allowed to change LP token metadata.</td></tr><tr><td>metadata</td><td align="center"><code>big_map(string, bytes)</code></td><td>contract metadata by <a href="https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-16/tzip-16.md">TZIP-016</a></td></tr><tr><td>token_metadata</td><td align="center"><code>big_map(token_id_t, token_meta_info_t)</code></td><td>mapping each token metadata by <a href="https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-12/tzip-12.md">TZIP-012</a></td></tr></tbody></table>

```pascaligo
type token_prec_info_t  is [@layout:comb] record [
  rate                    : nat;
  precision_multiplier    : nat;
]

type pool_init_param_t  is [@layout:comb] record [
  a_constant              : nat;
  input_tokens            : set(token_t);
  tokens_info             : map(token_pool_idx_t, token_prec_info_t);
  default_referral        : address;
  managers                : set(address);
  metadata                : big_map(string, bytes);
  token_metadata          : big_map(token_id_t, token_meta_info_t);
]
```


---

# 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/factory/initialize-new-dex-flow/add_pool.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.
