diff --git a/src/components/organisms/AssetActions/Pool/index.tsx b/src/components/organisms/AssetActions/Pool/index.tsx index e86c89b2c..ab080a8ab 100644 --- a/src/components/organisms/AssetActions/Pool/index.tsx +++ b/src/components/organisms/AssetActions/Pool/index.tsx @@ -73,7 +73,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { const totalLiquidityInOcean = price?.ocean + price?.datatoken * price?.value useEffect(() => { - if (!ocean || !accountId || !price || !price.value) return + if (!ocean || !accountId || !price) return async function init() { try { diff --git a/src/components/organisms/AssetContent/Pricing/FormPricing/Dynamic.tsx b/src/components/organisms/AssetContent/Pricing/FormPricing/Dynamic.tsx index d96655b95..2912ba49d 100644 --- a/src/components/organisms/AssetContent/Pricing/FormPricing/Dynamic.tsx +++ b/src/components/organisms/AssetContent/Pricing/FormPricing/Dynamic.tsx @@ -42,6 +42,8 @@ export default function Dynamic({ // Calculate firstPrice whenever user values change useEffect(() => { + if (`${oceanAmount}` === '') return + const tokenAmountOut = 1 const weightRatio = new Decimal(weightOnDataToken).div( new Decimal(weightOnOcean) diff --git a/src/models/FormPricing.ts b/src/models/FormPricing.ts index faf794eb5..707dc1072 100644 --- a/src/models/FormPricing.ts +++ b/src/models/FormPricing.ts @@ -22,9 +22,9 @@ export const validationSchema = Yup.object().shape({ export const initialValues: PriceOptionsMarket = { price: 1, type: 'dynamic', - dtAmount: 9, - oceanAmount: 1, - weightOnOcean: '1', // 10% on OCEAN - weightOnDataToken: '9', // 90% on datatoken + dtAmount: 10, + oceanAmount: 10, + weightOnOcean: '5', // 50% on OCEAN + weightOnDataToken: '5', // 50% on datatoken swapFee: 0.1 // in % }