gateway icon indicating copy to clipboard operation
gateway copied to clipboard

Uniswap Pool BigInt error

Open yogesh-bansal opened this issue 2 months ago • 1 comments

Describe the bug

I am trying to get a quote for 1000 BUY of a token using gateway swap uniswap/clmm IACS-USDC Then setting the qty to 1000 and BUY the gateway errors out with following

2025-10-06 22:59:00 | info |    Getting configuration for namespace: ethereum
2025-10-06 22:59:00 | info |    Finding clmm pool for IACS-USDC on base
2025-10-06 22:59:00 | info |    Resolved tokens: IACS (0x46e69Fa9059C3D5F8933CA5E993158568DC80EBf), USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)
2025-10-06 22:59:00 | info |    Found clmm pool at 0xd4d742CC8f54083F914A37e6B0C7B68c6005a024
2025-10-06 22:59:00 | info |    formatSwapQuote: poolAddress=0xd4d742CC8f54083F914A37e6B0C7B68c6005a024, baseToken=IACS, quoteToken=USDC, amount=1000, side=BUY, network=base
2025-10-06 22:59:00 | info |    Base token: IACS, address=0x46e69Fa9059C3D5F8933CA5E993158568DC80EBf, decimals=18
2025-10-06 22:59:00 | info |    Quote token: USDC, address=0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913, decimals=6
2025-10-06 22:59:00 | error |   Error quoting CLMM swap: Cannot convert 1e+21 to a BigInt
2025-10-06 22:59:00 | error |   Error formatting swap quote: Cannot convert 1e+21 to a BigInt
2025-10-06 22:59:00 | debug |   Stack trace: SyntaxError: Cannot convert 1e+21 to a BigInt
    at JSBI.BigInt (/home/gateway/node_modules/.pnpm/[email protected]/node_modules/jsbi/dist/jsbi-cjs.js:1:558)
    at quoteClmmSwap (/home/gateway/dist/connectors/uniswap/clmm-routes/quoteSwap.js:33:102)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async getUniswapClmmQuote (/home/gateway/dist/connectors/uniswap/clmm-routes/quoteSwap.js:89:19)
    at async formatSwapQuote (/home/gateway/dist/connectors/uniswap/clmm-routes/quoteSwap.js:104:75)
    at async Object.<anonymous> (/home/gateway/dist/connectors/uniswap/clmm-routes/quoteSwap.js:222:20)
2025-10-06 22:59:00 | error |   Cannot convert 1e+21 to a BigInt {}
2025-10-06 22:59:00 | error |   Unexpected error getting swap quote: Cannot convert 1e+21 to a BigInt {}

Steps to reproduce

  1. gateway swap uniswap/clmm IACS-USDC

Release version

2.9.0

Type of installation

Docker

Attach required files

No response

yogesh-bansal avatar Oct 07 '25 07:10 yogesh-bansal

Fixed in this PR https://github.com/hummingbot/gateway/pull/543

fengtality avatar Oct 30 '25 03:10 fengtality