mangrove.js icon indicating copy to clipboard operation
mangrove.js copied to clipboard

[Feature] Easy way to post bids/asks at best price

Open jkrivine opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe. Right now if I want to post an offer via the API at the best price I need to check using consoleAsks() or consoleBids() what are the best offers on the market. Then manually compute the price in order to be at the top of the book. It would be great to expose a function that allows one to post at the top of the book (with no guarantee of course because a asynchrony).

Describe the solution you'd like market.bestOffer(ba:"bids"|"asks") <- returns the best offer from the cache

Describe alternatives you've considered What is doable right now is:

bids = market.getSemibook("bids")
(await bids.getRawConfig())[0] // this returns the best offer but this is an async call

jkrivine avatar Feb 21 '22 17:02 jkrivine