current location:Home >> Blockchain knowledge >> solana create liquidity pool/delete liquidity pool

solana create liquidity pool/delete liquidity pool

admin Blockchain knowledge 599

To create a liquidity pool on Solana, you'll typically use a decentralized exchange (DEX) like Raydium or Orca. Here's a general guide:

Using Raydium

  1. solana create liquidity pool/delete liquidity pool

    Connect your wallet to Raydium.io

  2. Navigate to the "Liquidity" section

  3. Click "Create Pool"

  4. Select the two tokens you want to pair

  5. Set the initial price and deposit amounts for both tokens

  6. Confirm the transaction in your wallet

Using Orca

  1. Go to Orca.so

  2. Connect your wallet

  3. Click on "Pools" then "Create a pool"

  4. Select your token pair

  5. Set parameters like fee tier (usually 0.3% for standard pools)

  6. Deposit initial liquidity

  7. Confirm the transaction

Technical Approach (Programmatic)

If you want to create a pool programmatically using Solana's Token Swap program:

import { TokenSwap, createInitSwapInstruction } from "@solana/spl-token-swap";

// Initialize the pool
const initSwapInstruction = createInitSwapInstruction(
  swapAccount,          // New account to hold swap state
  swapAuthority,        // Authority of the swap
  tokenAccountA,        // Token A account
  tokenAccountB,        // Token B account
  poolTokenAccount,     // Pool token mint account
  feeAccount,           // Fee account
  tokenProgramId,       // SPL Token program id
  swapProgramId,        // Token Swap program id
  nonce,                // Nonce for the authority
  swapFee,              // Swap fee (e.g., 0.003 for 0.3%)
  curveType             // Type of curve (e.g., constant product)
);

// Add this instruction to your transaction

Requirements

  • You'll need SOL for transaction fees

  • Sufficient amounts of both tokens you want to pool

  • A small amount of SOL to create the new accounts (rent exemption)

Deleting a Liquidity Pool on Solana

Deleting a liquidity pool on Solana depends on which platform you created it on (Raydium, Orca, etc.) and whether you're the pool creator. Here are the methods:

For Raydium Pools

  1. Withdraw all liquidity:

    • Go to Raydium.io

    • Navigate to "Liquidity"

    • Find your pool and click "Remove Liquidity"

    • Withdraw 100% of your LP tokens

  2. If you're the pool creator:

    • After withdrawing all liquidity, the pool will become inactive

    • There's no direct "delete" function - the pool remains but with zero liquidity

For Orca Pools

  1. Remove all liquidity:

    • Visit Orca.so

    • Go to "Pools" and find your position

    • Click "Remove Liquidity" and select 100%

  2. Whirlpools (concentrated liquidity):

    • You may need to close your position explicitly after withdrawing liquidity

Programmatic Approach

If you created a custom pool using Solana's Token Swap program:

import { TokenSwap, createWithdrawAllTokenTypesInstruction } from "@solana/spl-token-swap";

// 1. First withdraw all liquidity
const withdrawIx = createWithdrawAllTokenTypesInstruction(
  swapAccount,          // Swap account
  swapAuthority,        // Authority
  userAccountA,         // Your token A account
  userAccountB,         // Your token B account
  poolTokenAccount,     // Your LP token account
  poolTokenMint,        // LP token mint
  feeAccount,           // Fee account
  tokenProgramId,       // SPL Token program
  swapProgramId,        // Token Swap program
  poolTokenAmount,      // Amount of LP tokens to burn
  minimumTokenA,        // Min amount of token A to receive
  minimumTokenB         // Min amount of token B to receive
);

// 2. Then you may close the accounts (if you created them)
const closeIx = await createCloseAccountInstruction(
  swapAccount,          // Account to close
  wallet.publicKey,     // Destination for remaining SOL
  wallet.publicKey,     // Account owner
  []
);

Important Notes

  1. You can't delete someone else's liquidity pool - you can only remove your liquidity

  2. Pools persist even with zero liquidity until all accounts are closed

  3. Account closure requires you to be the owner of the accounts

  4. SOL recovery - Closing accounts returns the rent exemption SOL to you

Complete Removal Requirements

For complete removal:

  1. Withdraw all liquidity (burn all LP tokens)

  2. Close the swap account (if you created it)

  3. Close the token accounts (if you created them)

If you have any questions or uncertainties, please join the official Telegram group: https://t.me/GToken_EN

GTokenTool

GTokenTool is the most comprehensive one click coin issuance tool, supporting multiple public chains such as TON, SOL, BSC, etc. Function: Create tokensmarket value managementbatch airdropstoken pre-sales IDO、 Lockpledge mining, etc. Provide a visual interface that allows users to quickly create, deploy, and manage their own cryptocurrencies without writing code.

Similar recommendations