1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

liquidityProviderFee → swapFee

This commit is contained in:
Matthias Kretschmann 2020-09-28 15:49:51 +00:00
parent 11f07b9982
commit ad714dc8c9
9 changed files with 17 additions and 17 deletions

View File

@ -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..."
}

View File

@ -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
}

View File

@ -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
<Tooltip content={tooltips.liquidityProviderFee} />
<Tooltip content={tooltips.swapFee} />
</>
}
type="number"

View File

@ -26,7 +26,7 @@ const query = graphql`
info
tooltips {
poolInfo
liquidityProviderFee
swapFee
communityFee
marketplaceFee
}

View File

@ -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({
<p>You will earn</p>
<Token
symbol="% of each pool transaction"
balance={liquidityProviderFee}
balance={swapFee}
/>
</div>
</div>

View File

@ -33,7 +33,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
const [totalBalance, setTotalBalance] = useState<Balance>()
const [dtSymbol, setDtSymbol] = useState<string>()
const [userBalance, setUserBalance] = useState<Balance>()
const [liquidityProviderFee, setLiquidityProviderFee] = useState<string>()
const [swapFee, setSwapFee] = useState<string>()
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 ? (
<Remove
@ -179,7 +179,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
)}
<Token
symbol="% liquidity provider fee"
balance={liquidityProviderFee}
balance={swapFee}
/>
</div>
</div>

View File

@ -38,7 +38,7 @@ export default function PublishPage({
(metadata as unknown) as Metadata,
{
...price,
liquidityProviderFee: `${price.liquidityProviderFee}`
swapFee: `${price.swapFee}`
},
serviceType,
price.datatoken

View File

@ -16,7 +16,7 @@ export const validationSchema = Yup.object().shape<MetadataPublishForm>({
.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<MetadataPublishForm> = {
type: 'fixed',
tokensToMint: 1,
weightOnDataToken: '9', // 90% on data token
liquidityProviderFee: 0.1 // in %
swapFee: 0.1 // in %
},
files: '',
description: '',

View File

@ -9,7 +9,7 @@ const testFormData: MetadataPublishForm = {
tokensToMint: 9,
type: 'fixed',
weightOnDataToken: '1',
liquidityProviderFee: 0.1
swapFee: 0.1
},
name: '',
description: 'description',