# SinglePool Factory

이 컨트랙트는 단일풀 생성/관리 컨트랙트로써 유동성 제공자는 자산을 예치/출금하고 플러스풀 사용자는 활용자산을 단일풀에서 가져오거나 반환하게 됩니다. &#x20;

## Address

* Cypress : [0xd1890d8f02f4c63553658ba49c53a82eb84009e6](https://scope.klaytn.com/account/0xd1890d8f02f4c63553658ba49c53a82eb84009e6?tabId=txList)

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

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

## Events

**CreatePool**

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

* SinglePool 생성시 발생하는 이벤트&#x20;
* Parameters
  * token : KLAY, KIP7 토큰 주소
  * pool : 생성된 SinglePool 주소
  * exid : SinglePool ID&#x20;

**SetDepositActive**

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

* SinglePool 예치 가능여부 변경시 발생되는 이벤트

**SetWithdrawActive**

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

* SinglePool 출금 가능여부 변경시 발생되는 이벤트

**ChangeMiningRate**

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

* SinglePool 채굴비율 변경시 발생되는 이벤트

{% endtab %}

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

## Read-Only Functions

#### mining&#x20;

* KSP 채굴 비율&#x20;
* 1 \~ 10000, 단위 0.0001
* 기본 - 500 ( 총 KSP 채굴량의 5%  )&#x20;

#### getPoolCount

* Single Pool 개수

**getPoolAddressByIndex**

```solidity
function getPoolAddressByIndex(uint idx) public view returns (address)
```

* Single Pool 주소 조회

#### borrowBalanceStored

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

* 활용자산 수량
* Parameters
  * token : 토큰 주소
  * user : 조회 지갑 주소&#x20;
  * poolAddress : 대출을 수행한 풀의 주소
    {% 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.klayswap.com/kr/developer/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.
