i'm trying to make a serum dex token swap in my program. But the problem is, it only works halfway

here's what I mean:

when I do

orderbook.sell(sell_proceeds, None)?;

the swap works and the token I'm paying with gets deducted. but when I try to settle funds so I get the quote tokens,

orderbook.sell(sell_proceeds, None)?;

the swap gets canceled and the initially deducted funds get returned. Any idea what could be causing this? (no error is returned from the dex)

by the way, here's the sample repo I'm using


1 Answer 1


Turns out i was using a wrong decimal to set price for one of the dummy markets I created. everything works perfectly fine now

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.