Skip to content

Commit 4631da7

Browse files
authored
Merge pull request #128 from propeller-heads/kt/ENG-5580-add-blacklist-filter
feat: remove blacklist from fynd
2 parents f82bd29 + 3c90845 commit 4631da7

File tree

15 files changed

+121
-399
lines changed

15 files changed

+121
-399
lines changed

.claude/CODEBASE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ See `docs/ARCHITECTURE.md` for the full architecture diagram and detailed compon
9797
| `HTTP_HOST` | HTTP bind address (default: `0.0.0.0`) |
9898
| `HTTP_PORT` | API port (default: `3000`) |
9999
| `WORKER_POOLS_CONFIG` | Worker pools config file (default: `worker_pools.toml`) |
100-
| `BLACKLIST_CONFIG` | Blacklist config file (default: `blacklist.toml`) |
100+
| `BLOCKLIST_CONFIG` | Blocklist config file (default: `blocklist.toml`) |
101101
| `RUST_LOG` | Tracing filter (e.g. `info,fynd=debug`) |
102102

103103
### CLI Commands
@@ -112,7 +112,7 @@ See `docs/ARCHITECTURE.md` for the full architecture diagram and detailed compon
112112
| File | Purpose |
113113
|---|---|
114114
| `worker_pools.toml` | Worker pool definitions: algorithm, num_workers, hop limits, timeout. Optional — binary falls back to embedded defaults if not found |
115-
| `blacklist.toml` | Pool IDs to exclude from routing. Optional — binary falls back to embedded defaults if not found |
115+
| `blocklist.toml` | Pool IDs to exclude from routing. Optional — binary falls back to embedded defaults if not found |
116116

117117
## Testing
118118

Cargo.lock

Lines changed: 10 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ solving.
220220
| `--min-tvl` | - | `10.0` | Minimum pool TVL in native token |
221221
| `--worker-router-timeout-ms` | - | `100` | Default solve timeout |
222222
| `-w, --worker-pools-config` | `WORKER_POOLS_CONFIG` | `worker_pools.toml` | Worker pools config |
223-
| `--blacklist-config` | `BLACKLIST_CONFIG` | `blacklist.toml` | Blacklist config |
223+
| `--blocklist-config` | `BLOCKLIST_CONFIG` | `blocklist.toml` | Path to blocklist TOML config file |
224224
| `--gas-price-stale-threshold-secs` | - | *(disabled)* | Health returns 503 when gas price exceeds this age |
225225

226226
See `--help` for the full list.
@@ -260,12 +260,19 @@ pools within the timeout.
260260

261261
Each order gets 2 candidate solutions — one from each pool — and the best is selected.
262262

263-
### Blacklist (blacklist.toml)
263+
### Blocklist Config
264264

265-
Exclude specific pools from routing:
265+
By default, Fynd loads `blocklist.toml` from the working directory. The default excludes components with known
266+
simulation issues (e.g., rebasing tokens). Override with `--blocklist-config`:
267+
268+
```bash
269+
cargo run --release serve -- --blocklist-config my_blocklist.toml
270+
```
271+
272+
The config file uses a `[blocklist]` section with component IDs to exclude:
266273

267274
```toml
268-
[blacklist]
275+
[blocklist]
269276
components = [
270277
"0x86d257cdb7bc9c0df10e84c8709697f92770b335",
271278
]

blacklist.toml renamed to blocklist.toml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Component blacklist configuration
1+
# Component blocklist configuration
22
# Exclude specific pools from routing due to simulation issues
33

4-
[blacklist]
4+
[blocklist]
55
# Component IDs to exclude (pool addresses)
66
components = [
77
# AMPL pools - AMPL is a rebasing token that breaks simulation assumptions
@@ -17,4 +17,15 @@ components = [
1717
"0x69accb968b19a53790f43e57558f5e443a91af22",
1818
# Fluid syrupUSDC/USDC — ERC-4626 vault token, simulation can't track accumulating rate
1919
"0x79eea4a1be86c43a9a9c4384b0b28a07af24ae29",
20+
# Curve weETH/WETH (StableSwapNG) — MissingAccount error, oracle deps not in simulated state
21+
"0xdb74dfdd3bb46be8ce6c33dc9d82777bcfc3ded5",
22+
# "Dollars" (USD, 0xd233d1f6) token pools — fake stablecoin with mispriced reserves
23+
# UniswapV2 LINK/"Dollars"
24+
"0x81a8bd7f2b29cee72aae18da9b4637acf4bc125a",
25+
# UniswapV2 MKR/"Dollars"
26+
"0xa16a3cbc92d77b720a851d33a91890c4fbfb0299",
27+
# UniswapV2 DAI/"Dollars" (last trade Sep 2020)
28+
"0x1d1126cc2c77384448913b41fbf308563aae1f16",
29+
# UniswapV2 WETH/"Dollars" (1938 WETH locked, mispriced)
30+
"0x582e3da39948c6339433008703211ad2c13eb2ac",
2031
]

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ services:
88
- "9898:9898"
99
volumes:
1010
- ./worker_pools.toml:/etc/fynd/worker_pools.toml:ro
11-
- ./blacklist.toml:/etc/fynd/blacklist.toml:ro
11+
- ./blocklist.toml:/etc/fynd/blocklist.toml:ro
1212
environment:
1313
- RPC_URL=${RPC_URL}
1414
- TYCHO_API_KEY=${TYCHO_API_KEY:-}
1515
- TYCHO_URL=${TYCHO_URL:-tycho-fynd-ethereum.propellerheads.xyz}
1616
- WORKER_POOLS_CONFIG=/etc/fynd/worker_pools.toml
17-
- BLACKLIST_CONFIG=/etc/fynd/blacklist.toml
17+
- BLOCKLIST_CONFIG=/etc/fynd/blocklist.toml
1818
- RUST_LOG=fynd=info
1919
- OTEL_EXPORTER_OTLP_ENDPOINT=http://tempo:4317
2020
depends_on:

docs/ARCHITECTURE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ Provides `extract_subset()` for creating filtered snapshots that algorithms can
240240

241241
**Crate:** `fynd-core` **Location:** `fynd-core/src/feed/tycho_feed.rs`
242242

243-
Background task that connects to Tycho's WebSocket API, processes component/state updates, updates SharedMarketData, and broadcasts `MarketEvent`s. Applies TVL filtering with hysteresis (components are added at `min_tvl` and removed at `min_tvl / tvl_buffer_ratio`), token recency filtering (`traded_n_days_ago`), blacklisting, and token quality filtering.
243+
Background task that connects to Tycho's WebSocket API, processes component/state updates, updates SharedMarketData, and broadcasts `MarketEvent`s. Applies TVL filtering with hysteresis (components are added at `min_tvl` and removed at `min_tvl / tvl_buffer_ratio`), token recency filtering (`traded_n_days_ago`), blocklisting, and token quality filtering.
244244

245245
***
246246

docs/guides/server-configuration.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ icon: server
44

55
# Server Configuration
66

7-
Reference for all Fynd server flags, worker pool tuning, blacklisting, logging, and monitoring.
7+
Reference for all Fynd server flags, worker pool tuning, blocklist configuration, logging, and monitoring.
88

99
## Run options
1010

@@ -87,7 +87,7 @@ Run `cargo run --release -- serve --help` for the full list.
8787
| `--worker-router-timeout-ms` || `100` | Default solve timeout (ms) |
8888
| `--worker-router-min-responses` || `0` | Early return threshold (0 = wait for all pools) |
8989
| `-w, --worker-pools-config` | `WORKER_POOLS_CONFIG` | `worker_pools.toml` | Worker pools config file path |
90-
| `--blacklist-config` | `BLACKLIST_CONFIG` | `blacklist.toml` | Blacklist config file path |
90+
| `--blocklist-config` | `BLOCKLIST_CONFIG` | `blocklist.toml` | Path to blocklist TOML config file. Components listed here are excluded from the Tycho stream. |
9191
| `--disable-tls` || `false` | Disable TLS for Tycho connection |
9292
| `--min-token-quality` || `100` | Minimum [token quality](https://docs.propellerheads.xyz/tycho/overview/concepts#token) filter |
9393
| `--gas-refresh-interval-secs` || `30` | Gas price refresh interval |
@@ -128,12 +128,18 @@ To use a custom config file:
128128
cargo run --release -- serve -w my_worker_pools.toml
129129
```
130130

131-
## Blacklist (`blacklist.toml`)
131+
## Blocklist config
132132

133-
Exclude specific components from routing, useful for components with known simulation issues (e.g., [rebasing tokens on UniswapV3 pools](https://docs.uniswap.org/concepts/protocol/integration-issues)):
133+
By default, Fynd loads `blocklist.toml` from the working directory. The default excludes components with known simulation issues (e.g., [rebasing tokens on UniswapV3 pools](https://docs.uniswap.org/concepts/protocol/integration-issues)). Override with `--blocklist-config`:
134+
135+
```bash
136+
cargo run --release -- serve --blocklist-config my_blocklist.toml
137+
```
138+
139+
The config file uses a `[blocklist]` section listing component IDs to exclude:
134140

135141
```toml
136-
[blacklist]
142+
[blocklist]
137143
components = [
138144
"0x86d257cdb7bc9c0df10e84c8709697f92770b335",
139145
]

fynd-core/src/feed/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ pub(crate) struct TychoFeedConfig {
4444
pub(crate) reconnect_delay: Duration,
4545
/// Only include tokens traded within this many days.
4646
pub(crate) traded_n_days_ago: Option<u64>,
47-
/// Component IDs to exclude from routing.
48-
pub(crate) blacklisted_components: HashSet<String>,
47+
/// Component IDs to exclude from the Tycho stream.
48+
pub(crate) blocklisted_components: HashSet<String>,
4949
}
5050

5151
impl TychoFeedConfig {
@@ -69,7 +69,7 @@ impl TychoFeedConfig {
6969
tvl_buffer_ratio: 1.1,
7070
gas_refresh_interval: Duration::from_secs(30),
7171
reconnect_delay: Duration::from_secs(5),
72-
blacklisted_components: HashSet::new(),
72+
blocklisted_components: HashSet::new(),
7373
}
7474
}
7575

@@ -98,8 +98,8 @@ impl TychoFeedConfig {
9898
self
9999
}
100100

101-
pub(crate) fn blacklisted_components(mut self, components: HashSet<String>) -> Self {
102-
self.blacklisted_components = components;
101+
pub(crate) fn blocklisted_components(mut self, components: HashSet<String>) -> Self {
102+
self.blocklisted_components = components;
103103
self
104104
}
105105
}

0 commit comments

Comments
 (0)