mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
liquidityProviderFee → swapFee
This commit is contained in:
parent
11f07b9982
commit
ad714dc8c9
@ -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.",
|
"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": {
|
"tooltips": {
|
||||||
"poolInfo": "Explain what is going on here...",
|
"poolInfo": "Explain what is going on here...",
|
||||||
"liquidityProviderFee": "Explain liquidity provider fee...",
|
"swapFee": "Explain liquidity provider fee...",
|
||||||
"communityFee": "Explain community fee...",
|
"communityFee": "Explain community fee...",
|
||||||
"marketplaceFee": "Explain marketplace fee..."
|
"marketplaceFee": "Explain marketplace fee..."
|
||||||
}
|
}
|
||||||
|
2
src/@types/MetaData.d.ts
vendored
2
src/@types/MetaData.d.ts
vendored
@ -21,7 +21,7 @@ export interface MetadataMarket extends Metadata {
|
|||||||
|
|
||||||
export interface PriceOptionsMarket extends PriceOptions {
|
export interface PriceOptionsMarket extends PriceOptions {
|
||||||
// easier to keep this as number for Yup input validation
|
// easier to keep this as number for Yup input validation
|
||||||
liquidityProviderFee: number
|
swapFee: number
|
||||||
// collect datatoken info for publishing
|
// collect datatoken info for publishing
|
||||||
datatoken?: DataTokenOptions
|
datatoken?: DataTokenOptions
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ export default function Fees({
|
|||||||
tooltips: { [key: string]: string }
|
tooltips: { [key: string]: string }
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const { appConfig } = useSiteMetadata()
|
const { appConfig } = useSiteMetadata()
|
||||||
const [field, meta] = useField('price.liquidityProviderFee')
|
const [field, meta] = useField('price.swapFee')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -21,7 +21,7 @@ export default function Fees({
|
|||||||
label={
|
label={
|
||||||
<>
|
<>
|
||||||
Liquidity Provider Fee
|
Liquidity Provider Fee
|
||||||
<Tooltip content={tooltips.liquidityProviderFee} />
|
<Tooltip content={tooltips.swapFee} />
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
type="number"
|
type="number"
|
||||||
|
@ -26,7 +26,7 @@ const query = graphql`
|
|||||||
info
|
info
|
||||||
tooltips {
|
tooltips {
|
||||||
poolInfo
|
poolInfo
|
||||||
liquidityProviderFee
|
swapFee
|
||||||
communityFee
|
communityFee
|
||||||
marketplaceFee
|
marketplaceFee
|
||||||
}
|
}
|
||||||
|
@ -16,13 +16,13 @@ export default function Add({
|
|||||||
poolAddress,
|
poolAddress,
|
||||||
totalPoolTokens,
|
totalPoolTokens,
|
||||||
totalBalance,
|
totalBalance,
|
||||||
liquidityProviderFee
|
swapFee
|
||||||
}: {
|
}: {
|
||||||
setShowAdd: (show: boolean) => void
|
setShowAdd: (show: boolean) => void
|
||||||
poolAddress: string
|
poolAddress: string
|
||||||
totalPoolTokens: string
|
totalPoolTokens: string
|
||||||
totalBalance: Balance
|
totalBalance: Balance
|
||||||
liquidityProviderFee: string
|
swapFee: string
|
||||||
}): ReactElement {
|
}): ReactElement {
|
||||||
const { debug } = useUserPreferences()
|
const { debug } = useUserPreferences()
|
||||||
const { ocean, accountId, balance } = useOcean()
|
const { ocean, accountId, balance } = useOcean()
|
||||||
@ -105,7 +105,7 @@ export default function Add({
|
|||||||
<p>You will earn</p>
|
<p>You will earn</p>
|
||||||
<Token
|
<Token
|
||||||
symbol="% of each pool transaction"
|
symbol="% of each pool transaction"
|
||||||
balance={liquidityProviderFee}
|
balance={swapFee}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -33,7 +33,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
|||||||
const [totalBalance, setTotalBalance] = useState<Balance>()
|
const [totalBalance, setTotalBalance] = useState<Balance>()
|
||||||
const [dtSymbol, setDtSymbol] = useState<string>()
|
const [dtSymbol, setDtSymbol] = useState<string>()
|
||||||
const [userBalance, setUserBalance] = useState<Balance>()
|
const [userBalance, setUserBalance] = useState<Balance>()
|
||||||
const [liquidityProviderFee, setLiquidityProviderFee] = useState<string>()
|
const [swapFee, setSwapFee] = useState<string>()
|
||||||
|
|
||||||
const [showAdd, setShowAdd] = useState(false)
|
const [showAdd, setShowAdd] = useState(false)
|
||||||
const [showRemove, setShowRemove] = useState(false)
|
const [showRemove, setShowRemove] = useState(false)
|
||||||
@ -106,11 +106,11 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
|||||||
setUserBalance(userBalance)
|
setUserBalance(userBalance)
|
||||||
|
|
||||||
// Get liquidity provider fee
|
// Get liquidity provider fee
|
||||||
const liquidityProviderFee = await ocean.pool.getSwapFee(
|
const swapFee = await ocean.pool.getSwapFee(
|
||||||
accountId,
|
accountId,
|
||||||
price.address
|
price.address
|
||||||
)
|
)
|
||||||
setLiquidityProviderFee(liquidityProviderFee)
|
setSwapFee(swapFee)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error.message)
|
console.error(error.message)
|
||||||
} finally {
|
} finally {
|
||||||
@ -130,7 +130,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
|||||||
poolAddress={price.address}
|
poolAddress={price.address}
|
||||||
totalPoolTokens={totalPoolTokens}
|
totalPoolTokens={totalPoolTokens}
|
||||||
totalBalance={totalBalance}
|
totalBalance={totalBalance}
|
||||||
liquidityProviderFee={liquidityProviderFee}
|
swapFee={swapFee}
|
||||||
/>
|
/>
|
||||||
) : showRemove ? (
|
) : showRemove ? (
|
||||||
<Remove
|
<Remove
|
||||||
@ -179,7 +179,7 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
|||||||
)}
|
)}
|
||||||
<Token
|
<Token
|
||||||
symbol="% liquidity provider fee"
|
symbol="% liquidity provider fee"
|
||||||
balance={liquidityProviderFee}
|
balance={swapFee}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -38,7 +38,7 @@ export default function PublishPage({
|
|||||||
(metadata as unknown) as Metadata,
|
(metadata as unknown) as Metadata,
|
||||||
{
|
{
|
||||||
...price,
|
...price,
|
||||||
liquidityProviderFee: `${price.liquidityProviderFee}`
|
swapFee: `${price.swapFee}`
|
||||||
},
|
},
|
||||||
serviceType,
|
serviceType,
|
||||||
price.datatoken
|
price.datatoken
|
||||||
|
@ -16,7 +16,7 @@ export const validationSchema = Yup.object().shape<MetadataPublishForm>({
|
|||||||
.matches(/fixed|dynamic/g)
|
.matches(/fixed|dynamic/g)
|
||||||
.required('Required'),
|
.required('Required'),
|
||||||
weightOnDataToken: Yup.string().required('Required'),
|
weightOnDataToken: Yup.string().required('Required'),
|
||||||
liquidityProviderFee: Yup.number()
|
swapFee: Yup.number()
|
||||||
.min(0.1, 'Must be more or equal to 0.1')
|
.min(0.1, 'Must be more or equal to 0.1')
|
||||||
.max(0.9, 'Must be less or equal to 0.9')
|
.max(0.9, 'Must be less or equal to 0.9')
|
||||||
.required('Required'),
|
.required('Required'),
|
||||||
@ -50,7 +50,7 @@ export const initialValues: Partial<MetadataPublishForm> = {
|
|||||||
type: 'fixed',
|
type: 'fixed',
|
||||||
tokensToMint: 1,
|
tokensToMint: 1,
|
||||||
weightOnDataToken: '9', // 90% on data token
|
weightOnDataToken: '9', // 90% on data token
|
||||||
liquidityProviderFee: 0.1 // in %
|
swapFee: 0.1 // in %
|
||||||
},
|
},
|
||||||
files: '',
|
files: '',
|
||||||
description: '',
|
description: '',
|
||||||
|
@ -9,7 +9,7 @@ const testFormData: MetadataPublishForm = {
|
|||||||
tokensToMint: 9,
|
tokensToMint: 9,
|
||||||
type: 'fixed',
|
type: 'fixed',
|
||||||
weightOnDataToken: '1',
|
weightOnDataToken: '1',
|
||||||
liquidityProviderFee: 0.1
|
swapFee: 0.1
|
||||||
},
|
},
|
||||||
name: '',
|
name: '',
|
||||||
description: 'description',
|
description: 'description',
|
||||||
|
Loading…
Reference in New Issue
Block a user