Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escrow contract for OTC / limit orders #35

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Escrow contract for OTC / limit orders #35

wants to merge 4 commits into from

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.

2 participants