Skip to main content

title: ‘FluxBeam Integration’ description: ‘Learn how to create and manage liquidity pools with FluxBeam’

Solana Agent Kit provides integration with FluxBeam for creating and managing liquidity pools. The integration supports creating new pools with any pair of tokens, including native SOL and SPL tokens.

Key Features

  • Create new liquidity pools
  • Support for native SOL and SPL tokens
  • Automatic decimal handling
  • LangChain tool integration
  • Built-in slippage protection

Basic Usage

Creating a New Pool

Input Parameters

Pool Creation Parameters

LangChain Integration

Solana Agent Kit provides a LangChain tool for pool creation:

Create Pool Tool

Example Prompts

For LangChain AI tools, here are example prompts:

Creating Pools

Error Handling

API Details

FluxBeam API

  • Base URL: FLUXBEAM_BASE_URI
  • Endpoint: /token_pools
  • Method: POST
  • Required fields: payer, token_a, token_b, token_a_amount, token_b_amount

Best Practices

  1. Token Amount Handling
    • Input amounts in human-readable format (e.g., 1.5 SOL, not 1500000000 lamports)
    • The integration automatically handles decimal conversion
    • Always verify token decimals before submission
  2. Token Address Validation
    • Use PublicKey class for token addresses
    • Verify token existence before pool creation
    • Handle native SOL cases appropriately
  3. Transaction Signing
    • Transactions are automatically signed by the agent
    • Uses VersionedTransaction for compatibility
    • Includes retry logic for better reliability
  4. Error Recovery
    • Implement proper error handling
    • Check for sufficient balances
    • Verify token approvals

Implementation Notes

  1. Decimal Handling
  2. Native SOL Support
  3. Transaction Processing

Common Use Cases

  1. Creating a SOL/USDC Pool
  2. Creating a Custom Token Pool

Technical Details

Constants

Configuration Options