openbook-dex / openbook-v2

openbook-v2 monorepo, contains solana program and ts client
Other
164 stars 94 forks source link

Add FillOrKill order type #231

Closed farnyser closed 8 months ago

farnyser commented 9 months ago

Add a fill or kill order type (force full execution or fail)

binyebarwe commented 9 months ago

Hey @farnyser thanks for your contribution. Why do you need these type of orders?

farnyser commented 9 months ago

It can be used for hedging purpose. In a single transaction, it can be used to buy exactly A amount of a token X, and sell exactly B amount of a token Y while still being safe (no market order please). Doing a partial execution would mean the basket is unhedged (expect -1000$ +1000$, and not -1000$ +200$)