Skip to content

feat: minimum fee list#570

Merged
anihamde merged 7 commits intomainfrom
feat/minimum-fee-list
Jun 26, 2025
Merged

feat: minimum fee list#570
anihamde merged 7 commits intomainfrom
feat/minimum-fee-list

Conversation

@anihamde
Copy link
Contributor

This PR adds a minimum fee list to the config to enable minimum fee rates for different tokens.

@vercel
Copy link

vercel bot commented Jun 24, 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 Jun 26, 2025 7:37pm

- So11111111111111111111111111111111111111112
- EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
allow_permissionless_quote_requests: true
minimum_fee_list:
Copy link
Contributor

Choose a reason for hiding this comment

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

this schema has some ambiguities:

  • Having an enabled flag seems unusual. We can just comment the whole section to disable it. By default, when I look at some config file and see a section exists, I assume that it's configured properly and I don't look for a enable/disable flag.
  • This config allows multiple profiles without profile_id which is not well-defined, maybe we can have a default_profile next to profiles section and enforce profile_id in the profiles section.
  • If the name field is only for readability reasons, we can use comments.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the enabled flag is just out of consistency with the way we have set up token whitelist. but agreed, we don't need this.

agreed with removing the name field from the config.

for the default profile, we could do that, but i have a preference for keeping the config less verbose. also, this is only relevant if allow_permissionless_quote_requests is set to true

minimum_fee_user.unwrap_or(0),
)
{
return Err(RestError::QuoteNotFound);
Copy link
Contributor

Choose a reason for hiding this comment

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

It would be nice if we get a sense of how many requests we filter out here. Maybe via metrics?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah i like this. adding some metrics here. if you have ideas on how to increase the granularity to see individual mints, let me know. i avoided adding them to the labels naively bc that could blow up prometheus memory

"profile_id",
profile_id.map_or("None".to_string(), |id| id.to_string())
),
("result", "Invalid: User Mint Not Allowed".to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

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

I think label values should be something more compact. Maybe just user_mint_not_allowed?

"profile_id",
profile_id.map_or("None".to_string(), |id| id.to_string())
),
("result", "Invalid: Searcher Mint Not Allowed".to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

"profile_id",
profile_id.map_or("None".to_string(), |id| id.to_string())
),
("result", "Invalid: Unauthorized".to_string()),
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@anihamde anihamde merged commit d0a30ea into main Jun 26, 2025
3 checks passed
@anihamde anihamde deleted the feat/minimum-fee-list branch June 26, 2025 19:42
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