Hosts in the Flashnet AMM are integrators who register to earn fees from trading activity. They can be exchanges, wallet providers, dApps, or any application looking to leverage Bitcoin liquidity while earning revenue. The Flashnet Gateway enables fee sharing with registered hosts through:
  • Namespace Attribution: Pools tagged with your unique identifier
  • Fee Routing: Automatic distribution of trading fees
  • White Label Branding: Pools appear as “[Host Name]” pools
  • Revenue Generation: Earn from every swap in your pools

Registration

Requirements

  • Namespace: 3-32 characters, globally unique, alphanumeric with hyphens
  • Minimum Fee: Configure your minimum acceptable fee (10-100 BPS)
  • Public Key: Must be a valid secp256k1 public key
  • Authentication: Performed automatically via the SDK using your wallet’s identity key

Fee Structure

See the dedicated Fees page for complete details on LP, host, and integrator fees, accrual, and withdrawals. Key points for hosts:
  • Set minFeeBps during registration; pools using your namespace must set totalHostFeeRateBps >= minFeeBps.
  • Fees accrue and are withdrawn in Asset B only.

Implementation

Before registering as a host, make sure you have set up the Flashnet SDK client.
// Register as a host
async function registerAsHost() {
  try {
    const response = await client.registerHost({
      namespace: "my-exchange",
      minFeeBps: 50, // Minimum 0.5% fee
      feeRecipientPublicKey: "optional-different-pubkey" // Optional: defaults to wallet's public key
    });

    console.log('Registration successful:', response);
  } catch (error) {
    console.error('Registration failed:', error);
  }
}
Security Requirements:
  • The request is automatically signed with your wallet’s private key
  • Each request includes a unique nonce to prevent replay attacks
  • The namespace must be globally unique

Fee Management

Refer to Fees for accrual and withdrawal APIs and examples.

Host Discovery

Query registered hosts and their pools using the SDK:
// Get host information by namespace
async function getHostInfo(namespace: string) {
  try {
    const hostInfo = await client.getHost(namespace);
    console.log('Host info:', hostInfo);
  } catch (error) {
    console.error('Failed to fetch host information:', error);
  }
}

// Get pool host fees
async function checkPoolFees(hostNamespace: string, poolId: string) {
  try {
    const fees = await client.getPoolHostFees(hostNamespace, poolId);
    console.log('Available fees:', fees);
  } catch (error) {
    console.error('Failed to fetch pool fees:', error);
  }
}

// Filter pools by host
async function getPoolsByHost(hostNames: string[]) {
  try {
    const pools = await client.listPools({
      hostNames,
    });
    console.log('Host pools:', pools);
  } catch (error) {
    console.error('Failed to fetch pools:', error);
  }
}
Response includes:
  • Unique namespace identifier
  • Minimum fee configuration (minFeeBps)
  • Fee recipient public key
  • Flashnet split percentage
  • Registration timestamp