> For the complete documentation index, see [llms.txt](https://docs.secretswap.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.secretswap.net/developer-guide/factory.md).

# Factory

## Transaction

### Create pair

Instantiate pair from uploaded WASM binary.

```javascript
{
  "pair_code_id": 1,
  "pair_code_hash": "<HASH>",
  "token_code_id": 2,
  "token_code_hash": "<HASH>",
  "init_hook": {
    "msg": "<base64_encoded_json_string>",
    "contract_addr": "secret...",
    "code_hash": "<HASH>"
  }
}
```

## Query

## Config

```javascript
{
  "config": {}
}
```

### Pair

```javascript
{
  "pair": {
    "asset_infos": [
      {
        "token": {
          "contract_addr": "<HumanAddr>",
          "token_code_hash": "<HASH>",
          "viewing_key": "..."
        }
      },
      {
        "native_token": {
          "denom": "uscrt"
        }
      }
    ]
  }
}

```

### Pairs

```javascript
{
  "pairs": {
    "start_after": [
      //optional
      {
        "token": {
          "contract_addr": "<HumanAddr>"
        }
      },
      {
        "native_token": {
          "denom": "uscrt"
        }
      }
    ],
    "limit": 10 //optional, default=10, max=30
  }
}
```
