-
Notifications
You must be signed in to change notification settings - Fork 9
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
Expose updated swap fees for user review #615
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I Very like the concept! Added some comments.
5b9d84c
to
97d6ca6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, only brainstorming naming conventions.
b71db0b
to
cb86f62
Compare
This will need to be rebased on top of #620 in order for payments Also, I propose we update the notification plugins in a separate PR. |
cb86f62
to
ab9ee4b
Compare
@danielgranhao I did an initial pass and it looks solid to me, both the interface and the implementation. I still need to dig more into the code. |
ab9ee4b
to
898629e
Compare
@roeierez Thanks! In the meantime, I've also identified some minor issues that need fixing. Once it's ready, I'll mark it. |
6643302
to
8a32e74
Compare
5068779
to
401a025
Compare
401a025
to
0a2d9bb
Compare
I think we should be able to recover the |
@dangeross Hm.. I don't think so. Those conditions would still apply even after the user accepts the fees, after which the state should be |
@dangeross we had a discussion previously this week and decided to only transition to |
If there is no server lockup tx, a user lockup tx and 0 amount it could be determined to be |
I can't think of an issue |
The issue is we want to update the amount before moving to |
IMO your idea makes sense @danielgranhao. Perhaps keep the suggested amount (quote) as a different field (or table)? And only update the amount after the user accepts? |
I just wonder how often the pair fee updates and what will happen if we accept a quote from a previous pair fee and it fails |
Pretty often as far as I can see. The current implementation of the accept method already checks the fees to see if they changed, returning an error in that case. Also, we can update the amount only after getting a success response from the swapper. |
I propose we separately persist over/underpayment amounts (sent by the payer and final receiver amount). Persisting the quote IMO is unnecessary because quotes are short-lived. Also, this approach already paves the way toward addressing #632, and would allow us in the future to expose requested_amount vs actual_paid_amount, in case we find that interesting. Check out cd04f8c. |
2bf3771
to
9190972
Compare
@danielgranhao I think your suggestion makes sense, I went over the code and it looks good.
What do you think? |
Makes sense. I'll prepare a fix.
I see your point. The name isn't the best. It represents the value we expect to receive, given the quote we agreed upon, so it needs to be synced (accepted quotes aren't recoverable). We can replace it with the accepted quote to improve clarity. |
I see. So it is basically the dynamic replacement for the static field "receiver_amount" ? |
9190972
to
86a099f
Compare
As we discussed out of band, the purpose was to show to the user the amount he will get in the time between acceptance and confirmation. But I was missing verification, which I've added now and also uses this amount. The |
Partly resolves #602
With this PR:
WaitingFeeAcceptance
state. It will stay there until the user accepts the new fee, refunds the swap, or the swap expireslist_payments