mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
Merge pull request #95 from oceanprotocol/fix/swapfee
swapFee calculation fix
This commit is contained in:
commit
1d55b01398
@ -96,9 +96,10 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
||||
|
||||
setUserBalance(userBalance)
|
||||
|
||||
// Get liquidity provider fee
|
||||
// Get swap fee
|
||||
// swapFee is tricky: to get 0.1% you need to convert from 0.001
|
||||
const swapFee = await ocean.pool.getSwapFee(price.address)
|
||||
setSwapFee(swapFee)
|
||||
setSwapFee(`${Number(swapFee) * 100}`)
|
||||
} catch (error) {
|
||||
console.error(error.message)
|
||||
} finally {
|
||||
|
@ -44,7 +44,8 @@ export default function PublishPage({
|
||||
|
||||
const ddo = await publish(
|
||||
(metadata as unknown) as Metadata,
|
||||
{ ...price, swapFee: `${price.swapFee}` },
|
||||
// swapFee is tricky: to get 0.1% you need to send 0.001 as value
|
||||
{ ...price, swapFee: `${price.swapFee / 100}` },
|
||||
serviceType,
|
||||
price.datatoken
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user