Uniswap / examples

120 stars 147 forks source link

1000dai/usdt的quote is not accurate ! #57

Closed liubin595338764 closed 7 months ago

liubin595338764 commented 11 months ago

examples/v3-sdk/quoting/

// #src/libs/constants.ts  File
export const USDT_TOKEN = new Token(
  SupportedChainId.MAINNET,
  '0xdAC17F958D2ee523a2206206994597C13D831ec7',
  6,
  'USDT',
  'USD//T'
)
export const DAI_TOKEN = new Token(
  SupportedChainId.MAINNET,
  '0x6B175474E89094C44Da98b954EedeAC495271d0F',
  18,
  'DAI',
  'Dai Stablecoin'
)

// #config.ts File
export const CurrentConfig: ExampleConfig = {
  rpc: {
    local: 'http://localhost:8545',
    mainnet: 'https://mainnet.infura.io/v3/0ac57a06f2994538829c14745750d721',
  },
  tokens: {
    in: DAI_TOKEN,
    amountIn: 1000,
    out: USDT_TOKEN,
    poolFee: FeeAmount.MEDIUM,
  },
}

The quote returned by SDK is 215.851506 USDT, while the quote returned by Uniswap's official website is 999.731 USDT. The difference is too large!

image image