HomePhabricator

[Cashtab] Support buying agora offers above spot, within reason

Description

[Cashtab] Support buying agora offers above spot, within reason

Summary:
Agora has some unique properties compared to other exchanges. One of these: users may set a "min buy" parameter when they create an offer.

It makes sense that an offer with a lower "min buy" may reasonably have a higher price than offer with a higher "min buy" (economies of scale).

Support buying above spot, up to 25% over spot.

We could update this parameter in the future depending on how it is being used. The main use case now seems to be users would like to buy XECX for prices < 1% above spot that have lower min quantities.

Test Plan:
npm test

Deployed to test site, check version for 3.12.15

Check XECX page
https://cashtab-local-dev.netlify.app/#/token/c67bf5c2b6d91cfb46a5c1772582eff80d88686887be10aa63b0945479cf4ed4

We can buy ("OK" button enabled) an offer above spot, but we do see a warning that it is above spot

image.png (473×329 px, 55 KB)

We cannot buy an offer more than 25% above spot (OK button disabled), and we see warning + alert

image.png (473×329 px, 53 KB)

Reviewers: #bitcoin_abc, emack

Reviewed By: #bitcoin_abc, emack

Differential Revision: https://reviews.bitcoinabc.org/D17608

Details

Provenance
bytesofmanAuthored on Thu, Jan 30, 00:15
bytesofmanPushed on Thu, Jan 30, 05:57
Reviewer
Restricted Project
Differential Revision
D17608: [Cashtab] Support buying agora offers above spot, within reason
Parents
rABC1d9e9cd37db2: [avalanche] Check that avalanche invalidated items no longer poll in the…
Branches
Unknown
Tags
Unknown