Skip to content

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

@Arrowana

Description

@Arrowana

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions