Skip to content

Conversation

@kyoshoku
Copy link

Before submitting this PR, please make sure:

  • Your code builds clean without any errors or warnings
  • You are using approved title ("feat/", "fix/", "docs/", "refactor/")

A description of the changes proposed in the pull request:

Tests performed by the developer:

Tips for QA testing:

@fengtality fengtality added this to the v2.12 milestone Dec 18, 2025
@fengtality fengtality requested review from nikspz and rapcmia December 18, 2025 18:58
@rapcmia rapcmia moved this to Under Review in Pull Request Board Dec 19, 2025
@rapcmia rapcmia requested a review from fengtality December 19, 2025 08:37
@rapcmia
Copy link
Contributor

rapcmia commented Dec 22, 2025

Commit 98d03b6

  • Tested on helius nodeURL
  • Tested using FRANKLIN/SOL and PUMP/USDC pools
  • When trying to execute-swap, it kept on failing with these gateway logs for both token pairs ❌
    ####  /connectors/pumpswap/amm/add-liquidity 
    curl -X POST "http://localhost:15888/connectors/pumpswap/amm/add-liquidity" -H "Content-Type: application/json" -d '{"network":"mainnet-beta","walletAddress":"GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV","poolAddress":"2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd","baseTokenAmount":1484.6563846,"quoteTokenAmount":3,"slippagePct":1}' | jq
    {
      "statusCode": 400,
      "error": "Error",
      "message": "Transaction simulation failed. This usually means the swap parameters are invalid or market conditions changed. Try again."
    }
    logs: Program pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA failed: custom program error: 0xbc4 {}
    
    • gateway logs
      Program log: Instruction: Sell
      Program log: AnchorError caused by account: user_base_token_account. Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized.
      Program pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA consumed 11263 of 299700 compute units
      Program pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA failed: custom program error: 0xbc4
          at Solana.simulateTransaction (/home/yawnyunehh/hummingbot/gateway/575/dist/chains/solana/solana.js:1257:23)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at async Solana.simulateWithErrorHandling (/home/yawnyunehh/hummingbot/gateway/575/dist/chains/solana/solana.js:1270:13)
          at async executeSwap (/home/yawnyunehh/hummingbot/gateway/575/dist/connectors/pumpswap/amm-routes/executeSwap.js:78:5)
          at async Object.<anonymous> (/home/yawnyunehh/hummingbot/gateway/575/dist/connectors/pumpswap/amm-routes/executeSwap.js:127:20)
      2025-12-22 02:42:18 | error | 	Transaction simulation failed. This usually means the swap parameters are invalid or market conditions changed. Try again. {
        "statusCode": 400
      } | Error: Transaction simulation failed. This usually means the swap parameters are invalid or market conditions changed. Try again.
      
  • Also getting similar behavior with adding liquidity ❌
    #### /connectors/pumpswap/amm/add-liquidity
    curl -X POST "http://localhost:15888/connectors/pumpswap/amm/add-liquidity" -H "Content-Type: application/json" -d '{"network":"mainnet-beta","walletAddress":"GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV","poolAddress":"8wXzwpLjk6QJMYYC1VHueNnxRVW2nFGvQjgEnV4Mv8sY","baseTokenAmount":883.8117309,"quoteTokenAmount":0.02368971925,"slippagePct":1}' | jq
    {
      "statusCode": 400,
      "error": "Error",
      "message": "Transaction simulation failed. This usually means the swap parameters are invalid or market conditions changed. Try again."
    }
    logs: Program pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA failed: custom program error: 0xbc4 
    
    • gateway logs
      Program log: Instruction: Deposit
      Program log: AnchorError caused by account: user_base_token_account. Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized.
      Program pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA consumed 10358 of 200000 compute units
      Program pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA failed: custom program error: 0xbc4
          at Solana.simulateTransaction (/home/yawnyunehh/hummingbot/gateway/575/dist/chains/solana/solana.js:1257:23)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
          at async Solana.simulateWithErrorHandling (/home/yawnyunehh/hummingbot/gateway/575/dist/chains/solana/solana.js:1270:13)
          at async Object.<anonymous> (/home/yawnyunehh/hummingbot/gateway/575/dist/connectors/pumpswap/amm-routes/addLiquidity.js:101:13)
      2025-12-22 03:22:23 | error | 	Transaction simulation failed. This usually means the swap parameters are invalid or market conditions changed. Try again. {
        "statusCode": 400
      } | Error: Transaction simulation failed. This usually means the swap parameters are invalid or market conditions changed. Try again.
      

Incase needed, attached test and gateway logs: 12222025.zip

@fengtality fengtality moved this to Proposed in Bounties Board Dec 23, 2025
@kyoshoku kyoshoku changed the title Feat/pumpamm feat: add PumpAmm Dec 24, 2025
@rapcmia
Copy link
Contributor

rapcmia commented Dec 24, 2025

Commit bfd1b6e

  • PUMP/USDC 2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd
  • FRANKLIN/SOL 8wXzwpLjk6QJMYYC1VHueNnxRVW2nFGvQjgEnV4Mv8sY
  • GET /connectors/pumpswap/amm/pool-info ✅
  • GET /connectors/pumpswap/amm/quote-swap ✅
  • POST /connectors/pumpswap/amm/execute-swap ✅
  • GET /connectors/pumpswap/amm/quote-liquidity ✅
  • POST /connectors/pumpswap/amm/add-liquidity ✅
    curl -X POST "http://localhost:15888/connectors/pumpswap/amm/add-liquidity" -H "Content-Type: application/json" -d '{"network":"mainnet-beta","walletAddress":"GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV","poolAddress":"2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd","baseTokenAmount":1768.818263,"quoteTokenAmount":3,"slippagePct":2}' | jq
    {
      "signature": "52qmXDBEga3cEoCV1xT4JTQbzCgDy9yT6LzZf916E9pzKKFbe5PjGgJv9hthUHNXKdPAL2WFQfPmeiVqoxShZnHm",
      "status": 1,
      "data": {
        "fee": 0.000005,
        "baseTokenAmountAdded": 1768.818263,
        "quoteTokenAmountAdded": 2.9999999999305675
      }
    }
    logs: 2025-12-23 21:54:42 | info | 	Liquidity added successfully: 52qmXDBEga3cEoCV1xT4JTQbzCgDy9yT6LzZf916E9pzKKFbe5PjGgJv9hthUHNXKdPAL2WFQfPmeiVqoxShZnHm
    
  • GET /connectors/pumpswap/amm/position-info
    • When comparing what I added via pumpswap/amm/quote-liquidity, the basTokenAmountAdded and baseTokenAmount does not matched ❌
      # add liquidity
      curl -X POST "http://localhost:15888/connectors/pumpswap/amm/add-liquidity" -H "Content-Type: application/json" -d '{"network":"mainnet-beta","walletAddress":"GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV","poolAddress":"2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd","baseTokenAmount":1768.818263,"quoteTokenAmount":3,"slippagePct":2}' | jq
      {
        "signature": "52qmXDBEga3cEoCV1xT4JTQbzCgDy9yT6LzZf916E9pzKKFbe5PjGgJv9hthUHNXKdPAL2WFQfPmeiVqoxShZnHm",
        "status": 1,
        "data": {
          "fee": 0.000005,
          "baseTokenAmountAdded": 1768.818263,
          "quoteTokenAmountAdded": 2.9999999999305675
        }
      }
      
      ...
      
      # position info
      curl "http://localhost:15888/connectors/pumpswap/amm/position-info?network=mainnet-beta&poolAddress=2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd&walletAddress=GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV" | jq
      {
        "poolAddress": "2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd",
        "walletAddress": "GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV",
        "baseTokenAddress": "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn",
        "quoteTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
        "lpTokenAmount": 0.063388031,
        "baseTokenAmount": 0.0000017709057701118135,
        "quoteTokenAmount": 2.9964724559642188E-9,
        "price": 0.0016920564078206286
      }
      
      • While the quoteTokenAmount value is close enough, still observed some mismatch
      • Same behavior occurred on FRANKLIN/SOL pool
        "baseTokenAmountAdded": 2384.976761,
        "quoteTokenAmountAdded": 0.037501863693916615
        ...
        "baseTokenAmount": 0.0000023849767570914684,
        "quoteTokenAmount": 3.7501863632471495E-11,
        
      • I tried to compare with raydium-amm and not able to reproduce ✅
        "baseTokenAmountAdded": -16.021444000000002,
        "quoteTokenAmountAdded": -3
        ...
        "baseTokenAmount": 16.040755158737856,
        "quoteTokenAmount": 3.003615982597218,
        
  • POST /connectors/pumpswap/amm/remove-liquidity ✅
    • Run position-info on all tests and got lptokenamount and zero balances ok

  • /pools/find/{address} returns no connector/type mapping from GeckoTerminal (dex: pumpswap), it seems pumpswap needs to be included on the list of dex connectors as well ❌
    #### /pools/find/2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd?chainNetwork=solana-mainnet-beta
    curl "http://localhost:15888/pools/find/2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd?chainNetwork=solana-mainnet-beta" | jq
    {"statusCode":400,"error":"BadRequestError","message":"Pool 2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd has no connector/type mapping from GeckoTerminal (dex: pumpswap)"}
    
  • Also observed that pumpswap isn’t routed through the unified /trading/swapendpoints (no mapping in the swap router), so it only works via /connectors/pumpswap/amm/* only ❌

Added test and gateway logs incase needed: 12242025.zip

@fengtality
Copy link
Contributor

Since there are no /trading/amm endpoints yet, it's fine if only the /connectors/pumpswap/amm routes work. However, the other issues that @rapcmia should be fixed.

@kyoshoku
Copy link
Author

Added liquidity amount and fetch position info can be bit different, because amount calculated with pool shares (lpAmount).

@rapcmia
Copy link
Contributor

rapcmia commented Dec 25, 2025

Commit f9aa357

  • Test on both PUMP/USDC and FRANKLIN/SOL
  • Observed baseTokenAmount and basetokenAmountAdded values are close enough ✅
  • /pools/find/{pool address} ✅
    curl "http://localhost:15888/pools/find/2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd?chainNetwork=solana-mainnet-beta" | jq
    {
      "type": "amm",
      "network": "mainnet-beta",
      "baseSymbol": "PUMP",
      "quoteSymbol": "USDC",
      "baseTokenAddress": "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn",
      "quoteTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "feePct": 0.2,
      "address": "2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd",
      "geckoData": {
        "volumeUsd24h": "851724.342027516",
        "liquidityUsd": "12861945.6608",
        "priceNative": "0.001731955618",
        "priceUsd": "0.00174216228861622658674708785829634536966262390349171281848701735",
        "buys24h": 786,
        "sells24h": 671,
        "timestamp": 1766663628345,
        "apr": 4.834095758739303
      }
    }
    
  • /pumpswap/amm/add-liquidity ✅
    curl -X POST "http://localhost:15888/connectors/pumpswap/amm/add-liquidity" -H "Content-Type: application/json" -d '{"network":"mainnet-beta","walletAddress":"GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV","poolAddress":"2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd","baseTokenAmount":1726.020419,"quoteTokenAmount":3,"slippagePct":2}' | jq
    {
      "signature": "24kEcV5WttXyV7QWUmX79jrG42MD6GMMr4UeRRuSoVq4FPUAkzFxWmTYDj23JSz5ngnS9RRuiDXwrUoyE5raZvsG",
      "status": 1,
      "data": {
        "fee": 0.000005,
        "baseTokenAmountAdded": 1726.020419,
        "quoteTokenAmountAdded": 2.9999999995497575
      }
    }
    
  • /pumpswap/amm/position-info ✅
    /connectors/pumpswap/amm/position-info?network=mainnet-beta&poolAddress=2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd&walletAddress=GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV
    curl "http://localhost:15888/connectors/pumpswap/amm/position-info?network=mainnet-beta&poolAddress=2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd&walletAddress=GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV" | jq
    {
      "poolAddress": "2uF4Xh61rDwxnG9woyxsVQP7zuA6kLFpb3NvnRQeoiSd",
      "walletAddress": "GiooMWkHziPuXhfRar2ChBxU6VhQSrAh7xJTG2zHcxWV",
      "baseTokenAddress": "pumpCmXqMfrsAkQ5r49WcJnRayYRqmXz6ae8H7H9Dfn",
      "quoteTokenAddress": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
      "lpTokenAmount": 0.062603495,
      "baseTokenAmount": 1726.0204163367957,
      "quoteTokenAmount": 2.9999999949208376,
      "price": 0.0017381022649128688
    }
    
  • Run position-info again for both market pair after we remove liquidity, both return 0 lpTokenAmount

Copy link
Contributor

@rapcmia rapcmia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved 1/2

  • Test on linux using gateway connector endpoints
  • Test on pump/usdc and franklin/sol
  • GET /connectors/pumpswap/amm/pool-info ok
  • GET /connectors/pumpswap/amm/position-info ok
  • GET /connectors/pumpswap/amm/quote-liquidity ok
  • GET /connectors/pumpswap/amm/quote-swap ok
  • POST /connectors/pumpswap/amm/execute-swap ok
  • POST /connectors/pumpswap/amm/add-liquidity ok
  • POST /connectors/pumpswap/amm/remove-liquidity ok
  • GET /poolsfind/ ok
  • Compare responses with txns and each of endpoint response datasets
  • Reported issues has been addressed by developer
  • Skipped unified trading endpoints and focus on connector specific

@rapcmia
Copy link
Contributor

rapcmia commented Dec 25, 2025

Thanks for the update, i have added my tests and approved the PR (1/2)

@kyoshoku
Copy link
Author

No idea, because those issues are comes from past implementation test cases, not pumpamm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Potential
Status: Under Review

Development

Successfully merging this pull request may close these issues.

3 participants