Skip to content

refactor!: rename liquidity pools to components - #366

Open
Troshchk wants to merge 6 commits into
mainfrom
taker-propAMM/kt/ENG-6202-pool-naming-fix
Open

refactor!: rename liquidity pools to components#366
Troshchk wants to merge 6 commits into
mainfrom
taker-propAMM/kt/ENG-6202-pool-naming-fix

Conversation

@Troshchk

@Troshchk Troshchk commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Rename all liquidity-pool naming to "component" (matching Tycho's ProtocolComponent and the component_id wire field); "pool" alone now always means a worker pool -- docs, comments, tests, and internal identifiers only, with no behavior change.

Breaking changes:

  • fynd-core public API: DerivedData pool-depth accessors are now component_depths() / component_depths_block() / set_component_depths() / clear_component_depths(); PoolDepths / PoolDepthKey are now ComponentDepths / ComponentDepthKey; PoolDepthComputation is now ComponentDepthComputation; MarketState::pool_counts_by_protocol() is now component_counts_by_protocol().
  • GET /v1/prices (experimental feature): response fields pool_depths → component_depths, both the top-level array and the entry in blocks. Request parameters (include=depths) are unchanged.
  • TypeScript client: Swap.poolId → Swap.componentId. The quote wire format is unchanged.
  • PoolConfig -> WorkerPoolConfig
  • WorkerPoolConfig (spawn-level) -> WorkerPoolSpawnConfig
  • FyndBuilder::add_pool -> add_worker_pool
  • SolverBuildError::NoPools -> NoWorkerPools
  • defaults::{POOL_TASK_QUEUE_CAPACITY, POOL_MIN_HOPS, POOL_MAX_HOPS, POOL_TIMEOUT_MS} -> WORKER_POOL_*

Not changed (intentionally, to avoid breaking consumers): the quote API wire format, Prometheus metric names (market_pools, market_pools_per_protocol), and the pool_depths computation ID used as the computation metric label.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown

Breaking API Changes (Intentional)

Breaking API changes detected and declared in the PR title.
release-plz derives the bump from commits: verify a !-marked commit is in this PR so the release PR shows a minor bump (breaking changes on 0.x.x bump the minor).

semver-checks output
Checking fynd-core v0.97.7 -> v0.97.7 (no change; assume minor)
     Checked [   0.865s] 196 checks: 195 pass, 1 fail, 0 warn, 49 skip

--- failure inherent_method_missing: pub method removed or renamed ---

Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/inherent_method_missing.ron

Failed in:
  DerivedData::pool_depths, previously in file fynd-core/src/derived/store.rs:216
  DerivedData::pool_depths_block, previously in file fynd-core/src/derived/store.rs:221
  DerivedData::set_pool_depths, previously in file fynd-core/src/derived/store.rs:230
  DerivedData::pool_depth_failure, previously in file fynd-core/src/derived/store.rs:258
  DerivedData::clear_pool_depths, previously in file fynd-core/src/derived/store.rs:265
  MarketState::pool_counts_by_protocol, previously in file fynd-core/src/feed/market_data.rs:365

     Summary semver requires new major version: 1 major and 0 minor checks failed
    Finished [   1.194s] fynd-core
    Checking fynd-test-fixtures v0.97.7 -> v0.97.7 (no change; assume minor)
     Checked [   0.087s] 196 checks: 194 pass, 2 fail, 0 warn, 49 skip

--- failure constructible_struct_adds_field: externally-constructible struct adds field ---

Description:
A pub struct constructible with a struct literal has a new pub field. Existing struct literals must be updated to include the new field.
        ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/constructible_struct_adds_field.ron

Failed in:
  field ExpectedMetadata.num_components in test-fixtures/src/expected.rs:50
  field ExpectedMetadata.num_components in test-fixtures/src/expected.rs:50
  field DerivedDataMetrics.components_with_spot_prices in test-fixtures/src/expected.rs:64
  field DerivedDataMetrics.components_with_depths in test-fixtures/src/expected.rs:66
  field DerivedDataMetrics.components_with_spot_prices in test-fixtures/src/expected.rs:64
  field DerivedDataMetrics.components_with_depths in test-fixtures/src/expected.rs:66

--- failure struct_pub_field_missing: pub struct's pub field removed or renamed ---

Description:
A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely.
        ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
       impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/struct_pub_field_missing.ron

Failed in:
  field num_pools of struct ExpectedMetadata, previously in file test-fixtures/src/expected.rs:50
  field num_pools of struct ExpectedMetadata, previously in file test-fixtures/src/expected.rs:50
  field spot_price_pools of struct DerivedDataMetrics, previously in file test-fixtures/src/expected.rs:64
  field pool_depth_pools of struct DerivedDataMetrics, previously in file test-fixtures/src/expected.rs:66
  field spot_price_pools of struct DerivedDataMetrics, previously in file test-fixtures/src/expected.rs:64
  field pool_depth_pools of struct DerivedDataMetrics, previously in file test-fixtures/src/expected.rs:66

     Summary semver requires new major version: 2 major and 0 minor checks failed
    Finished [   0.150s] fynd-test-fixtures
    Checking fynd-rpc v0.97.7 -> v0.97.7 (no change; assume minor)
     Checked [   0.079s] 196 checks: 196 pass, 49 skip
     Summary no semver update required
    Finished [   0.146s] fynd-rpc
    Checking fynd-rpc-types v0.97.7 -> v0.97.7 (no change; assume minor)
     Checked [   0.136s] 196 checks: 196 pass, 49 skip
     Summary no semver update required
    Finished [   0.223s] fynd-rpc-types
    Checking fynd-client v0.97.7 -> v0.97.7 (no change; assume minor)
     Checked [   0.159s] 196 checks: 196 pass, 49 skip
     Summary no semver update required
    Finished [   0.283s] fynd-client
    Checking fynd-tools-common v0.97.7 -> v0.97.7 (no change; assume minor)
     Checked [   0.071s] 196 checks: 196 pass, 49 skip
     Summary no semver update required
    Finished [   0.118s] fynd-tools-common
    Checking erc20-overrides v0.97.7 -> v0.97.7 (no change; assume minor)
     Checked [   0.072s] 196 checks: 196 pass, 49 skip
     Summary no semver update required
    Finished [   0.109s] erc20-overrides

@Troshchk
Troshchk force-pushed the taker-propAMM/kt/ENG-6202-pool-naming-fix branch from a97390c to 76c76b7 Compare July 29, 2026 08:24
Ksenia Troshchenkova and others added 2 commits July 29, 2026 10:41
"Pool" meant both a liquidity pool and a worker pool. Rename all
liquidity-pool uses to "component" (matching Tycho's ProtocolComponent
and the component_id wire field); "pool" alone now always means a
worker pool. Adds a Terminology section to docs/ARCHITECTURE.md.

No behavior change, and runtime-observable interfaces are untouched:
wire formats, metric names (market_pools*), and the pool_depths
computation ID used as the Prometheus `computation` label keep their
legacy names, with comments marking them as intentional.

BREAKING CHANGE: fynd-core public API renames — DerivedData pool-depth
accessors are now component_depths()/component_depths_block()/
set_component_depths()/clear_component_depths(), PoolDepths/
PoolDepthKey are ComponentDepths/ComponentDepthKey,
PoolDepthComputation is ComponentDepthComputation, and
MarketState::pool_counts_by_protocol() is
component_counts_by_protocol(). HTTP wire formats and client library
APIs are unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Complete the pool→component rename on the two client-facing surfaces
excluded from the main rename commit:

- GET /v1/prices (experimental feature): response fields `pool_depths`
  → `component_depths`, both the top-level array and the entry in
  `blocks`. Request parameters (`include=depths`) are unchanged.
- @kayibal/fynd-client: `Swap.poolId` → `Swap.componentId`, matching
  the `component_id` wire field. The quote wire format is unchanged.

BREAKING CHANGE: consumers of the experimental /v1/prices endpoint
must read `component_depths` instead of `pool_depths`; TypeScript
client consumers must rename `swap.poolId` to `swap.componentId`.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Troshchk
Troshchk force-pushed the taker-propAMM/kt/ENG-6202-pool-naming-fix branch from 76c76b7 to 9785e31 Compare July 29, 2026 08:42
Comment thread fynd-rpc/src/api/prices.rs
Comment thread .claude/CODEBASE.md Outdated
Comment thread .claude/CODEBASE.md Outdated
Comment thread .claude/CODEBASE.md
Comment thread clients/rust/src/types.rs Outdated
Comment thread docs/guides/custom-algorithm.md
Comment thread fynd-core/examples/custom_algorithm.rs
Comment thread fynd-core/src/derived/mod.rs Outdated
Ksenia Troshchenkova added 3 commits July 29, 2026 12:58
  Bare "pool" in the builder/config API meant worker pool but read as
  liquidity pool. Rename so the public surface says which:

  - PoolConfig -> WorkerPoolConfig; the internal spawn config it collided
    with becomes WorkerPoolSpawnConfig
  - FyndBuilder::add_pool -> add_worker_pool, NoPools -> NoWorkerPools
  - defaults::POOL_* -> WORKER_POOL_*
Comment thread fynd-core/src/worker_pool/pool.rs Outdated
Comment thread fynd-core/src/solver.rs Outdated
Comment thread fynd-core/src/solver.rs Outdated
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