# spark\_flashnet\_createCPPool

{% hint style="info" %}
This method is coming :soon:
{% endhint %}

Use the `spark_flashnet_createCPPool` method to request the creation of a **Constant Product (CP) liquidity pool** on Flashnet directly from the user’s Spark wallet.

Your app provides the pool parameters (assets, fees, namespace, etc.), and the wallet handles the signing and submission to Flashnet.

***

## 📦 Example

```ts
import { request } from "sats-connect";

try {
  const response = await request("spark_flashnet_createCPPool", {
    assetAAddress: "0338d6978bd3163d1547f9ddb8b215d1c163bc7b4a552e559b89057f5449ba69de",
    assetBAddress: "020202020202020202020202020202020202020202020202020202020202020202",
    hostNamespace: "my-cool-exchange",
    lpFeeRateBps: 300, // 3.00% LP fee
    totalHostFeeRateBps: 200, // 2.00% host fee
    poolOwnerPublicKey: "03b06b7c3e39bf922be19b7ad5f19554bb7991cae585ed2e3374d51213ff4eeb3c",
    nonce: "550e8400-e29b-41d4-a716-446655440000"
  });

  if ("result" in response) {
    console.log("Pool created, requestId:", response.result.requestId);
  } else {
    console.error("Pool creation failed:", response.error.message);
  }
} catch (error) {
  console.error("Unexpected error:", error);
}
```

***

## 📤 Parameters

| Field                 | Type     | Required | Description                                                      |
| --------------------- | -------- | -------- | ---------------------------------------------------------------- |
| `assetAAddress`       | `string` | ✅        | Address of the first asset in the pool                           |
| `assetBAddress`       | `string` | ✅        | Address of the second asset in the pool                          |
| `hostNamespace`       | `string` | ✅        | Unique namespace for the pool (e.g. exchange name)               |
| `lpFeeRateBps`        | `number` | ✅        | Liquidity provider fee in basis points (e.g. 300 = 3.00%)        |
| `totalHostFeeRateBps` | `number` | ✅        | Host fee in basis points (e.g. 200 = 2.00%)                      |
| `poolOwnerPublicKey`  | `string` | ✅        | Public key of the pool owner                                     |
| `nonce`               | `string` | optional | Unique request identifier. If omitted, the wallet generates one. |

***

## ✅ Responses

* **Success (202 Accepted)**

```json
{
  "requestId": "01HJZKFABCDEFGHJKLMNPQRSTVW"
}
```

* **Failure**
  * `400 Bad Request` if the request is invalid
  * `401 Unauthorized` if authentication fails
  * `500 Internal Server Error` if something goes wrong internally
