diff --git a/content/pages/publish.json b/content/pages/publish.json index 1f397cd7a..fc78a6566 100644 --- a/content/pages/publish.json +++ b/content/pages/publish.json @@ -107,7 +107,7 @@ "info": "Let's create a decentralized, automated market for your data set. A Datatoken for this data set, worth the entered amount of OCEAN, will be created. Additionally, you will provide liquidity into a OCEAN/Datatoken liquidity pool with Balancer.", "tooltips": { "poolInfo": "Explain what is going on here...", - "liquidityProviderFee": "Explain liquidity provider fee...", + "swapFee": "Explain liquidity provider fee...", "communityFee": "Explain community fee...", "marketplaceFee": "Explain marketplace fee..." } diff --git a/src/@types/MetaData.d.ts b/src/@types/MetaData.d.ts index 8edf13e62..4dd9189da 100644 --- a/src/@types/MetaData.d.ts +++ b/src/@types/MetaData.d.ts @@ -21,7 +21,7 @@ export interface MetadataMarket extends Metadata { export interface PriceOptionsMarket extends PriceOptions { // easier to keep this as number for Yup input validation - liquidityProviderFee: number + swapFee: number // collect datatoken info for publishing datatoken?: DataTokenOptions } diff --git a/src/components/molecules/FormFields/Price/Fees.tsx b/src/components/molecules/FormFields/Price/Fees.tsx index 2e19db493..4f36df349 100644 --- a/src/components/molecules/FormFields/Price/Fees.tsx +++ b/src/components/molecules/FormFields/Price/Fees.tsx @@ -12,7 +12,7 @@ export default function Fees({ tooltips: { [key: string]: string } }): ReactElement { const { appConfig } = useSiteMetadata() - const [field, meta] = useField('price.liquidityProviderFee') + const [field, meta] = useField('price.swapFee') return ( <> @@ -21,7 +21,7 @@ export default function Fees({ label={ <> Liquidity Provider Fee - + } type="number" diff --git a/src/components/molecules/FormFields/Price/index.tsx b/src/components/molecules/FormFields/Price/index.tsx index e4116fc86..40da669c6 100644 --- a/src/components/molecules/FormFields/Price/index.tsx +++ b/src/components/molecules/FormFields/Price/index.tsx @@ -26,7 +26,7 @@ const query = graphql` info tooltips { poolInfo - liquidityProviderFee + swapFee communityFee marketplaceFee } diff --git a/src/components/organisms/AssetActions/Pool/Add.tsx b/src/components/organisms/AssetActions/Pool/Add.tsx index 0ab429b5d..8e2d5f519 100644 --- a/src/components/organisms/AssetActions/Pool/Add.tsx +++ b/src/components/organisms/AssetActions/Pool/Add.tsx @@ -16,13 +16,13 @@ export default function Add({ poolAddress, totalPoolTokens, totalBalance, - liquidityProviderFee + swapFee }: { setShowAdd: (show: boolean) => void poolAddress: string totalPoolTokens: string totalBalance: Balance - liquidityProviderFee: string + swapFee: string }): ReactElement { const { debug } = useUserPreferences() const { ocean, accountId, balance } = useOcean() @@ -105,7 +105,7 @@ export default function Add({

You will earn

diff --git a/src/components/organisms/AssetActions/Pool/index.tsx b/src/components/organisms/AssetActions/Pool/index.tsx index a3b2eb166..8cb1b2f1d 100644 --- a/src/components/organisms/AssetActions/Pool/index.tsx +++ b/src/components/organisms/AssetActions/Pool/index.tsx @@ -33,7 +33,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { const [totalBalance, setTotalBalance] = useState() const [dtSymbol, setDtSymbol] = useState() const [userBalance, setUserBalance] = useState() - const [liquidityProviderFee, setLiquidityProviderFee] = useState() + const [swapFee, setSwapFee] = useState() const [showAdd, setShowAdd] = useState(false) const [showRemove, setShowRemove] = useState(false) @@ -106,11 +106,11 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { setUserBalance(userBalance) // Get liquidity provider fee - const liquidityProviderFee = await ocean.pool.getSwapFee( + const swapFee = await ocean.pool.getSwapFee( accountId, price.address ) - setLiquidityProviderFee(liquidityProviderFee) + setSwapFee(swapFee) } catch (error) { console.error(error.message) } finally { @@ -130,7 +130,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement { poolAddress={price.address} totalPoolTokens={totalPoolTokens} totalBalance={totalBalance} - liquidityProviderFee={liquidityProviderFee} + swapFee={swapFee} /> ) : showRemove ? ( diff --git a/src/components/pages/Publish/index.tsx b/src/components/pages/Publish/index.tsx index 6962b4d79..a5a7622a9 100644 --- a/src/components/pages/Publish/index.tsx +++ b/src/components/pages/Publish/index.tsx @@ -38,7 +38,7 @@ export default function PublishPage({ (metadata as unknown) as Metadata, { ...price, - liquidityProviderFee: `${price.liquidityProviderFee}` + swapFee: `${price.swapFee}` }, serviceType, price.datatoken diff --git a/src/models/FormPublish.ts b/src/models/FormPublish.ts index ad34bfa90..3a8a2bc7b 100644 --- a/src/models/FormPublish.ts +++ b/src/models/FormPublish.ts @@ -16,7 +16,7 @@ export const validationSchema = Yup.object().shape({ .matches(/fixed|dynamic/g) .required('Required'), weightOnDataToken: Yup.string().required('Required'), - liquidityProviderFee: Yup.number() + swapFee: Yup.number() .min(0.1, 'Must be more or equal to 0.1') .max(0.9, 'Must be less or equal to 0.9') .required('Required'), @@ -50,7 +50,7 @@ export const initialValues: Partial = { type: 'fixed', tokensToMint: 1, weightOnDataToken: '9', // 90% on data token - liquidityProviderFee: 0.1 // in % + swapFee: 0.1 // in % }, files: '', description: '', diff --git a/tests/unit/__fixtures__/testFormData.ts b/tests/unit/__fixtures__/testFormData.ts index b826ce98b..f6dd032e1 100644 --- a/tests/unit/__fixtures__/testFormData.ts +++ b/tests/unit/__fixtures__/testFormData.ts @@ -9,7 +9,7 @@ const testFormData: MetadataPublishForm = { tokensToMint: 9, type: 'fixed', weightOnDataToken: '1', - liquidityProviderFee: 0.1 + swapFee: 0.1 }, name: '', description: 'description',