From 7fbda720753bfa7375f9ec272a9daaa4e77fdaa2 Mon Sep 17 00:00:00 2001 From: JustJousting Date: Thu, 13 Nov 2025 03:09:53 +0200 Subject: [PATCH 1/7] feat: set up fxswap pool deployment --- .../Parameters/SelectPreset.tsx | 147 ++++++++---------- .../PageCreatePool/PoolType/index.tsx | 11 +- .../Summary/PoolTypeSummary.tsx | 8 +- .../PageCreatePool/Summary/index.tsx | 2 +- .../PageCreatePool/TokensInPool/index.tsx | 2 + .../components/PageCreatePool/constants.ts | 9 +- .../dex/components/PageCreatePool/types.ts | 3 +- .../dex/components/PageCreatePool/utils.ts | 4 +- .../src/dex/store/createCreatePoolSlice.ts | 84 +++++++++- 9 files changed, 173 insertions(+), 97 deletions(-) diff --git a/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx b/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx index 12003694ae..6244aa50b9 100644 --- a/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx +++ b/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx @@ -2,7 +2,7 @@ import { Dispatch, SetStateAction, useEffect, useRef, useState } from 'react' import { styled } from 'styled-components' import SelectButton from '@/dex/components/PageCreatePool/components/SelectButton' import ModalDialog from '@/dex/components/PageCreatePool/ConfirmModal/ModalDialog' -import { CRYPTOSWAP, POOL_PRESETS, STABLESWAP } from '@/dex/components/PageCreatePool/constants' +import { CRYPTOSWAP, FXSWAP, POOL_PRESETS, STABLESWAP } from '@/dex/components/PageCreatePool/constants' import useStore from '@/dex/store/useStore' import type { UrlParams } from '@/dex/types/main.types' import { getPath } from '@/dex/utils/utilsRouter' @@ -122,86 +122,71 @@ const SelectPreset = ({ setStableFeeValue, setMidValue, setOutValue }: Props) => )} - {swapType === CRYPTOSWAP && tokenAmount === 2 && ( - <> - - { - updatePoolPresetIndex(3) - setMidValue(t(POOL_PRESETS[3].defaultParams.midFee)) - setOutValue(t(POOL_PRESETS[3].defaultParams.outFee)) - overlayTriggerState.close() - }} - paddingSize={'small'} - /> - - - { - updatePoolPresetIndex(4) - setMidValue(t(POOL_PRESETS[4].defaultParams.midFee)) - setOutValue(t(POOL_PRESETS[4].defaultParams.outFee)) - overlayTriggerState.close() - }} - paddingSize={'small'} - /> - - - { - updatePoolPresetIndex(5) - setMidValue(t(POOL_PRESETS[5].defaultParams.midFee)) - setOutValue(t(POOL_PRESETS[5].defaultParams.outFee)) - overlayTriggerState.close() - }} - paddingSize={'small'} - /> - - - { - updatePoolPresetIndex(6) - setMidValue(t(POOL_PRESETS[6].defaultParams.midFee)) - setOutValue(t(POOL_PRESETS[6].defaultParams.outFee)) - overlayTriggerState.close() - }} - paddingSize={'small'} - /> - - - { - updatePoolPresetIndex(9) - setMidValue(t(POOL_PRESETS[9].defaultParams.midFee)) - setOutValue(t(POOL_PRESETS[9].defaultParams.outFee)) - overlayTriggerState.close() - }} - paddingSize={'small'} - disabled={true} // Coming soon! - /> - - - )} + {(swapType === CRYPTOSWAP && tokenAmount === 2) || + (swapType === FXSWAP && ( + <> + + { + updatePoolPresetIndex(3) + setMidValue(t(POOL_PRESETS[3].defaultParams.midFee)) + setOutValue(t(POOL_PRESETS[3].defaultParams.outFee)) + overlayTriggerState.close() + }} + paddingSize={'small'} + /> + + + { + updatePoolPresetIndex(4) + setMidValue(t(POOL_PRESETS[4].defaultParams.midFee)) + setOutValue(t(POOL_PRESETS[4].defaultParams.outFee)) + overlayTriggerState.close() + }} + paddingSize={'small'} + /> + + + { + updatePoolPresetIndex(5) + setMidValue(t(POOL_PRESETS[5].defaultParams.midFee)) + setOutValue(t(POOL_PRESETS[5].defaultParams.outFee)) + overlayTriggerState.close() + }} + paddingSize={'small'} + /> + + + { + updatePoolPresetIndex(6) + setMidValue(t(POOL_PRESETS[6].defaultParams.midFee)) + setOutValue(t(POOL_PRESETS[6].defaultParams.outFee)) + overlayTriggerState.close() + }} + paddingSize={'small'} + /> + + + ))} {swapType === CRYPTOSWAP && tokenAmount === 3 && ( <> diff --git a/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx b/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx index 6bb0084bab..74e5668a37 100644 --- a/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx +++ b/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx @@ -1,6 +1,6 @@ import { styled } from 'styled-components' import SelectButton from '@/dex/components/PageCreatePool/components/SelectButton' -import { STABLESWAP, CRYPTOSWAP } from '@/dex/components/PageCreatePool/constants' +import { STABLESWAP, CRYPTOSWAP, FXSWAP } from '@/dex/components/PageCreatePool/constants' import { useNetworkByChain } from '@/dex/entities/networks' import useStore from '@/dex/store/useStore' import { ChainId } from '@/dex/types/main.types' @@ -49,6 +49,15 @@ const PoolType = ({ chainId }: Props) => { {t`Cryptoswap pools are currently unavailable on this chain`} )} + + updateSwapType(FXSWAP, chainId)} + /> + diff --git a/apps/main/src/dex/components/PageCreatePool/Summary/PoolTypeSummary.tsx b/apps/main/src/dex/components/PageCreatePool/Summary/PoolTypeSummary.tsx index 9a756f993f..de5e79441c 100644 --- a/apps/main/src/dex/components/PageCreatePool/Summary/PoolTypeSummary.tsx +++ b/apps/main/src/dex/components/PageCreatePool/Summary/PoolTypeSummary.tsx @@ -1,5 +1,5 @@ import { styled } from 'styled-components' -import { CRYPTOSWAP } from '@/dex/components/PageCreatePool/constants' +import { CRYPTOSWAP, FXSWAP } from '@/dex/components/PageCreatePool/constants' import { CategoryColumn, SummaryData, @@ -27,7 +27,11 @@ const PoolTypeSummary = () => { {t`No pool type selected`} ) : ( - {swapType === CRYPTOSWAP ? t`Cryptoswap` : t`Stableswap${metaPoolToken ? '-Meta' : ''}`} + {swapType === FXSWAP + ? t`FXSwap` + : swapType === CRYPTOSWAP + ? t`Cryptoswap` + : t`Stableswap${metaPoolToken ? '-Meta' : ''}`} )} diff --git a/apps/main/src/dex/components/PageCreatePool/Summary/index.tsx b/apps/main/src/dex/components/PageCreatePool/Summary/index.tsx index 6a647e0271..de82705ca8 100644 --- a/apps/main/src/dex/components/PageCreatePool/Summary/index.tsx +++ b/apps/main/src/dex/components/PageCreatePool/Summary/index.tsx @@ -75,7 +75,7 @@ const TopBox = styled(Box)` const SummaryBox = styled(Box)` padding: var(--spacing-normal); - background: var(--box_header--secondary--background-color); + background: var(--box--primary--content--background-color); ` const BottomBox = styled(Box)` diff --git a/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx b/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx index 8d8f3f2747..3c22f785e8 100644 --- a/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx +++ b/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx @@ -14,6 +14,7 @@ import { TOKEN_F, TOKEN_G, TOKEN_H, + FXSWAP, } from '@/dex/components/PageCreatePool/constants' import SelectToken from '@/dex/components/PageCreatePool/TokensInPool/SelectToken' import SetOracle from '@/dex/components/PageCreatePool/TokensInPool/SetOracle' @@ -783,6 +784,7 @@ const TokensInPool = ({ curve, chainId, haveSigner }: Props) => { onClick={addToken} variant="filled" disabled={ + swapType === FXSWAP || (swapType === STABLESWAP && stableswapFactory && tokensInPool.tokenAmount === 8) || (swapType === STABLESWAP && !stableswapFactory && tokensInPool.tokenAmount === 4) || (swapType === STABLESWAP && tokensInPool.metaPoolToken) || diff --git a/apps/main/src/dex/components/PageCreatePool/constants.ts b/apps/main/src/dex/components/PageCreatePool/constants.ts index 4c3d4e9ea0..5e5e13b348 100644 --- a/apps/main/src/dex/components/PageCreatePool/constants.ts +++ b/apps/main/src/dex/components/PageCreatePool/constants.ts @@ -3,6 +3,7 @@ import { t } from '@ui-kit/lib/i18n' export const CRYPTOSWAP = 'Cryptoswap' export const STABLESWAP = 'Stableswap' +export const FXSWAP = 'FXSwap' export const TOKEN_A = 'tokenA' export const TOKEN_B = 'tokenB' export const TOKEN_C = 'tokenC' @@ -185,14 +186,6 @@ export const POOL_PRESETS: PRESETS = { maHalfTime: '600', }, }, - 9: { - name: 'FXSwap', - descriptionName: t`FXSwap (Coming soon!)`, - description: t`Suitable for forex tokens with low volatility`, - defaultParams: { - ...fillerParams, - }, - }, } // MIN-MAX PARAMS diff --git a/apps/main/src/dex/components/PageCreatePool/types.ts b/apps/main/src/dex/components/PageCreatePool/types.ts index 2b0b5e958e..b84d1ca521 100644 --- a/apps/main/src/dex/components/PageCreatePool/types.ts +++ b/apps/main/src/dex/components/PageCreatePool/types.ts @@ -1,6 +1,7 @@ import { CRYPTOSWAP, STABLESWAP, + FXSWAP, TOKEN_A, TOKEN_B, TOKEN_C, @@ -45,7 +46,7 @@ export type SelectTokenFormValues = { [TOKEN_H]: TokenState } -export type SwapType = typeof CRYPTOSWAP | typeof STABLESWAP | '' +export type SwapType = typeof CRYPTOSWAP | typeof STABLESWAP | typeof FXSWAP | '' export type NgAssetType = 0 | 1 | 2 | 3 export type TokenId = | typeof TOKEN_A diff --git a/apps/main/src/dex/components/PageCreatePool/utils.ts b/apps/main/src/dex/components/PageCreatePool/utils.ts index 01850280b2..9241917c4c 100644 --- a/apps/main/src/dex/components/PageCreatePool/utils.ts +++ b/apps/main/src/dex/components/PageCreatePool/utils.ts @@ -1,5 +1,5 @@ import { isAddress } from 'viem' -import { STABLESWAP, CRYPTOSWAP } from '@/dex/components/PageCreatePool/constants' +import { STABLESWAP, CRYPTOSWAP, FXSWAP } from '@/dex/components/PageCreatePool/constants' import type { SwapType, TokenState } from '@/dex/components/PageCreatePool/types' import { BasePool } from '@/dex/types/main.types' export const checkSwapType = (swapType: SwapType) => swapType !== '' @@ -66,7 +66,7 @@ export const checkParameters = ( ) => { if (poolPresetIndex === null) return false if (swapType === STABLESWAP) return stableSwapFee !== null - if (swapType === CRYPTOSWAP) { + if (swapType === CRYPTOSWAP || swapType === FXSWAP) { if (isTricrypto(tricryptoEnabled, tokenAmount, tokenA, tokenB, tokenC)) return midFee !== null && initialPrice[0] !== '0' && initialPrice[1] !== '0' return midFee !== null && initialPrice[0] !== '0' diff --git a/apps/main/src/dex/store/createCreatePoolSlice.ts b/apps/main/src/dex/store/createCreatePoolSlice.ts index 31c1545279..d182cf8f09 100644 --- a/apps/main/src/dex/store/createCreatePoolSlice.ts +++ b/apps/main/src/dex/store/createCreatePoolSlice.ts @@ -7,6 +7,7 @@ import { CRYPTOSWAP, POOL_PRESETS, STABLESWAP, + FXSWAP, TOKEN_A, TOKEN_B, TOKEN_C, @@ -20,6 +21,7 @@ import { CreateToken, NgAssetType, SwapType, TokenId, TokenState } from '@/dex/c import { isTricrypto } from '@/dex/components/PageCreatePool/utils' import type { State } from '@/dex/store/useStore' import { ChainId, CurveApi } from '@/dex/types/main.types' +import { TwoCryptoImplementation } from '@curvefi/api/lib/constants/twoCryptoImplementations' import { scanTxPath } from '@ui/utils' import { notify } from '@ui-kit/features/connect-wallet' import { t } from '@ui-kit/lib/i18n' @@ -786,7 +788,87 @@ const createCreatePoolSlice = ( ) const networks = await fetchNetworks() - if (swapType === CRYPTOSWAP) { + if (swapType === FXSWAP) { + // ----- FXSWAP ----- + const coins = [tokenA.address, tokenB.address] + + try { + const maExpTime = Math.round(+maHalfTime / 0.693) + + const deployPoolTx = await curve.twocryptoFactory.deployPool( + poolName, + poolSymbol, + coins, + cryptoA, + gamma, + midFee, + outFee, + allowedExtraProfit, + feeGamma, + adjustmentStep, + maExpTime, + initialPrice.initialPrice[0], + TwoCryptoImplementation.FX_REGULAR_50_PERCENT, + ) + + set( + produce((state) => { + state.createPool.transactionState.txStatus = 'LOADING' + state.createPool.transactionState.transaction = deployPoolTx + state.createPool.transactionState.txLink = scanTxPath(networks[chainId], deployPoolTx.hash) + }), + ) + + // set up deploying message + dismissConfirm() + const deployingNotificationMessage = t`Deploying pool ${poolName}...` + const { dismiss: dismissDeploying } = notify(deployingNotificationMessage, 'pending') + dismissNotificationHandler = dismissDeploying + + const poolAddress = await curve.twocryptoFactory.getDeployedPoolAddress(deployPoolTx) + // deploy pool tx success + set( + produce((state) => { + state.createPool.transactionState.txStatus = 'SUCCESS' + state.createPool.transactionState.txSuccess = true + state.createPool.transactionState.fetchPoolStatus = 'LOADING' + state.createPool.transactionState.poolAddress = poolAddress + }), + ) + + // set up success message + dismissDeploying() + const successNotificationMessage = t`Pool ${poolName} deployment successful.` + notify(successNotificationMessage, 'success', 15000) + + const poolId = await curve.twocryptoFactory.fetchRecentlyDeployedPool(poolAddress) + set( + produce((state) => { + state.createPool.transactionState.poolId = poolId + }), + ) + + const poolData = await fetchNewPool(curve, poolId) + if (poolData) { + set( + produce((state) => { + state.createPool.transactionState.fetchPoolStatus = 'SUCCESS' + state.createPool.transactionState.lpTokenAddress = poolData.pool.lpToken + }), + ) + } + } catch (error) { + if (typeof dismissNotificationHandler === 'function') { + dismissNotificationHandler() + } + set( + produce((state) => { + state.createPool.transactionState.txStatus = 'ERROR' + state.createPool.transactionState.errorMessage = error.message + }), + ) + } + } else if (swapType === CRYPTOSWAP) { // ----- TRICRYPTO ----- if (isTricrypto(networks[chainId].tricryptoFactory, tokenAmount, tokenA, tokenB, tokenC)) { const coins = [tokenA.address, tokenB.address, tokenC.address] From 383a15864db9109dfee552629dbae9b43406810d Mon Sep 17 00:00:00 2001 From: JustJousting Date: Fri, 14 Nov 2025 15:43:15 +0200 Subject: [PATCH 2/7] feat: add fxswap preset --- .../Parameters/SelectPreset.tsx | 184 ++++++++++-------- .../PageCreatePool/TokensInPool/index.tsx | 2 +- .../components/PageCreatePool/constants.ts | 17 ++ 3 files changed, 125 insertions(+), 78 deletions(-) diff --git a/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx b/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx index 6244aa50b9..14560d00e4 100644 --- a/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx +++ b/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx @@ -122,71 +122,70 @@ const SelectPreset = ({ setStableFeeValue, setMidValue, setOutValue }: Props) => )} - {(swapType === CRYPTOSWAP && tokenAmount === 2) || - (swapType === FXSWAP && ( - <> - - { - updatePoolPresetIndex(3) - setMidValue(t(POOL_PRESETS[3].defaultParams.midFee)) - setOutValue(t(POOL_PRESETS[3].defaultParams.outFee)) - overlayTriggerState.close() - }} - paddingSize={'small'} - /> - - - { - updatePoolPresetIndex(4) - setMidValue(t(POOL_PRESETS[4].defaultParams.midFee)) - setOutValue(t(POOL_PRESETS[4].defaultParams.outFee)) - overlayTriggerState.close() - }} - paddingSize={'small'} - /> - - - { - updatePoolPresetIndex(5) - setMidValue(t(POOL_PRESETS[5].defaultParams.midFee)) - setOutValue(t(POOL_PRESETS[5].defaultParams.outFee)) - overlayTriggerState.close() - }} - paddingSize={'small'} - /> - - - { - updatePoolPresetIndex(6) - setMidValue(t(POOL_PRESETS[6].defaultParams.midFee)) - setOutValue(t(POOL_PRESETS[6].defaultParams.outFee)) - overlayTriggerState.close() - }} - paddingSize={'small'} - /> - - - ))} + {swapType === CRYPTOSWAP && tokenAmount === 2 && ( + <> + + { + updatePoolPresetIndex(3) + setMidValue(t(POOL_PRESETS[3].defaultParams.midFee)) + setOutValue(t(POOL_PRESETS[3].defaultParams.outFee)) + overlayTriggerState.close() + }} + paddingSize={'small'} + /> + + + { + updatePoolPresetIndex(4) + setMidValue(t(POOL_PRESETS[4].defaultParams.midFee)) + setOutValue(t(POOL_PRESETS[4].defaultParams.outFee)) + overlayTriggerState.close() + }} + paddingSize={'small'} + /> + + + { + updatePoolPresetIndex(5) + setMidValue(t(POOL_PRESETS[5].defaultParams.midFee)) + setOutValue(t(POOL_PRESETS[5].defaultParams.outFee)) + overlayTriggerState.close() + }} + paddingSize={'small'} + /> + + + { + updatePoolPresetIndex(6) + setMidValue(t(POOL_PRESETS[6].defaultParams.midFee)) + setOutValue(t(POOL_PRESETS[6].defaultParams.outFee)) + overlayTriggerState.close() + }} + paddingSize={'small'} + /> + + + )} {swapType === CRYPTOSWAP && tokenAmount === 3 && ( <> @@ -221,18 +220,49 @@ const SelectPreset = ({ setStableFeeValue, setMidValue, setOutValue }: Props) => )} - - {t`Can't find the pool preset you want? Check out`} - {t`existing pools`} - {t`with similar assets for inspiration (or use`} - - curvesim - - {t`to sim).`} - + {swapType === FXSWAP && tokenAmount === 2 && ( + <> + + { + updatePoolPresetIndex(9) + setMidValue(t(POOL_PRESETS[9].defaultParams.midFee)) + setOutValue(t(POOL_PRESETS[9].defaultParams.outFee)) + overlayTriggerState.close() + }} + paddingSize={'small'} + /> + + + )} + {swapType !== FXSWAP ? ( + + {t`Can't find the pool preset you want? Check out`} + {t`existing pools`} + {t`with similar assets for inspiration (or use`} + + curvesim + + {t`to sim).`} + + ) : ( + + {t`FXSwap pools are experimental and still evolving. Can't find the right preset?`} + + {t`Reach out to the team.`} + + + )} )} diff --git a/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx b/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx index 3c22f785e8..375fb53db3 100644 --- a/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx +++ b/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx @@ -774,7 +774,7 @@ const TokensInPool = ({ curve, chainId, haveSigner }: Props) => { ) : ( -

{t`Rebasing tokens are not supported in ${CRYPTOSWAP} pools`}

+

{t`Rebasing tokens are not supported in ${swapType === CRYPTOSWAP ? CRYPTOSWAP : FXSWAP} pools`}

)} diff --git a/apps/main/src/dex/components/PageCreatePool/constants.ts b/apps/main/src/dex/components/PageCreatePool/constants.ts index 5e5e13b348..f81f66d4e6 100644 --- a/apps/main/src/dex/components/PageCreatePool/constants.ts +++ b/apps/main/src/dex/components/PageCreatePool/constants.ts @@ -186,6 +186,23 @@ export const POOL_PRESETS: PRESETS = { maHalfTime: '600', }, }, + // fxswap + 9: { + name: 'FXSwap', + descriptionName: t`FXSwap`, + description: t`Suitable for FX swaps`, + defaultParams: { + ...fillerParams, + midFee: '0.25', // 25/10_000 * 10**10 (25 bps) + outFee: '0.50', // 50/10_000 * 10**10 (50 bps) + cryptoA: '100000', // 10 * 10000 + gamma: '0.0001', // 10**14 (irrelevant for fx pools) + allowedExtraProfit: '0.000000000001', // 1e-12 * 10**18 + feeGamma: '0.001', // 0.001 * 1e18 + adjustmentStep: '0.0000001', // 1e-7 * 1e18 + maHalfTime: '600', // 866 * 0.693 (half life in seconds) + }, + }, } // MIN-MAX PARAMS From 76f25bfb1e8d5e4480d19b2caeef816e88534a95 Mon Sep 17 00:00:00 2001 From: JustJousting Date: Sat, 15 Nov 2025 15:28:36 +0200 Subject: [PATCH 3/7] feat: update FXSwap descriptions --- apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx | 2 +- apps/main/src/dex/components/PageCreatePool/constants.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx b/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx index 74e5668a37..002aeca274 100644 --- a/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx +++ b/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx @@ -54,7 +54,7 @@ const PoolType = ({ chainId }: Props) => { selected={swapType === FXSWAP} name={FXSWAP} descriptionName={t`FXSwap`} - description={t`We love Forex innit?!`} + description={t`Suitable for forex tokens with low volatility`} handleClick={() => updateSwapType(FXSWAP, chainId)} /> diff --git a/apps/main/src/dex/components/PageCreatePool/constants.ts b/apps/main/src/dex/components/PageCreatePool/constants.ts index f81f66d4e6..7637435d36 100644 --- a/apps/main/src/dex/components/PageCreatePool/constants.ts +++ b/apps/main/src/dex/components/PageCreatePool/constants.ts @@ -190,7 +190,7 @@ export const POOL_PRESETS: PRESETS = { 9: { name: 'FXSwap', descriptionName: t`FXSwap`, - description: t`Suitable for FX swaps`, + description: t`Suitable for forex tokens with low volatility`, defaultParams: { ...fillerParams, midFee: '0.25', // 25/10_000 * 10**10 (25 bps) From 2b57c7cc41a45b0d098571abd7b67cc0573fe54d Mon Sep 17 00:00:00 2001 From: JustJousting Date: Mon, 17 Nov 2025 14:10:52 +0200 Subject: [PATCH 4/7] feat: limit fxswap to mainnet, base and bsc --- .../main/src/dex/components/PageCreatePool/PoolType/index.tsx | 3 ++- apps/main/src/dex/constants.ts | 1 + apps/main/src/dex/lib/networks.ts | 4 ++++ apps/main/src/dex/types/main.types.ts | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx b/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx index 002aeca274..60d635b743 100644 --- a/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx +++ b/apps/main/src/dex/components/PageCreatePool/PoolType/index.tsx @@ -15,7 +15,7 @@ const PoolType = ({ chainId }: Props) => { const swapType = useStore((state) => state.createPool.swapType) const updateSwapType = useStore((state) => state.createPool.updateSwapType) const { - data: { stableswapFactory, tricryptoFactory, twocryptoFactory }, + data: { stableswapFactory, tricryptoFactory, twocryptoFactory, fxswapFactory }, } = useNetworkByChain({ chainId }) return ( @@ -51,6 +51,7 @@ const PoolType = ({ chainId }: Props) => { { twocryptoFactoryOld: boolean twocryptoFactory: boolean tricryptoFactory: boolean + fxswapFactory: boolean hasFactory: boolean pricesApi: boolean } From e5b2d767bc60f179a97b2541a7503e5a9734dfdc Mon Sep 17 00:00:00 2001 From: JustJousting Date: Mon, 17 Nov 2025 14:11:51 +0200 Subject: [PATCH 5/7] fix: cleanup merge --- apps/main/src/dex/components/PageCreatePool/constants.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apps/main/src/dex/components/PageCreatePool/constants.ts b/apps/main/src/dex/components/PageCreatePool/constants.ts index 7b3745e392..7637435d36 100644 --- a/apps/main/src/dex/components/PageCreatePool/constants.ts +++ b/apps/main/src/dex/components/PageCreatePool/constants.ts @@ -201,14 +201,6 @@ export const POOL_PRESETS: PRESETS = { feeGamma: '0.001', // 0.001 * 1e18 adjustmentStep: '0.0000001', // 1e-7 * 1e18 maHalfTime: '600', // 866 * 0.693 (half life in seconds) - midFee: '0.25', // 25/10_000 * 10**10 (25 bps) - outFee: '0.50', // 50/10_000 * 10**10 (50 bps) - cryptoA: '100000', // 10 * 10000 - gamma: '0.0001', // 10**14 (irrelevant for fx pools) - allowedExtraProfit: '0.000000000001', // 1e-12 * 10**18 - feeGamma: '0.001', // 0.001 * 1e18 - adjustmentStep: '0.0000001', // 1e-7 * 1e18 - maHalfTime: '600', // 866 * 0.693 (half life in seconds) }, }, } From bdc5518124ffc8a8ee9e7f51c06c90e9730dbf8e Mon Sep 17 00:00:00 2001 From: JustJousting Date: Mon, 17 Nov 2025 17:25:51 +0200 Subject: [PATCH 6/7] fix: don't use double negative --- .../Parameters/SelectPreset.tsx | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx b/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx index 14560d00e4..b2260f69b9 100644 --- a/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx +++ b/apps/main/src/dex/components/PageCreatePool/Parameters/SelectPreset.tsx @@ -239,7 +239,17 @@ const SelectPreset = ({ setStableFeeValue, setMidValue, setOutValue }: Props) => )} - {swapType !== FXSWAP ? ( + {swapType === FXSWAP ? ( + + {t`FXSwap pools are experimental and still evolving. Can't find the right preset?`} + + {t`Reach out to the team.`} + + + ) : ( {t`Can't find the pool preset you want? Check out`} {t`to sim).`} - ) : ( - - {t`FXSwap pools are experimental and still evolving. Can't find the right preset?`} - - {t`Reach out to the team.`} - - )} From 29bf37631c772c8b9bc6ac816951f401e723c628 Mon Sep 17 00:00:00 2001 From: JustJousting Date: Mon, 17 Nov 2025 17:55:34 +0200 Subject: [PATCH 7/7] refactor: review comments --- .../components/PageCreatePool/Summary/PoolTypeSummary.tsx | 8 ++------ .../dex/components/PageCreatePool/TokensInPool/index.tsx | 2 +- apps/main/src/dex/lib/networks.ts | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/apps/main/src/dex/components/PageCreatePool/Summary/PoolTypeSummary.tsx b/apps/main/src/dex/components/PageCreatePool/Summary/PoolTypeSummary.tsx index de5e79441c..3f43649dda 100644 --- a/apps/main/src/dex/components/PageCreatePool/Summary/PoolTypeSummary.tsx +++ b/apps/main/src/dex/components/PageCreatePool/Summary/PoolTypeSummary.tsx @@ -1,5 +1,5 @@ import { styled } from 'styled-components' -import { CRYPTOSWAP, FXSWAP } from '@/dex/components/PageCreatePool/constants' +import { STABLESWAP } from '@/dex/components/PageCreatePool/constants' import { CategoryColumn, SummaryData, @@ -27,11 +27,7 @@ const PoolTypeSummary = () => { {t`No pool type selected`} ) : ( - {swapType === FXSWAP - ? t`FXSwap` - : swapType === CRYPTOSWAP - ? t`Cryptoswap` - : t`Stableswap${metaPoolToken ? '-Meta' : ''}`} + {swapType === STABLESWAP ? t`${swapType}${metaPoolToken ? '-Meta' : ''}` : swapType} )} diff --git a/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx b/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx index 375fb53db3..54cbc6ce8f 100644 --- a/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx +++ b/apps/main/src/dex/components/PageCreatePool/TokensInPool/index.tsx @@ -774,7 +774,7 @@ const TokensInPool = ({ curve, chainId, haveSigner }: Props) => { ) : ( -

{t`Rebasing tokens are not supported in ${swapType === CRYPTOSWAP ? CRYPTOSWAP : FXSWAP} pools`}

+

{t`Rebasing tokens are not supported in ${swapType} pools`}

)} diff --git a/apps/main/src/dex/lib/networks.ts b/apps/main/src/dex/lib/networks.ts index a09394287d..2aaac74a24 100644 --- a/apps/main/src/dex/lib/networks.ts +++ b/apps/main/src/dex/lib/networks.ts @@ -378,7 +378,7 @@ export async function getNetworks() { stableswapFactory: true, twocryptoFactory: true, tricryptoFactory: true, - fxswapFactory: true, + fxswapFactory: false, pricesApi: isUpgraded, isLite: !isUpgraded, isCrvRewardsEnabled: isUpgraded,