Uniswap / v3-periphery

🦄 🦄 🦄 Peripheral smart contracts for interacting with Uniswap v3
https://uniswap.org
GNU General Public License v2.0
1.16k stars 1.08k forks source link

quoteExactInputSingle throws an unexpected error for USDC-CVX but works fine for USDC-WETH #320

Closed theideasaler closed 1 year ago

theideasaler commented 1 year ago

I am using quoteExactInputSingle to get the exchange amount output for different token pairs, the implementation throws an error for USDC-CVX pair but works fine for USDC-WETH pair.

This is the implementation I used to get the exchange output amount for USDC-CVX:

const amountOut = await quoterContract.callStatic.quoteExactInputSingle(
    '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
    '0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b',
    100,
    1_000_000,
    0
  );

And I get an error below:

{
  reason: 'Unexpected error',
  code: 'CALL_EXCEPTION',
  method: 'quoteExactInputSingle(address,address,uint24,uint256,uint160)',
  data: '0x08c379a000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000010556e6578706563746564206572726f7200000000000000000000000000000000',
  errorArgs: [ 'Unexpected error' ],
  errorName: 'Error',
  errorSignature: 'Error(string)',
  address: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6',
  args: [
    '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
    '0x4e3fbd56cd56c3e72c1403e103b45db9da5b9d2b',
    100,
    '1000000',
    0
  ],
  transaction: {
    data: '0xf7729d43000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000004e3fbd56cd56c3e72c1403e103b45db9da5b9d2b000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000f42400000000000000000000000000000000000000000000000000000000000000000',
    to: '0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6'
  }
}

Much apprecited if anyone could point out what I have missed.