-
Notifications
You must be signed in to change notification settings - Fork 26
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
Clarify that QuoteDetails.amount does not include fees #198
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.
Are the fees included in the amount always? if so this is a good clarification to me as I didn't realise.
hmm, i don't think we ever fully decided (or just not documented?) whether the amountSubunits always included fees. My assumption til now was that they were separate, which is why we had a separate field named cc: @phoebe-lew @mistermoe if they are aware of any docs / decisions made i'm not remembering |
This is like how in the US, the sales tax is not included in the listed price, so then when you go to checkout you pay the amount+some, but then in Europe they mandate that the listed price also includes sales tax and when Europeans come to the US for the first time they're like, "hey what the heck, that's not what you listed as the price" |
I'm also not sure if there was ever a decision made -- It's just my opinion that My thinking is that
If I'm jumping the gun and we should kick this decision down the road further, I can remove that change from this PR. |
Notes from our sync today:
|
I strongly suggest that we refrain from modelling any numbers as integers nor floats. When dealing with finances, it is extremely important to not loose any precision, nor have overflow problems. Showing localized currency number to users should be done, IMHO, at the presentation layer. That's higher than the protocol layer. |
Example from our earlier sync for what @diehuxx posted the above can be read as:
|
was previously leaning towards using what makes the most sense for the currency, however now leaning towards snapping to examples that have standardized around using
|
Just added one more commit folding |
19d22e8
to
a2bcfe3
Compare
specs/protocol/README.md
Outdated
| `amountSubunits` | string | Y | The amount of currency paid out from or paid in to Alice in the smallest respective unit | | ||
| `feeSubunits` | string | N | The amount paid in fees expressed in the smallest respective unit. This field is strictly informative, i.e. it does not affect the total payin/payout amount stated in the `amountSubunits` field. | |
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.
it does not affect the total payin/payout amount stated in the
amountSubunits
field.
Reads as slightly confusing because it does affect the amountSubunits
but does not affect the "total". I think it's better to include the nuance here in the amountSubunits
row, like you had previously, and then also include This field is strictly informative
in the `feeSubunits. So, like this...
| `amountSubunits` | string | Y | The amount of currency paid out from or paid in to Alice in the smallest respective unit | | |
| `feeSubunits` | string | N | The amount paid in fees expressed in the smallest respective unit. This field is strictly informative, i.e. it does not affect the total payin/payout amount stated in the `amountSubunits` field. | | |
| `amountSubunits` | string | Y | The amount of payment, `feeSubunits` included, expressed in the smallest respective unit. | | |
| `feeSubunits` | string | N | The amount of fee payment expressed in the smallest respective unit; this field is strictly informative as `amountSubunits` includes `feeSubunits`. | |
(Small side comment, we should try to be consistent in including or excluding periods "."
at the end of each description)
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.
There is a proposed distinction that came up at office hours where amountSubunits
does not always include feeSubunits
. amountSubunits
includes feeSubunits
on payin. On payout, amountSubunits
does NOT include feeSubunits
. In both cases, amountSubunits
represents exactly what Alice will receive/pay. Alice can be unaware of feeSubunits
.
My current opinion is that amountSubunits
should never include feeSubunits
, but I'll stick with the above if there is consensus.
@mistermoe @jiyoontbd @corcillo @phoebe-lew Am I representing the decision from office hours accurately? Is it still your preference?
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.
amountSubunits includes feeSubunits on payin. On payout, amountSubunits does NOT include feeSubunits. In both cases, amountSubunits represents exactly what Alice will receive/pay. Alice can be unaware of feeSubunits.
yes, i think this is accurate with respect to what was discussed during office hour.
My current opinion is that amountSubunits should never include feeSubunits, but I'll stick with the above if there is consensus.
hmm, maybe we are focusing too much at the protocol layer on what is presented visually to alice to make sure she understands exactly how much the PFI is asking, and how much she should receive.
it may be easier to remember / reason about in PFI implementation if we aligned on never or always including feeSubunits
in amountSubunits
for both payin and payout.
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.
it may be easier to remember / reason about in PFI implementation if we aligned on never or always including feeSubunits in amountSubunits for both payin and payout.
I second this, as not being consistent expresses a preference at the protocol level (b/c the inverse could also be true, which would prioritize comprehension from the PFI's-side)
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.
if we aligned on never or always
IMO the amount
should never include the fee. This is how I've always seen it structured in fintech in the past.
6dbcee9
to
95ebead
Compare
697ae5f
to
f99bf4c
Compare
f99bf4c
to
0d59c31
Compare
No description provided.