Skip to content

BLAST quoterV2 - quoteExactInputSingle call exception #7

@gamebak

Description

@gamebak

Hello,
I've been trying and trying stuff to get the Blast quoterV2 to return prices, but with no luck.
Only getting "Error: call revert exception [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="quoteExactInputSingle((address,address,uint256,uint24,uint160))", data="0x", errorArgs=null, errorName=null, errorSignature=null, reason=null, code=CALL_EXCEPTION, version=abi/5.7.0)"

I'm using quoterV2 address as mentioned in the docs: '0xd93a91442afd80243cf12f7110f48ab276fff33f'

I don't know what I'm doing wrong, please help.

async function getQuoterV2()
{
    const sushiAbi = [
      {
        "inputs": [
          {
            "components": [
              {"internalType": "address", "name": "tokenIn", "type": "address"},
              {"internalType": "address", "name": "tokenOut", "type": "address"},
              {"internalType": "uint256", "name": "amountIn", "type": "uint256"},
              {"internalType": "uint24", "name": "fee", "type": "uint24"},
              {"internalType": "uint160", "name": "sqrtPriceLimitX96", "type": "uint160"}
            ],
            "internalType": "struct IQuoterV2.QuoteExactInputSingleParams",
            "name": "params",
            "type": "tuple"
          }
        ],
        "name": "quoteExactInputSingle",
        "outputs": [
          {"internalType": "uint256", "name": "amountOut", "type": "uint256"},
          {"internalType": "uint160", "name": "sqrtPriceX96After", "type": "uint160"},
          {"internalType": "uint32", "name": "initializedTicksCrossed", "type": "uint32"},
          {"internalType": "uint256", "name": "gasEstimate", "type": "uint256"}
        ],
        "stateMutability": "nonpayable",
        "type": "function"
      }
    ];

    const quoterV2Contract = new ethers.Contract(this.quoterV2, sushiAbi, this.provider);
    const params = {
      tokenIn: '0x4300000000000000000000000000000000000004', //weth
      tokenOut: '0x4300000000000000000000000000000000000003', //usdb
      amountIn: ethers.utils.parseUnits(amount.toString(), 18), // 1 = 0x016345785d8a0000 
      fee: 3000,
      sqrtPriceLimitX96: '0'
    };

    const result = await quoterV2Contract.callStatic.quoteExactInputSingle(params);
    return result;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions