Skip to content

Conversation

@referencedev
Copy link
Contributor

@referencedev referencedev commented Aug 8, 2021

This escrow contract serves multiple purposes:

  • One can agree to sell some amount of token to another user and put the offer in this contract. The other user will be able to take this offer when deposit the predefined amount of another token.
  • One can also just put a limit order like "sell 1000 X for at least 5 Y" and anyone can take this offer. Order book can be implemented using this off-chain.

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:

  • Should allow partial match of an open 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?

@marco-sundsk
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants