A quotation over a single currency holds a high price nothing reads #52
Labels
No labels
kind
bug
kind
enhancement
kind
refactor
workflow
needs-info
workflow
needs-triage
workflow
ready-for-agent
workflow
ready-for-human
workflow
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rosa/lucre#52
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What to build
A currency priced against itself prices one direction, and holds one price for
it.
two_wayandflatrefuse a pair whose base and quote are the samecurrency, and
identityprices one direction. No quotation over a singlecurrency holds a high price.
Today such a quotation builds and keeps a high price nothing reads.
converttests the base currency first, so when both sides are the same the low price
answers and the high one is never reached.
USD/USD 0.9/1.0converts 100 USD to90 USD, and the 1.0 is inert. The type docs say both prices apply to the one
direction, which is not what happens.
The domain agrees. A spread is what a quotation keeps on a round trip, and there
is no round trip over a single currency, so a low price and a high one have
nothing to be. A one-way quotation over a single currency stays: that is a
haircut on a same-currency amount, and it needs no second direction.
The shape, from a probe against the current code:
Inverting a quotation over a single currency cannot reverse it: the pair is its
own reverse, so
invertgives a quotation over the same pair at reciprocalprices, turning a 0.99 haircut into a markup. That holds under any design here,
so it is documented rather than changed.
This is a breaking change.
identityloses its high price and a flat quotationover a single currency stops building, so it goes in its own
!-marked commit.Acceptance criteria
Quotation::two_wayandQuotation::flatrefuse a pair whose base and quote are the same currency, with an error that names the currency.Quotation::identityprices one direction, sohigh()returnsNone.Quotation::one_waystill accepts a pair over a single currency, and converting at one is unchanged.Blocked by
None — can start immediately.