Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

orderbook and trade_preimage RPC improvements. #883

Merged
merged 14 commits into from
Mar 31, 2021

Conversation

artemii235
Copy link
Member

Add more info to orderbook response for charts. Display UTXO fee to spend the payment in trade_preimage response.
#859 #872

@Milerius
Copy link

Is this utxo fees included in the total too ?

Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for these improvements. Could you please just make a few changes?

mm2src/lp_ordermatch/orderbook_rpc.rs Show resolved Hide resolved
mm2src/lp_swap.rs Outdated Show resolved Hide resolved
@artemii235
Copy link
Member Author

Is this utxo fees included in the total too?

@Milerius Yes, please note that the coin's balance should not be checked for this case. There will be a paid_from_trading_vol flag indicating this, e.g.:

{
  "coin":"RICK",
  "amount":"0.00001",
  "amount_fraction":{
    "numer":"1",
    "denom":"100000"
  },
  "amount_rat":[[1,[1]],[1,[100000]]],
  "paid_from_trading_vol":true
}

So if paid_from_trading_vol is true you should display the fee but skip the RICK balance check.

@artemii235
Copy link
Member Author

@sergeyboyko0791 As discussed in person, I've added the TotalTradeFee struct with the required_balance field. It covers the QRC20/QTUM trade - in this case, users will require QTUM balance to send their payment, and some QTUM will be deductible from trading vol. So it's impossible to properly set the paid_from_trading_vol for the total fee.

Please review the PR again when you have time 🙂

Copy link

@sergeyboyko0791 sergeyboyko0791 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Approve it :)

@artemii235 artemii235 merged commit 5c864f5 into mm2.1 Mar 31, 2021
@artemii235 artemii235 deleted the mm2.1-orderbook-improvements branch March 31, 2021 08:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants