Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/connectors/dflow/router-routes/quoteSwap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Solana } from '../../../chains/solana/solana';
import { httpErrors } from '../../../services/error-handler';
import { logger } from '../../../services/logger';
import { quoteCache } from '../../../services/quote-cache';
import { toRawAmount } from '../../../services/raw-amount';
import { sanitizeErrorMessage, sanitizeString } from '../../../services/sanitize';
import { approximateBuyViaSellLeg, attemptedRoute, priceImpactPercentFromFraction } from '../../router-utils';
import { DFlow, DFlowQuoteResponse } from '../dflow';
Expand Down Expand Up @@ -41,7 +42,7 @@ export async function quoteSwap(
let isApproximation = false;

if (side === 'SELL') {
const amountRaw = Math.floor(amount * Math.pow(10, baseTokenInfo.decimals)).toString();
const amountRaw = toRawAmount(amount, baseTokenInfo.decimals);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 BUY conversion remains broken

This conversion only covers the SELL branch. DFlow BUY requests use approximateBuyViaSellLeg, which still converts the amount with Math.floor(baseAmount * 10 ** decimals).toString(). A BUY of 1000 units of an 18-decimal token therefore produces "1e+21" instead of a raw integer string and can fail before returning a route. Titan BUY requests have the same problem, as does OKX when ExactOut falls back to approximation.

Knowledge Base Used:

try {
quoteResponse = await dflow.getQuote(inputToken.address, outputToken.address, amountRaw, slippageBps);
} catch (error) {
Expand Down
5 changes: 3 additions & 2 deletions src/connectors/jupiter/jupiter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getSolanaNetworkConfig } from '../../chains/solana/solana.config';
import { httpErrors } from '../../services/error-handler';
import { createHttpClient, HttpClient, HttpClientError } from '../../services/http-client';
import { logger } from '../../services/logger';
import { toRawAmount } from '../../services/raw-amount';

import { JupiterConfig } from './jupiter.config';

Expand Down Expand Up @@ -194,7 +195,7 @@ export class Jupiter {
const effectiveSlippagePct = slippagePct ?? this.config.slippagePct;
const slippageBps = Math.round(effectiveSlippagePct * 100);
const tokenDecimals = swapMode === 'ExactOut' ? outputToken.decimals : inputToken.decimals;
const quoteAmount = Math.floor(amount * 10 ** tokenDecimals);
const quoteAmount = toRawAmount(amount, tokenDecimals);

logger.info(
`Jupiter quote: ${inputToken.symbol}->${outputToken.symbol}, amount=${amount}, slippagePct=${effectiveSlippagePct}% (${slippageBps} bps), swapMode=${swapMode}, onlyDirectRoutes=${onlyDirectRoutes}, restrictIntermediateTokens=${restrictIntermediateTokens}`,
Expand All @@ -205,7 +206,7 @@ export class Jupiter {
const params = {
inputMint: inputToken.address,
outputMint: outputToken.address,
amount: quoteAmount.toString(),
amount: quoteAmount,
slippageBps: slippageBps.toString(),
swapMode: swapMode,
onlyDirectRoutes: onlyDirectRoutes.toString(),
Expand Down
3 changes: 2 additions & 1 deletion src/connectors/okx/router-routes/quoteSwap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Solana } from '../../../chains/solana/solana';
import { httpErrors } from '../../../services/error-handler';
import { logger } from '../../../services/logger';
import { quoteCache } from '../../../services/quote-cache';
import { toRawAmount } from '../../../services/raw-amount';
import { sanitizeErrorMessage, sanitizeString } from '../../../services/sanitize';
import { approximateBuyViaSellLeg, attemptedRoute } from '../../router-utils';
import { Okx, OkxRouterResult } from '../okx';
Expand Down Expand Up @@ -41,7 +42,7 @@ export async function quoteSwap(
logger.info(`Getting OKX quote for ${amount} ${inputToken.symbol} -> ${outputToken.symbol} (${side})`);

// The amount is denominated in base token for both sides
const baseAmountRaw = Math.floor(amount * Math.pow(10, baseTokenInfo.decimals)).toString();
const baseAmountRaw = toRawAmount(amount, baseTokenInfo.decimals);

let routerResult: OkxRouterResult;
let isApproximation = false;
Expand Down
15 changes: 5 additions & 10 deletions src/connectors/pancakeswap/amm-routes/quoteLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BigNumber } from 'ethers';
import { Ethereum } from '../../../chains/ethereum/ethereum';
import { QuoteLiquidityResponseType } from '../../../schemas/amm-schema';
import { logger } from '../../../services/logger';
import { toRawAmount } from '../../../services/raw-amount';
import { Pancakeswap } from '../pancakeswap';
import { IPancakeswapV2PairABI, getPancakeswapV2RouterAddress } from '../pancakeswap.contracts';
import { formatTokenAmount } from '../pancakeswap.utils';
Expand Down Expand Up @@ -92,12 +93,10 @@ export async function getPancakeswapAmmLiquidityQuote(
const quoteReserve = token0IsBase ? reserve1 : reserve0;

// Convert amounts to BigNumber with proper decimals
const baseAmountRaw = baseTokenAmount
? BigNumber.from(Math.floor(baseTokenAmount * Math.pow(10, baseTokenObj.decimals)).toString())
: null;
const baseAmountRaw = baseTokenAmount ? BigNumber.from(toRawAmount(baseTokenAmount, baseTokenObj.decimals)) : null;

const quoteAmountRaw = quoteTokenAmount
? BigNumber.from(Math.floor(quoteTokenAmount * Math.pow(10, quoteTokenObj.decimals)).toString())
? BigNumber.from(toRawAmount(quoteTokenAmount, quoteTokenObj.decimals))
: null;

// Calculate optimal amounts based on the reserves ratio
Expand Down Expand Up @@ -146,13 +145,9 @@ export async function getPancakeswapAmmLiquidityQuote(
const routerAddress = getPancakeswapV2RouterAddress(networkToUse);

// Convert final amounts to raw values for execution
const rawBaseTokenAmount = BigNumber.from(
Math.floor(baseTokenAmountOptimal * Math.pow(10, baseTokenObj.decimals)).toString(),
);
const rawBaseTokenAmount = BigNumber.from(toRawAmount(baseTokenAmountOptimal, baseTokenObj.decimals));

const rawQuoteTokenAmount = BigNumber.from(
Math.floor(quoteTokenAmountOptimal * Math.pow(10, quoteTokenObj.decimals)).toString(),
);
const rawQuoteTokenAmount = BigNumber.from(toRawAmount(quoteTokenAmountOptimal, quoteTokenObj.decimals));

return {
baseLimited,
Expand Down
11 changes: 3 additions & 8 deletions src/connectors/pancakeswap/amm-routes/quoteSwap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Ethereum } from '../../../chains/ethereum/ethereum';
import { QuoteSwapResponseType } from '../../../schemas/amm-schema';
import { httpErrors } from '../../../services/error-handler';
import { logger } from '../../../services/logger';
import { toRawAmount } from '../../../services/raw-amount';
import { Pancakeswap } from '../pancakeswap';
import { PancakeswapConfig } from '../pancakeswap.config';
import { formatTokenAmount } from '../pancakeswap.utils';
Expand Down Expand Up @@ -39,17 +40,11 @@ async function quoteAmmSwap(
let trade;
if (exactIn) {
// For SELL (exactIn), we use the input amount and EXACT_INPUT trade type
const inputAmount = CurrencyAmount.fromRawAmount(
inputToken,
Math.floor(amount * Math.pow(10, inputToken.decimals)).toString(),
);
const inputAmount = CurrencyAmount.fromRawAmount(inputToken, toRawAmount(amount, inputToken.decimals));
trade = new V2Trade(route, inputAmount, TradeType.EXACT_INPUT);
} else {
// For BUY (exactOut), we use the output amount and EXACT_OUTPUT trade type
const outputAmount = CurrencyAmount.fromRawAmount(
outputToken,
Math.floor(amount * Math.pow(10, outputToken.decimals)).toString(),
);
const outputAmount = CurrencyAmount.fromRawAmount(outputToken, toRawAmount(amount, outputToken.decimals));
trade = new V2Trade(route, outputAmount, TradeType.EXACT_OUTPUT);
}

Expand Down
9 changes: 5 additions & 4 deletions src/connectors/pancakeswap/clmm-routes/quotePosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import JSBI from 'jsbi';

import { QuotePositionResponseType } from '../../../schemas/clmm-schema';
import { httpErrors } from '../../../services/error-handler';
import { toRawAmount } from '../../../services/raw-amount';
import { sanitizeErrorMessage } from '../../../services/sanitize';
import { Pancakeswap } from '../pancakeswap';
import { getPancakeswapPoolInfo } from '../pancakeswap.utils';
Expand Down Expand Up @@ -82,8 +83,8 @@ export async function quotePosition(

if (baseTokenAmount !== undefined && quoteTokenAmount !== undefined) {
// Both amounts provided - use fromAmounts to calculate optimal position
const baseAmountRaw = JSBI.BigInt(Math.floor(baseTokenAmount * Math.pow(10, baseTokenObj.decimals)).toString());
const quoteAmountRaw = JSBI.BigInt(Math.floor(quoteTokenAmount * Math.pow(10, quoteTokenObj.decimals)).toString());
const baseAmountRaw = JSBI.BigInt(toRawAmount(baseTokenAmount, baseTokenObj.decimals));
const quoteAmountRaw = JSBI.BigInt(toRawAmount(quoteTokenAmount, quoteTokenObj.decimals));

// Create position from both amounts
if (isBaseToken0) {
Expand Down Expand Up @@ -116,7 +117,7 @@ export async function quotePosition(
baseLimited = baseRatio <= quoteRatio;
} else if (baseTokenAmount !== undefined) {
// Only base amount provided
const baseAmountRaw = JSBI.BigInt(Math.floor(baseTokenAmount * Math.pow(10, baseTokenObj.decimals)).toString());
const baseAmountRaw = JSBI.BigInt(toRawAmount(baseTokenAmount, baseTokenObj.decimals));

if (isBaseToken0) {
position = Position.fromAmount0({
Expand All @@ -137,7 +138,7 @@ export async function quotePosition(
baseLimited = true;
} else if (quoteTokenAmount !== undefined) {
// Only quote amount provided
const quoteAmountRaw = JSBI.BigInt(Math.floor(quoteTokenAmount * Math.pow(10, quoteTokenObj.decimals)).toString());
const quoteAmountRaw = JSBI.BigInt(toRawAmount(quoteTokenAmount, quoteTokenObj.decimals));

if (isBaseToken0) {
position = Position.fromAmount1({
Expand Down
3 changes: 2 additions & 1 deletion src/connectors/router-utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { httpErrors } from '../services/error-handler';
import { logger } from '../services/logger';
import { toRawAmount } from '../services/raw-amount';

/**
* Minimal token shape needed for BUY approximation (subset of chain TokenInfo).
Expand Down Expand Up @@ -119,7 +120,7 @@ export async function approximateBuyViaSellLeg<TQuote>({
quoteToken,
baseAmount,
}: ApproximateBuyParams<TQuote>): Promise<ApproximateBuyResult<TQuote>> {
const baseAmountRaw = Math.floor(baseAmount * 10 ** baseToken.decimals).toString();
const baseAmountRaw = toRawAmount(baseAmount, baseToken.decimals);

logger.info(
`Approximating BUY of ${baseAmount} ${baseToken.symbol} via sell-leg quote (router lacks ExactOut support)`,
Expand Down
3 changes: 2 additions & 1 deletion src/connectors/titan/router-routes/quoteSwap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getSolanaChainConfig } from '../../../chains/solana/solana.config';
import { httpErrors } from '../../../services/error-handler';
import { logger } from '../../../services/logger';
import { quoteCache } from '../../../services/quote-cache';
import { toRawAmount } from '../../../services/raw-amount';
import { sanitizeErrorMessage } from '../../../services/sanitize';
import { approximateBuyViaSellLeg, attemptedRoute } from '../../router-utils';
import { TitanQuoteSwapResponse } from '../schemas';
Expand Down Expand Up @@ -53,7 +54,7 @@ export async function quoteSwap(
let isApproximation = false;

if (side === 'SELL') {
const amountRaw = Math.floor(amount * Math.pow(10, baseTokenInfo.decimals)).toString();
const amountRaw = toRawAmount(amount, baseTokenInfo.decimals);
try {
swapRoute = await titan.getSwapRoute(inputToken.address, outputToken.address, amountRaw, wallet, slippageBps);
} catch (error) {
Expand Down
15 changes: 5 additions & 10 deletions src/connectors/uniswap/amm-routes/quoteLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BigNumber } from 'ethers';
import { Ethereum } from '../../../chains/ethereum/ethereum';
import { QuoteLiquidityResponseType } from '../../../schemas/amm-schema';
import { logger } from '../../../services/logger';
import { toRawAmount } from '../../../services/raw-amount';
import { Uniswap } from '../uniswap';
import { IUniswapV2PairABI, getUniswapV2RouterAddress } from '../uniswap.contracts';
import { formatTokenAmount } from '../uniswap.utils';
Expand Down Expand Up @@ -92,12 +93,10 @@ export async function getUniswapAmmLiquidityQuote(
const quoteReserve = token0IsBase ? reserve1 : reserve0;

// Convert amounts to BigNumber with proper decimals
const baseAmountRaw = baseTokenAmount
? BigNumber.from(Math.floor(baseTokenAmount * Math.pow(10, baseTokenObj.decimals)).toString())
: null;
const baseAmountRaw = baseTokenAmount ? BigNumber.from(toRawAmount(baseTokenAmount, baseTokenObj.decimals)) : null;

const quoteAmountRaw = quoteTokenAmount
? BigNumber.from(Math.floor(quoteTokenAmount * Math.pow(10, quoteTokenObj.decimals)).toString())
? BigNumber.from(toRawAmount(quoteTokenAmount, quoteTokenObj.decimals))
: null;

// Calculate optimal amounts based on the reserves ratio
Expand Down Expand Up @@ -146,13 +145,9 @@ export async function getUniswapAmmLiquidityQuote(
const routerAddress = getUniswapV2RouterAddress(networkToUse);

// Convert final amounts to raw values for execution
const rawBaseTokenAmount = BigNumber.from(
Math.floor(baseTokenAmountOptimal * Math.pow(10, baseTokenObj.decimals)).toString(),
);
const rawBaseTokenAmount = BigNumber.from(toRawAmount(baseTokenAmountOptimal, baseTokenObj.decimals));

const rawQuoteTokenAmount = BigNumber.from(
Math.floor(quoteTokenAmountOptimal * Math.pow(10, quoteTokenObj.decimals)).toString(),
);
const rawQuoteTokenAmount = BigNumber.from(toRawAmount(quoteTokenAmountOptimal, quoteTokenObj.decimals));

return {
baseLimited,
Expand Down
11 changes: 3 additions & 8 deletions src/connectors/uniswap/amm-routes/quoteSwap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Ethereum } from '../../../chains/ethereum/ethereum';
import { QuoteSwapResponseType } from '../../../schemas/amm-schema';
import { httpErrors } from '../../../services/error-handler';
import { logger } from '../../../services/logger';
import { toRawAmount } from '../../../services/raw-amount';
import { Uniswap } from '../uniswap';
import { UniswapConfig } from '../uniswap.config';
import { formatTokenAmount } from '../uniswap.utils';
Expand Down Expand Up @@ -39,17 +40,11 @@ async function quoteAmmSwap(
let trade;
if (exactIn) {
// For SELL (exactIn), we use the input amount and EXACT_INPUT trade type
const inputAmount = CurrencyAmount.fromRawAmount(
inputToken,
Math.floor(amount * Math.pow(10, inputToken.decimals)).toString(),
);
const inputAmount = CurrencyAmount.fromRawAmount(inputToken, toRawAmount(amount, inputToken.decimals));
trade = new V2Trade(route, inputAmount, TradeType.EXACT_INPUT);
} else {
// For BUY (exactOut), we use the output amount and EXACT_OUTPUT trade type
const outputAmount = CurrencyAmount.fromRawAmount(
outputToken,
Math.floor(amount * Math.pow(10, outputToken.decimals)).toString(),
);
const outputAmount = CurrencyAmount.fromRawAmount(outputToken, toRawAmount(amount, outputToken.decimals));
trade = new V2Trade(route, outputAmount, TradeType.EXACT_OUTPUT);
}

Expand Down
15 changes: 7 additions & 8 deletions src/connectors/uniswap/clmm-routes/addLiquidity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Ethereum } from '../../../chains/ethereum/ethereum';
import { TransactionStatus } from '../../../schemas/chain-schema';
import { AddLiquidityResponseType } from '../../../schemas/clmm-schema';
import { httpErrors } from '../../../services/error-handler';
import { toRawAmount } from '../../../services/raw-amount';
import { Uniswap } from '../uniswap';
import { UniswapConfig } from '../uniswap.config';
import { getUniswapV3NftManagerAddress, POSITION_MANAGER_ABI, getUniswapV3FactoryAddress } from '../uniswap.contracts';
Expand Down Expand Up @@ -69,22 +70,20 @@ export async function addLiquidity(
let token1Amount = CurrencyAmount.fromRawAmount(token1, 0);

if (baseTokenAmount !== undefined) {
const baseAmountRaw = Math.floor(baseTokenAmount * Math.pow(10, isBaseToken0 ? token0.decimals : token1.decimals));
const baseAmountRaw = toRawAmount(baseTokenAmount, isBaseToken0 ? token0.decimals : token1.decimals);
if (isBaseToken0) {
token0Amount = CurrencyAmount.fromRawAmount(token0, JSBI.BigInt(baseAmountRaw.toString()));
token0Amount = CurrencyAmount.fromRawAmount(token0, JSBI.BigInt(baseAmountRaw));
} else {
token1Amount = CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(baseAmountRaw.toString()));
token1Amount = CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(baseAmountRaw));
}
}

if (quoteTokenAmount !== undefined) {
const quoteAmountRaw = Math.floor(
quoteTokenAmount * Math.pow(10, isBaseToken0 ? token1.decimals : token0.decimals),
);
const quoteAmountRaw = toRawAmount(quoteTokenAmount, isBaseToken0 ? token1.decimals : token0.decimals);
if (isBaseToken0) {
token1Amount = CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(quoteAmountRaw.toString()));
token1Amount = CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(quoteAmountRaw));
} else {
token0Amount = CurrencyAmount.fromRawAmount(token0, JSBI.BigInt(quoteAmountRaw.toString()));
token0Amount = CurrencyAmount.fromRawAmount(token0, JSBI.BigInt(quoteAmountRaw));
}
}

Expand Down
13 changes: 7 additions & 6 deletions src/connectors/uniswap/clmm-routes/openPosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { TransactionStatus } from '../../../schemas/chain-schema';
import { OpenPositionResponseType } from '../../../schemas/clmm-schema';
import { httpErrors } from '../../../services/error-handler';
import { logger } from '../../../services/logger';
import { toRawAmount } from '../../../services/raw-amount';
import { sanitizeErrorMessage } from '../../../services/sanitize';
import { Uniswap } from '../uniswap';
import { UniswapConfig } from '../uniswap.config';
Expand Down Expand Up @@ -99,20 +100,20 @@ export async function openPosition(
let token1Amount = CurrencyAmount.fromRawAmount(token1, 0);

if (baseTokenAmount !== undefined) {
const baseAmountRaw = Math.floor(baseTokenAmount * Math.pow(10, baseTokenObj.decimals));
const baseAmountRaw = toRawAmount(baseTokenAmount, baseTokenObj.decimals);
if (isBaseToken0) {
token0Amount = CurrencyAmount.fromRawAmount(token0, JSBI.BigInt(baseAmountRaw.toString()));
token0Amount = CurrencyAmount.fromRawAmount(token0, JSBI.BigInt(baseAmountRaw));
} else {
token1Amount = CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(baseAmountRaw.toString()));
token1Amount = CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(baseAmountRaw));
}
}

if (quoteTokenAmount !== undefined) {
const quoteAmountRaw = Math.floor(quoteTokenAmount * Math.pow(10, quoteTokenObj.decimals));
const quoteAmountRaw = toRawAmount(quoteTokenAmount, quoteTokenObj.decimals);
if (isBaseToken0) {
token1Amount = CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(quoteAmountRaw.toString()));
token1Amount = CurrencyAmount.fromRawAmount(token1, JSBI.BigInt(quoteAmountRaw));
} else {
token0Amount = CurrencyAmount.fromRawAmount(token0, JSBI.BigInt(quoteAmountRaw.toString()));
token0Amount = CurrencyAmount.fromRawAmount(token0, JSBI.BigInt(quoteAmountRaw));
}
}

Expand Down
9 changes: 5 additions & 4 deletions src/connectors/uniswap/clmm-routes/quotePosition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import JSBI from 'jsbi';

import { QuotePositionResponseType } from '../../../schemas/clmm-schema';
import { httpErrors } from '../../../services/error-handler';
import { toRawAmount } from '../../../services/raw-amount';
import { sanitizeErrorMessage } from '../../../services/sanitize';
import { Uniswap } from '../uniswap';
import { getUniswapPoolInfo } from '../uniswap.utils';
Expand Down Expand Up @@ -81,8 +82,8 @@ export async function quotePosition(

if (baseTokenAmount !== undefined && quoteTokenAmount !== undefined) {
// Both amounts provided - use fromAmounts to calculate optimal position
const baseAmountRaw = JSBI.BigInt(Math.floor(baseTokenAmount * Math.pow(10, baseTokenObj.decimals)).toString());
const quoteAmountRaw = JSBI.BigInt(Math.floor(quoteTokenAmount * Math.pow(10, quoteTokenObj.decimals)).toString());
const baseAmountRaw = JSBI.BigInt(toRawAmount(baseTokenAmount, baseTokenObj.decimals));
const quoteAmountRaw = JSBI.BigInt(toRawAmount(quoteTokenAmount, quoteTokenObj.decimals));

// Create position from both amounts
if (isBaseToken0) {
Expand Down Expand Up @@ -115,7 +116,7 @@ export async function quotePosition(
baseLimited = baseRatio <= quoteRatio;
} else if (baseTokenAmount !== undefined) {
// Only base amount provided
const baseAmountRaw = JSBI.BigInt(Math.floor(baseTokenAmount * Math.pow(10, baseTokenObj.decimals)).toString());
const baseAmountRaw = JSBI.BigInt(toRawAmount(baseTokenAmount, baseTokenObj.decimals));

if (isBaseToken0) {
position = Position.fromAmount0({
Expand All @@ -136,7 +137,7 @@ export async function quotePosition(
baseLimited = true;
} else if (quoteTokenAmount !== undefined) {
// Only quote amount provided
const quoteAmountRaw = JSBI.BigInt(Math.floor(quoteTokenAmount * Math.pow(10, quoteTokenObj.decimals)).toString());
const quoteAmountRaw = JSBI.BigInt(toRawAmount(quoteTokenAmount, quoteTokenObj.decimals));

if (isBaseToken0) {
position = Position.fromAmount1({
Expand Down
Loading