market icon indicating copy to clipboard operation
market copied to clipboard

Fee display component

Open mihaisc opened this issue 3 years ago • 5 comments

We need a component to display the price structure with fees. It will be used in the Use tab. It is needed in the following places Download : for the price Compute: for the asset price , for each algorithm price, for the whole job price .

Preliminary structure:

 publisherMarketOrderFee: string
 publisherMarketPoolSwapFee: string
 publisherMarketFreSwapFee: string
 consumeMarketOrderFee: string
 consumeMarketPoolSwapFee: string
 consumeMarketFreSwapFee: string

// fee set by the provider
providerFee: string

// fee in percent for swaps involving OPC approved tokens
opcSwapOceanFee : string
// fee in percent for swaps involving non OPC approved tokens
opcSwapNonOceanFee: string
// fee in percent taken by OPC from consumeFees
opcConsumeFee
// fee in percent taken by OPC from providerFees
opcProviderFee

The opc fees are fetched from the subgraph based on chain

Basically this needs to look something like

Total price : x BaseToken

  • fee1 : y BaseToken
  • fee2: z BaseToken

mihaisc avatar Feb 10 '22 15:02 mihaisc

To avoid confusion between Fre and Free I propose changing

 publisherMarketFreSwapFee: string
 consumeMarketFreSwapFee: string

To:

 publisherMarketFixedSwapFee: string
 consumeMarketFixedSwapFee: string

jamiehewitt15 avatar Feb 11 '22 08:02 jamiehewitt15

@mihaisc I noticed the list doesn't include provider fees? I thought we were also introducing these?

jamiehewitt15 avatar Feb 14 '22 14:02 jamiehewitt15

This was just a random example at that time, the component shouldn't care , it just needs to display something like name : value for fees that are not 0.

mihaisc avatar Feb 14 '22 14:02 mihaisc

ok cool

jamiehewitt15 avatar Feb 14 '22 15:02 jamiehewitt15

This is an example of hopefully the final version of the structure that we pass to this component https://github.com/oceanprotocol/market/blob/7336224f387ca36e3c62b83a5f82e7505691f706/src/%40types/Price.d.ts#L16 . For now it assumes all fees are in ocean.

mihaisc avatar Feb 14 '22 15:02 mihaisc

Not that relevant now. Will open another issue in the future if needed

mihaisc avatar Sep 29 '22 12:09 mihaisc