Skip to content

Fees calculation #49

@wnz99

Description

@wnz99

I was thinking that it would be nice to have a method that returns the fees given an order amount. Something like:

const price = 150
const pair = 'ETHUSD'
const orderAmount = 10
const fees =getBuyFees(orderAmount, pair, price)  

It would return the fees to buy 10 ETH at the ETH/USD ticker price of 150 USD per 1 ETH so that an user could then calculate the total cost of his order in USD as price * orderAmount + fees.

Similarly, there should be another method like:

const price = 150
const pair = 'ETHUSD'
const orderAmount = 10
const fees =getSellFees(orderAmount, pair, price)  

It returns the fees to sell 10 ETH, so that the revenue in USD would be orderAmount * price - fees

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions