ref-finance / ref-contracts

Smart contracts for Ref Finance
MIT License
96 stars 55 forks source link

Escrow contract for OTC / limit orders #35

Open referencedev opened 2 years ago

referencedev commented 2 years ago

This escrow contract serves multiple purposes:

Offers have minimum time after which it can be pulled by offerer (allows to create an "option") and maximum amount of time after which they are not working anymore (to limit price exposure).

Only full orders can be matched right now.

Questions:

marco-sundsk commented 2 years ago

Questions:

  • Should allow partial match of an open offer? It's better to have this choice, can add a minimum_trade_amount in Offer to enable partial fill. When this mta equals to the whole amount, it is a none-partial offer.

  • For OTC trading some form of lockup is useful if price is under market in the moment. Should this be enforced by the contract? Lockup can be another contract deployed on the taker account. I suggest to keep Escrow neat and Single-Responsibility-Principle style.