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

Incorrect assumption: referrer == (rebate token account / fee discount account) #17

Open
Arrowana opened this issue Oct 12, 2021 · 1 comment

Comments

@Arrowana
Copy link

Arrowana commented Oct 12, 2021

The code mixes up both

https://github.com/project-serum/swap/blob/master/programs/swap/src/lib.rs#L505-L555

When creating an order we need the rebate token account, which gives the rebate on the fees, while settle funds need the referrer to take the UI cut.

New order

https://github.com/project-serum/serum-dex/blob/master/dex/src/state.rs#L1814-L1818

Settle funds

https://github.com/project-serum/serum-dex/blob/master/dex/src/state.rs#L2086

Serum swap is using both as the same thing. anchor CPI is also doing the term "referral" for both situations.

But how to handle both of those as remaining_accounts?

@Arrowana Arrowana changed the title Incorrect assumption: referrer != rebate token account Incorrect assumption: referrer != (rebate token account / referrer) Oct 12, 2021
@Arrowana Arrowana changed the title Incorrect assumption: referrer != (rebate token account / referrer) Incorrect assumption: referrer != (rebate token account / fee discount) Oct 12, 2021
@Arrowana Arrowana changed the title Incorrect assumption: referrer != (rebate token account / fee discount) Incorrect assumption: referrer != (rebate token account / fee discount account) Oct 12, 2021
@Arrowana Arrowana changed the title Incorrect assumption: referrer != (rebate token account / fee discount account) Incorrect assumption: referrer == (rebate token account / fee discount account) Oct 12, 2021
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
@Arrowana and others