# SinglePool Factory

This contract is a single pool creation/management contract, where liquidity providers deposit/withdraw assets, and Plus Pool users bring or return utilized assets from a single pool.

## Address

* Polygon Mainnet :[ ](https://scope.klaytn.com/account/0x05343b228d61402e84d973ce114f34bc3f9e5987?tabId=txList)[0x504722a6eabb3d1573bada9abd585ae177d52e7a](https://polygonscan.com/address/0x504722a6eabb3d1573bada9abd585ae177d52e7a)

## Events, Read-Only Functions, and State-Changing Functions

{% tabs %}
{% tab title="Events" %}

## Events

**CreatePool**

```solidity
event CreatePool(address token, address pool, uint exid);
```

* Event to create new SinglePool&#x20;
* Parameters
  * `token` : A token address in target token
  * `pool` :  SinglePool contract address of this pool
  * `exid` : SinglePool ID&#x20;

**SetDepositActive**

```solidity
event SetDepositActive(address poolAddress, bool b);
```

* Event that occurs when SinglePool deposit availability is changed

**SetWithdrawActive**

```solidity
event SetWithdrawActive(address poolAddress, bool b);
```

* Event that occurs when SinglePool withdrawal availability is changed

**ChangeMiningRate**

```solidity
event ChangeMiningRate(uint _mining);
```

* Event that occurs when SinglePool mining rate is changed

{% endtab %}

{% tab title="Read-Only Functions" %}

## Read-Only Functions

#### mining&#x20;

* The mining rate of the pool
* It is a value between 0 and 10000, in units of 0.01%
* Default - 500&#x20;

#### getPoolCount

* Number of SinglePools

#### borrowBalanceStored

```solidity
function borrowBalanceStored(address token, address user, address poolAddress) public view returns (uint) 
```

* Utilized asset quantity
* Parameters
  * `token` : Token address
  * `user` : User address
  * `poolAddress` :  SinglePool address
    {% endtab %}
    {% endtabs %}


---

# 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.meshswap.fi/developers/contract/singlepool-factory.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.
