mangrovedao / mangrove.js

🌴 SDK for building applications on Mangrove and bots using the SDK
https://mangrove.exchange
Other
31 stars 12 forks source link

posting new offers with Mangrove.js should NOT use market subscription #507

Open jkrivine opened 2 years ago

jkrivine commented 2 years ago

Buying and selling via market.ts no longer use subscription but fold directly through the log of the tx receipt. A similar scheme should be used in OfferLogic.ts for the newOffer/updateOffer functions.

It is faster for the maker and more robust. Synchrony with the cache of the OB is irrelevant as the maker knows it is up to date with the state of Mangrove.

espendk commented 1 year ago

I believe the code in question has moved to LiquidityProvider: https://github.com/mangrovedao/mangrove-ts/blob/b2d781c0768ef6cfe288165d10586f2deae4d313/packages/mangrove.js/src/liquidityProvider.ts#L219

peterMangrove commented 1 year ago

It is in the #constructPromise in LiquidityProvider that uses subscribe and should be changed to the same style as in marketOrder in trade