Skip to content

feat: add minimum platform fees#571

Merged
anihamde merged 5 commits intomainfrom
feat/apply-platform-fees
Jul 2, 2025
Merged

feat: add minimum platform fees#571
anihamde merged 5 commits intomainfrom
feat/apply-platform-fees

Conversation

@anihamde
Copy link
Contributor

@anihamde anihamde commented Jul 1, 2025

This PR adds a minimum platform fees list to the config and parses it to apply platform fees based on token mints.

In order to release this feature, we need to

  • migrate searchers over to using swap_v2 instead of swap
  • ensure searchers are specifying platform_fee_ppm there
  • update the Rust SDK to perform this correctly

Longer term, we ought to

  • remove the bps fields from the APIs

@vercel
Copy link

vercel bot commented Jul 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
swap-staging ⬜️ Ignored (Inspect) Visit Preview Jul 2, 2025 5:23pm

}
});

match (fee_user, fee_searcher) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fee_user .into_iter() .chain(fee_searcher) .max()

None
}
});
let fee_searcher = self.minimum_platform_fee_list.iter().find_map(|fee| {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let fee_searcher = self
.minimum_platform_fee_list
.iter()
.find(|fee| &fee.mint == mint_searcher)
.map(|fee| fee.fee_ppm);

I feel using find and then map is a better approach. But your choice


[dependencies]
express-relay-api-types = { version = "0.12.0", path = "../../auction-server/api-types" }
express-relay-api-types = { version = "0.12.1", path = "../../auction-server/api-types" }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to update the "express-relay-client" version

@anihamde anihamde merged commit c8df53c into main Jul 2, 2025
3 checks passed
@anihamde anihamde deleted the feat/apply-platform-fees branch July 2, 2025 19:20
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

Successfully merging this pull request may close these issues.

2 participants