POST
/
v1
/
pools
/
constant-product
Create CP Pool
curl --request POST \
  --url https://api.amm.flashnet.xyz/v1/pools/constant-product \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "assetAAddress": "0338d6978bd3163d1547f9ddb8b215d1c163bc7b4a552e559b89057f5449ba69de",
  "assetBAddress": "020202020202020202020202020202020202020202020202020202020202020202",
  "hostNamespace": "my-cool-exchange",
  "lpFeeRateBps": "300",
  "nonce": "550e8400-e29b-41d4-a716-446655440000",
  "poolOwnerPublicKey": "03b06b7c3e39bf922be19b7ad5f19554bb7991cae585ed2e3374d51213ff4eeb3c",
  "signature": "3045022100a7e5d4f8b2c9a1e6f0d5b8c4a9e7f2d1c8b5a4e9f0d6c5b3a2e1d0c9b8a7f02201f2e3d4c5b6a7980e9f0a1b2c3d4e5f67889a0b1c2d3e4f5a6b7c8d9e0f1a2b3",
  "totalHostFeeRateBps": "200"
}'
{
"message": "Pool created successfully. Initial liquidity can now be added to the pool.",
"poolId": "03poollpidentitypubkeyfedcba9876543210fedcba9876543210fedcba9876"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Constant product pool creation parameters including fee configuration

Request body for creating a new constant product AMM pool.

This struct contains all the parameters required to initialize a new constant product pool. Unlike single-sided pools, constant product pools don't require initial deposits as they will be initialized on the first liquidity addition.

poolOwnerPublicKey
string
required

Public key of the pool owner.

Example:

"03b06b7c3e39bf922be19b7ad5f19554bb7991cae585ed2e3374d51213ff4eeb3c"

assetAAddress
string
required

Address of asset A.

Example:

"0338d6978bd3163d1547f9ddb8b215d1c163bc7b4a552e559b89057f5449ba69de"

assetBAddress
string
required

Address of asset B.

Example:

"020202020202020202020202020202020202020202020202020202020202020202"

lpFeeRateBps
integer
required

Liquidity provider fee rate, in basis points (BIPS).

Required range: x >= 0
Example:

300

totalHostFeeRateBps
integer
required

Total host fee rate in basis points (BPS). Includes both host and Flashnet fees. Must be validated based on host configuration.

Required range: x >= 0
Example:

200

nonce
string
required

Unique nonce for replay protection.

Example:

"550e8400-e29b-41d4-a716-446655440000"

signature
string
required

Hex-encoded signature of the nonce, signed by the pool owner.

Example:

"3045022100a7e5d4f8b2c9a1e6f0d5b8c4a9e7f2d1c8b5a4e9f0d6c5b3a2e1d0c9b8a7f02201f2e3d4c5b6a7980e9f0a1b2c3d4e5f67889a0b1c2d3e4f5a6b7c8d9e0f1a2b3"

hostNamespace
string | null

Optional host namespace for fee sharing. If provided, fees will be shared with the specified host.

Example:

"my-cool-exchange"

Response

Pool creation process initiated. Poll status endpoint for updates.

Response for pool creation

poolId
string
required

Pool ID (LP public key)

Example:

"03aabbccddeeff00112233445566778899aabbccddeeff00112233445566778899"

message
string
required

Human-readable confirmation message

Example:

"Pool created successfully"