From 62411f62661d6750ddf22a5e44a8f75985324fe3 Mon Sep 17 00:00:00 2001 From: DonDuala Date: Wed, 28 Aug 2024 14:57:02 -0400 Subject: [PATCH] rename _AtomsPerToken --- client/ts/src/client.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/ts/src/client.ts b/client/ts/src/client.ts index 171610c2a..4eca9ae84 100644 --- a/client/ts/src/client.ts +++ b/client/ts/src/client.ts @@ -495,18 +495,18 @@ function toWrapperPlaceOrderParams( market: Market, wrapperPlaceOrderParamsExternal: WrapperPlaceOrderParamsExternal, ): WrapperPlaceOrderParams { - const quoteAtoms = 10 ** market.quoteDecimals(); - const baseAtoms = 10 ** market.baseDecimals(); + const quoteAtomsPerToken = 10 ** market.quoteDecimals(); + const baseAtomsPerToken = 10 ** market.baseDecimals(); // Converts token price to atom price since not always equal // Ex. BONK/USDC = 0.00001854 USDC tokens/BONK tokens -> 0.0001854 USDC Atoms/BONK Atoms const priceQuoteAtomsPerBaseAtoms = - wrapperPlaceOrderParamsExternal.price * (quoteAtoms / baseAtoms); + wrapperPlaceOrderParamsExternal.price * (quoteAtomsPerToken / baseAtomsPerToken); // TODO: Make a helper and test it for this logic. const { priceMantissa, priceExponent } = toMantissaAndExponent( priceQuoteAtomsPerBaseAtoms, ); const numBaseAtoms: bignum = - wrapperPlaceOrderParamsExternal.numBaseTokens * baseAtoms; + wrapperPlaceOrderParamsExternal.numBaseTokens * baseAtomsPerToken; return { ...wrapperPlaceOrderParamsExternal,