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

Maker-Friendly Instructions #1131

Open
soundsonacid opened this issue Jul 9, 2024 · 3 comments
Open

Maker-Friendly Instructions #1131

soundsonacid opened this issue Jul 9, 2024 · 3 comments

Comments

@soundsonacid
Copy link
Contributor

Drift is interested in adding instructions to the smart contract in order to facilitate a smoother experience for current & prospective market makers.

We are looking for input on what sort of instructions people might find useful.
Current instructions to be added:

  • PlaceOrders that does not revert all orders if you run out of margin during the ix.

For example, if you intended to place 5 orders and would fail the margin check on the 5th order, currently no orders would be placed. This instruction would silently fail to place the fifth order and allow the transaction to succeed, placing four out of the five orders on chain.

  • CancelOrders that accepts a “maximum_price” or “minimum_price” parameter in conjuction with “direction” to cancel all orders up to a certain price on either longs or shorts.

For example, if you had 4 buy / long orders placed on XYZ-PERP at $9, $10, $11, and $12, and sent an instruction with maximum_price: 10 and direction: PositionDirection.Long, the orders at $11 & $12 would be canceled, while the orders for $11 and $12 would remain on the book. Similarly, if you provided minimum_price: 11 and direction: PositionDirection.Long, the orders at $9 and $10 would be canceled, while the orders for $11 and $12 would remain on chain. The same logic would follow for sell / short orders. (edited)

@ricardojmendez
Copy link
Contributor

Good ideas. For CancelOrders, it would also be useful to be able to cancel orders within +/- an oracle delta (since not all market maker orders will be at fixed limit prices).

@cxp-13
Copy link

cxp-13 commented Aug 18, 2024

Drift is interested in adding instructions to the smart contract in order to facilitate a smoother experience for current & prospective market makers.

We are looking for input on what sort of instructions people might find useful. Current instructions to be added:

  • PlaceOrders that does not revert all orders if you run out of margin during the ix.

For example, if you intended to place 5 orders and would fail the margin check on the 5th order, currently no orders would be placed. This instruction would silently fail to place the fifth order and allow the transaction to succeed, placing four out of the five orders on chain.

  • CancelOrders that accepts a “maximum_price” or “minimum_price” parameter in conjuction with “direction” to cancel all orders up to a certain price on either longs or shorts.

For example, if you had 4 buy / long orders placed on XYZ-PERP at $9, $10, $11, and $12, and sent an instruction with maximum_price: 10 and direction: PositionDirection.Long, the orders at $11 & $12 would be canceled, while the orders for $11 and $12 would remain on the book. Similarly, if you provided minimum_price: 11 and direction: PositionDirection.Long, the orders at $9 and $10 would be canceled, while the orders for $11 and $12 would remain on chain. The same logic would follow for sell / short orders. (edited)

have they already been implemented?

@cxp-13
Copy link

cxp-13 commented Aug 22, 2024

I implement the cancel 。#1197

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

No branches or pull requests

3 participants