For the complete documentation index, see llms.txt. This page is also available as Markdown.

spark_flashnet_createBondingPool

This method is coming 🔜

Use the spark_flashnet_createBondingPool method to request the creation of a bonding curve pool (single-sided pool) on Flashnet directly from the user’s Spark wallet.

Bonding pools are typically used for token launches, where liquidity grows gradually along a curve until a graduation threshold is reached.


📦 Example

import { request } from "sats-connect";

try {
  const response = await request("spark_flashnet_createBondingPool", {
    assetAAddress: "0338d6978bd3163d1547f9ddb8b215d1c163bc7b4a552e559b89057f5449ba69de",
    assetAInitialReserve: "1000000000", // sats or smallest units
    assetBAddress: "020202020202020202020202020202020202020202020202020202020202020202",
    graduationThresholdPct: 50, // % of target to trigger graduation
    hostNamespace: "my-cool-exchange",
    lpFeeRateBps: 500, // 5.00%
    totalHostFeeRateBps: 200, // 2.00%
    targetBRaisedAtGraduation: "10000000000", // target raise
    poolOwnerPublicKey: "03b06b7c3e39bf922be19b7ad5f19554bb7991cae585ed2e3374d51213ff4eeb3c",
    nonce: "550e8400-e29b-41d4-a716-446655440000"
  });

  if ("result" in response) {
    console.log("Bonding pool created:", response.result);
  } 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 base asset (usually Spark BTC)

assetAInitialReserve

string

Initial reserve of asset A

assetBAddress

string

Address of the token being launched (asset B)

graduationThresholdPct

number

% of target raised to graduate pool (e.g. 50 = 50%)

hostNamespace

string

Unique namespace for the pool (e.g. launchpad name)

lpFeeRateBps

number

Liquidity provider fee in basis points

totalHostFeeRateBps

number

Host fee in basis points

targetBRaisedAtGraduation

string

Target amount of asset B to raise by graduation

poolOwnerPublicKey

string

Public key of the pool owner

nonce

string

optional

Unique request identifier. If omitted, the wallet generates one


✅ Responses

  • Success (202 Accepted) → Returns pool creation details and deposit address

  • Failure

    • 400 Bad Request if validation fails

    • 401 Unauthorized if authentication fails

    • 500 Internal Server Error if creation fails

Last updated