# Factory

The Factory smart contract oversees the full functionality of token pair registration and transactions in PumpSpace.

## Address

[0x26B42c208D8a9d8737A2E5c9C57F4481484d4616](https://subnets.avax.network/c-chain/address/0x26B42c208D8a9d8737A2E5c9C57F4481484d4616?tab=code)

{% hint style="info" %}
📝 The contract is verified on [Avalanche C-Chain Explorer](https://subnets.avax.network/c-chain/address/0x26B42c208D8a9d8737A2E5c9C57F4481484d4616?tab=code), and its source code can be publicly viewed there.
{% endhint %}

***

## Functions

#### getPair

* When the addresses of tokenA and tokenB are inputted, this returns the contract address of the corresponding pairing
* Returns the same contract address regardless of the order of the liquidity pool pairing tokens:

  getPair\[tokenA]\[tokenB] == getPair\[tokenB]\[tokenA]

```solidity
function getPair(address tokenA, address tokenB) external view returns (address pair);
```

#### allPairs

* Returns the liquidity pair contract address of the pair's index.

```solidity
function allPairs(uint idx) external view returns (address pair);
```

#### allPairsLength

* Returns the current number of registered liquidity pools.

```solidity
function allPairsLength() external view returns (uint count);
```


---

# 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://pumpspace.gitbook.io/docs/en/contract/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.
