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

swapFee calculation fix

This commit is contained in:
Matthias Kretschmann 2020-10-05 22:07:16 +02:00
parent 01655c883a
commit eeda0f85ee
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 5 additions and 3 deletions

View File

@ -96,9 +96,10 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
setUserBalance(userBalance) 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) const swapFee = await ocean.pool.getSwapFee(price.address)
setSwapFee(swapFee) setSwapFee(`${Number(swapFee) * 100}`)
} catch (error) { } catch (error) {
console.error(error.message) console.error(error.message)
} finally { } finally {

View File

@ -44,7 +44,8 @@ export default function PublishPage({
const ddo = await publish( const ddo = await publish(
(metadata as unknown) as Metadata, (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, serviceType,
price.datatoken price.datatoken
) )