Solana: Raydium SDK v2 showing no liquidity in clmm position when there is liquidity

I can help you with that article. Here is a suggestion:

Title:

Solana: Raydium SDK v2 showing no liquidity in clmm position when there is liquidity

Solana: Raydium SDK v2 shows no liquidity in CLMM position when trying to close

Introduction:

As a Raydium user, I encountered an issue when trying to close a liquidity pool position on the Solana blockchain using their SDK v2. Despite having a liquidity pool with active trading pairs, closing a position still creates a transaction ID (tx id) with no meaningful progress or updates.

Problem:

To test the SDK v2, I opened a liquidity pool position in ClosePosition.ts. However, when I tried to close this position using closePosition.ts, I encountered an issue where there was no meaningful progress. The tx id generated was not relevant to the transaction itself, but rather seemed to be related to a different type of event.

Code:

Here is a simplified example of my ClosePosition.ts code:

import { ChainId, sdk } from '@raydium/sdk';

import { ClosePositionRequest } from './ClosePositionRequest';

const chainId = ChainId.SOLANA;

async function closePosition(request: ClosePositionRequest) {

const liquidityPoolId = request.liquidityPoolId;

const assetIds = [request.asset1Id, request.asset2Id];

const positionId = 'position-123'; // Position the sample ID

try {

await sdk.closePosition(

chainId,

liquidityPoolId,

assetIds,

positionId

);

} catch (error) {

console.error(error);

}

}

Problem:

When I run this code, SDK v2 will try to close the liquidity pool position using ClosePosition.ts. However, since there has been no significant progress or updates, no tx ID is created.

Possible Cause:

Since SDK v2 uses a different event stream than OpenPosition, it is possible that the transaction ID is returning the wrong event type (ClosePositionEvent). Alternatively, the SDK may have some network connectivity or smart contract implementation issues, which is causing the transaction to get stuck in limbo.

Solution:

To resolve this issue, I recommend that you check the following:

  • Make sure that there are enough liquidity assets available on the Solana blockchain.
  • Verify that the liquidity pool is configured and deployed correctly on-chain.
  • Use tools like Truffle or Solana CLI to check for any network connectivity issues or smart contract implementation errors.

Conclusion:

I hope this article helped clarify the issue I encountered when closing a liquidity fund position on Raydium SDK v2. If you have similar issues, please feel free to provide us with more details and context so we can better help each other resolve the issue.

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir