mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
remove percentage fee from price sum, depends smart contract calculation (#1249)
Co-authored-by: Soon Huat <soon_huat.phan@daimler.com>
This commit is contained in:
parent
c201688c4a
commit
ba672e99ac
@ -298,10 +298,6 @@ export async function getOrderPriceAndFees(
|
||||
.add(new Decimal(+orderPriceAndFee?.consumeMarketOrderFee || 0))
|
||||
.add(new Decimal(+orderPriceAndFee?.publisherMarketOrderFee || 0))
|
||||
.add(new Decimal(+orderPriceAndFee?.providerFee?.providerFeeAmount || 0))
|
||||
.add(new Decimal(+orderPriceAndFee?.publisherMarketPoolSwapFee || 0))
|
||||
.add(new Decimal(+orderPriceAndFee?.publisherMarketFixedSwapFee || 0))
|
||||
.add(new Decimal(+orderPriceAndFee?.consumeMarketPoolSwapFee || 0))
|
||||
.add(new Decimal(+orderPriceAndFee?.consumeMarketFixedSwapFee || 0))
|
||||
.toString()
|
||||
return orderPriceAndFee
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ import { FixedRateExchange, PriceAndFees } from '@oceanprotocol/lib'
|
||||
import { AccessDetails } from 'src/@types/Price'
|
||||
import Web3 from 'web3'
|
||||
import { getOceanConfig } from './ocean'
|
||||
import { getSiteMetadata } from './siteConfig'
|
||||
import { getDummyWeb3 } from './web3'
|
||||
|
||||
/**
|
||||
@ -24,11 +25,13 @@ export async function getFixedBuyPrice(
|
||||
}
|
||||
|
||||
const config = getOceanConfig(chainId)
|
||||
const { appConfig } = getSiteMetadata()
|
||||
|
||||
const fixed = new FixedRateExchange(web3, config.fixedRateExchangeAddress)
|
||||
const estimatedPrice = await fixed.calcBaseInGivenOutDT(
|
||||
accessDetails.addressOrId,
|
||||
'1'
|
||||
'1',
|
||||
appConfig.consumeMarketPoolSwapFee
|
||||
)
|
||||
return estimatedPrice
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user