Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liquidity.fetchInfo returns not enough error details or returns no data. #101

Open
mynote opened this issue Jul 25, 2024 · 1 comment
Open

Comments

@mynote
Copy link

mynote commented Jul 25, 2024

IIt seems like that fetchInfo is not returning an error when an account was not found.

  static async fetchInfo({ connection, poolKeys }: LiquidityFetchInfoParams) {
    const info = await this.fetchMultipleInfo({ connection, pools: [poolKeys] })

    logger.assertArgument(info.length === 1, `fetchInfo failed, ${info.length} pools found`, 'poolKeys.id', poolKeys.id)

    return info[0]
  }

Since fetchInfo is just a validator for fetchMultipleInfo and fetchMultipleInfo calls makeSimulatePoolInfoInstruction to create the instructions and forward them mapped to simulateMultipleInstruction.

simulateMultipleInstruction (common/web3.ts) uses simulateTransaction and just returns a "rpc simulateTransaction error".

Its impossible to find the problem since the error itself is not returned.

For example the return value can be:

 [
  {
    "accounts": null,
    "err": "AccountNotFound",
    "innerInstructions": null,
    "logs": [],
    "returnData": null,
    "unitsConsumed": 0
  }
]

which would help alot.

Very often it happens that fetchInfo doesnt return any data and just hang until app restarts.

Also the same check returns very different results. using my testcode it returns RPC_ERROR in about 90% of all requests.


async function getLiquidityTest() {
 


    try {
         

        const poolKeys: LiquidityPoolKeysV4 = {
            id: new PublicKey("7VJMhT819AXeLiCZtxLN5QJjdccLwAtYdwhaRgvgJLuM"),
            baseMint: new PublicKey("LzBts8pgVWq7ryUnTY5DJpgMHpSccN89zkLnUoMbf7p"),
            quoteMint: new PublicKey("So11111111111111111111111111111111111111112"),
            lpMint: new PublicKey("5yEmxvqtW6cJcau5B8LorS8wGuzQva5yepvVnNpVidXX"),
            baseDecimals: 6,
            quoteDecimals: 9,
            lpDecimals: 6,
            version: 4,
            programId: new PublicKey("675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8"),
            authority: new PublicKey("5Q544fKrFoe6tsEbD7S8EmxGTJYAKtTVhAW5Q5pge4j1"),
            openOrders: new PublicKey("9dspCEGiBXb94oaHw6w254cyjnTsCYq5BG5kS6bVDUPQ"),
            targetOrders: new PublicKey("9megLFy2AMNXXb9M2D78mNV7sFDYnywx9nvMByfkd4hP"),
            baseVault: new PublicKey("GyJxsXhQ8EL5VvqwoP9eLRxPnsnC6XP8xCNFppp7DNt3"),
            quoteVault: new PublicKey("82ZRBxPmDHewmFCK41toZwn9ZuT9BK3om65BDX95izHv"),
            withdrawQueue: new PublicKey("11111111111111111111111111111111"),
            lpVault: new PublicKey("11111111111111111111111111111111"),
            marketVersion: 3,
            marketProgramId: new PublicKey("srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX"),
            marketId: new PublicKey("DatTAvv4m1JfwisBJKzoMSu1wdDYqaAGCUWVqoR1mMYU"),
            marketAuthority: new PublicKey("53z1taMU5xyxxgPKx4v4cY977naGUfrCpDYWTbsBXGPJ"),
            marketBaseVault: new PublicKey("B84LScYX3PtUAuHgKkPcsBd8YkuFCo8qYykbkAVMMXZr"),
            marketQuoteVault: new PublicKey("DBMta4ocfijdX9znU1Zm6oVkKovuK6D5QjPEoegRo8Ge"),
            marketBids: new PublicKey("JCitmBqC9urkMo6z2ynw5vaqzGhrFYUXZx8GsVK3rGoJ"),
            marketAsks: new PublicKey("AZ2yLekZhSzhX2BdMnTWDHnYTGCuGYnvTXAxdXjwxKWt"),
            marketEventQueue: new PublicKey("BStFTdpCwxtd9ci2D8zk998k9nxVQjDAfjWYFbvy6dg6"),
       
            lookupTableAccount: new PublicKey("11111111111111111111111111111111")
        };

        let poolInfo = await Liquidity.fetchInfo({ connection, poolKeys: poolKeys });

        console.log("PoolInfo: " + JSON.stringify(poolInfo, null, 2));
    } catch (error) {
        console.log(JSON.stringify(error, null, 2));
    }

}

First run:
ts-node src/app.ts

{
"reason": "failed to simulate for instructions",
"code": "RPC_ERROR"
}

Second run:
ts-node src/app.ts

PoolInfo: {
"status": "06",
"baseDecimals": 6,
"quoteDecimals": 9,
"lpDecimals": 6,
"baseReserve": "136ad81cbca2e591",
"quoteReserve": "01433b5e",
"lpSupply": "03f726fc40d6",
"startTime": "66a00be3"
}

Using helius (not rate limited)

@ParzifaL-03
Copy link

Using helius (not rate limited)

are you paid on helius? cuz i have this error on helius
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants