serum-dex icon indicating copy to clipboard operation
serum-dex copied to clipboard

Settlement compute optimization

Open armaniferrante opened this issue 3 years ago • 4 comments

As suggested by @dafyddd,

It would help if Serum DEX did a slight optimization for us on their SettleFunds instruction. They would need to check if fee rebate token account is same as user's quote currency account and only send one Token Transfer instruction in that case. Right now they send two and it costs more compute

armaniferrante avatar Jun 15 '21 21:06 armaniferrante

I actually think this is not a priority now. I was able to get around our compute issue by sending a Settle instruction first then sending our PlaceAndSettle instruction.

dafyddd avatar Jun 15 '21 21:06 dafyddd

The latest commit in our repo makes this recommended change and also increments the open_orders. referrer_rebates_accrued at the time of trade instead of at the time of event queue processing. Here's the commit: https://github.com/blockworks-foundation/serum-dex/commit/b76d4f9ec597e73ed1d73dab46fc51b0e3a41c9c

dafyddd avatar Jun 18 '21 22:06 dafyddd

I'm kind of trash with git--what's the easiest way to send just that commit to you as a PR?

dafyddd avatar Jul 13 '21 17:07 dafyddd

Ok here is the pull request with the cherry picked commit: https://github.com/project-serum/serum-dex/pull/149

dafyddd avatar Jul 13 '21 18:07 dafyddd