# Pool Factory

### pool\_factory

* [Description](#description)
* [Data Storage](#data-storage)
* [Interface](#interface)
* [Messages](#messages)

## Interface

### getPoolFactoryData

(address, address, int, cell, cell) getPoolFactoryData ()

This function provides current state of the user account

#### Return Values

| # | Type    | Description                                                                   |
| - | ------- | ----------------------------------------------------------------------------- |
| 0 | address | admin\_address Address of the admin of this Pool Factory                      |
| 1 | address | router\_address Address of the router that this Pool Factory is attached to   |
| 2 | int     | ton\_price Amount of ton taken as fee during Pool Creation (so far usually 0) |
| 3 | cell    | nftContent Content of Pool that would be presented as Nft Collection          |
| 4 | cell    | nftItemContent Content of Position NFT that would be presented as NFT         |

### getWhitelist

(dict) getWhitelist ()

This function provides current whitelist of the wallets that are allowed to get more granular control on creation.

#### Return Values

| # | Type | Description                                             |
| - | ---- | ------------------------------------------------------- |
| 0 | dict | whitelist Dictionary with whitelist of the Pool Factory |

## Messages

### POOL\_FACTORY\_CREATE\_POOL

Opcode : **0x9e9a8f7f**

Message that initiates pool creation\ <br>

<table data-full-width="true"><thead><tr><th width="50">Path</th><th width="200">Mnemonic</th><th width="180">Type</th><th>Description</th></tr></thead><tbody><tr><td></td><td>op</td><td>Uint(32),op</td><td></td></tr><tr><td></td><td>query_id</td><td>Uint(64)</td><td>queryid as of the TON documentation</td></tr><tr><td></td><td>jetton0Minter</td><td>Address(267)</td><td>Minter address of the first jetton</td></tr><tr><td></td><td>jetton1Minter</td><td>Address(267)</td><td>Minter address of the second jetton</td></tr><tr><td></td><td>initial_priceX96</td><td>Uint(160),PriceX96</td><td>Initial price for the pool</td></tr><tr><td></td><td>settings</td><td>Uint(16)</td><td>Value that describes pool configuration preset</td></tr><tr><td></td><td>0</td><td>Cell(0) wallet_cell</td><td>Cell With Wallets.</td></tr><tr><td>0</td><td>jetton0Wallet</td><td>Address(267)</td><td>Address of the jetton0 wallet of the Router</td></tr><tr><td>0</td><td>jetton1Wallet</td><td>Address(267)</td><td>Address of the jetton1 wallet of the Router</td></tr><tr><td></td><td>1</td><td>Cell(0) settings_cell</td><td>Cell With Settings for Whitelisted</td></tr><tr><td>1</td><td>fee</td><td>Uint(16)</td><td></td></tr><tr><td>1</td><td>tickSpacing</td><td>Uint(24)</td><td></td></tr><tr><td>1</td><td>active</td><td>Uint(1),Boolean</td><td></td></tr><tr><td>1</td><td>nftContent</td><td>Cell(1),Maybe</td><td></td></tr></tbody></table>

<details>

<summary>TL-B Description (TBD)</summary>

This is a preliminary tl-b - subject to change

{% code title="Tlb for POOL\_FACTORY\_CREATE\_POOL" overflow="wrap" lineNumbers="true" %}

```javascript
POOL_FACTORY_CREATE_POOL#9e9a8f7f 
    query_id:uint64
    jetton0Minter:MsgAddress
    jetton1Minter:MsgAddress
    initial_priceX96:uint160
    settings:uint16
    wallet_cell:^[
        jetton0Wallet:MsgAddress
        jetton1Wallet:MsgAddress
    ]  
    settings_cell:^[
        fee:uint16
        tickSpacing:uint24
        active:uint1
        nftContent:(Maybe ^Cell)
    ]  
= ContractMessages;
```

{% endcode %}

</details>
