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

PlaceAndTakePerpOrder transactions succeed but no trade is actually executed. #1046

Open
Gsuz opened this issue May 16, 2024 · 3 comments
Open

Comments

@Gsuz
Copy link

Gsuz commented May 16, 2024

When using placeAndTakePerpOrder I'm seeing that only a very small % of transactions actually result in a sucessfull trade. Transactions are run and they are sucessfully run but it does not result in a trade. I'm not sure why this is. Is this normal and by design? Compared to when I use placeAndMakeOrder they always result in a trade when the transaction succeeds.

I've been comparing the sdk code for these functions an I can see that PlaceAndTakePerpOrder actually passes in null instead of an orderId here ->
https://github.com/drift-labs/protocol-v2/blob/6314d47775dc7c126ab9096b750bfc21ec1c80b9/sdk/src/driftClient.ts#L4825C4-L4825C9

Compared to PlaceAndMakePerpOrder which acutally passes in the orderId as you can see here ->

return await this.program.instruction.placeAndMakePerpOrder(

Is this a bug?

@Gsuz
Copy link
Author

Gsuz commented May 22, 2024

@crispheaney
Copy link
Member

This is intended since it allows you to place an order and have it stay open at the end of the tx.

We could potentially introduce a fill or kill flag and make use of the unused maker order id field

@Gsuz
Copy link
Author

Gsuz commented May 30, 2024

Could you explain the different scenarios on why no trade is happening, does the order we are trying to take not exist anymore, is the price wrong? what is going on. We really need some documentation on this function

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

2 participants