Skip to content

Simplify deny listed tokens#4157

Merged
MartinquaXD merged 6 commits intomainfrom
simplify-deny-listed-tokens
Feb 13, 2026
Merged

Simplify deny listed tokens#4157
MartinquaXD merged 6 commits intomainfrom
simplify-deny-listed-tokens

Conversation

@MartinquaXD
Copy link
Contributor

@MartinquaXD MartinquaXD commented Feb 13, 2026

Description

Originally the orderbook and autopilot tried to detect tokens with unsupported behavior with sophisticated simulations.
Since then we:

  • onboarded more solvers that could handle tokens that were previously causing issues
  • introduced quote simulation that can detect such tokens more reliably
  • moved towards minimal intervention for problematic tokens in the protocol itself

Today the only thing we actually make use of is a list of tokens that are actually deny listed. Those should probably be revisited as well but for now I decided to only simplify the code we have today while keeping feature parity.

Changes

  • turned ListBasedDetector into a simple wrapper around a HashSet
  • given that there is no more complicated or fallible logic in the detection mechanism I decided to drop the instrumentation as well

This simplification should also drastically reduce the ~30ms we currently spend on filtering out orders that trade deny-listed tokens.
Screenshot 2026-02-13 at 16 57 47

How to test

existing e2e tests

@MartinquaXD MartinquaXD requested a review from a team as a code owner February 13, 2026 16:58
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request successfully simplifies the token deny-listing logic by replacing the complex ListBasedDetector with a lightweight DenyListedTokens struct backed by a HashSet. This change significantly improves performance by making token filtering synchronous and removing unnecessary async overhead and instrumentation. The removal of allowed_tokens and base_tokens from the configuration is consistent with the simplified intervention strategy. No critical issues were found, and the code adheres to the repository's stricter feedback guidelines.

Copy link
Contributor

@jmg-duarte jmg-duarte left a comment

Choose a reason for hiding this comment

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

Approved assuming the HashMap mentioned in the description is replaced with the HashSet that is actually in the code

Base automatically changed from remove-stuff to main February 13, 2026 17:12
@MartinquaXD MartinquaXD force-pushed the simplify-deny-listed-tokens branch from 8a97494 to 690c403 Compare February 13, 2026 17:14
@MartinquaXD MartinquaXD added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit 5b7d56e Feb 13, 2026
19 checks passed
@MartinquaXD MartinquaXD deleted the simplify-deny-listed-tokens branch February 13, 2026 22:51
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants