mangrovedao/mangrove.js

refactor `LiquidityProvider` and `OfferLogic` classes

jkrivine opened this issue · 1 comments

The overall structure should be:

  • OfferLogic should contain all functions that do not require a specific market (a base and a quote) to interact with Mangrove.
    for instance new offer can be posted directly from OfferLogic but one has to provide an OfferList (outbound, inbound)
  • LiquidityProvider is OfferLogic on a specific market
    it has a [new/udpate]ask and [new/update]bid functions and essentially delegates all code to OfferLogic with the correct orientation of tokens

New/Update-offer needs to be implemented in OfferLogic and LiquidityProvider should then call those methods instead of calling the contract directly. Same for retractOffer or any other methods that call the contract directly.