Skip to main content

Crate fynd_core

Crate fynd_core 

Source
Expand description

Fynd Core - Pure solving logic for DEX routing

This crate provides the core solving algorithms and types for finding optimal swap routes across multiple DEX protocols. It contains no HTTP or UI dependencies, making it suitable for standalone use in any application.

§Use Cases

  • Standalone routing: Integrate Fynd’s routing algorithms into your own application
  • Custom solvers: Build specialized routing solutions without HTTP overhead
  • Research & testing: Experiment with routing algorithms in isolation

§Main Components

  • algorithm: Route-finding algorithms (e.g., MostLiquidAlgorithm)
  • graph: Graph management and pathfinding utilities
  • derived: Derived data computations (spot prices, pool depths, gas prices)
  • types: Core type definitions (Order, Route, Swap, OrderQuote)
  • feed: Market data structures and event handling
  • encoding: Encodes solved routes into on-chain transactions via Tycho’s router contracts
  • worker_pool: Multi-threaded solver pool management with algorithm registry
  • worker_pool_router: Request orchestration across multiple solver pools

Re-exports§

pub use algorithm::Algorithm;
pub use algorithm::AlgorithmConfig;
pub use algorithm::AlgorithmError;
pub use algorithm::MostLiquidAlgorithm;
pub use solver::FyndBuilder;
pub use solver::PoolConfig;
pub use solver::Solver;
pub use solver::SolverBuildError;
pub use solver::SolverParts;
pub use solver::WaitReadyError;
pub use types::BlockInfo;
pub use types::ClientFeeParams;
pub use types::ComponentId;
pub use types::EncodingOptions;
pub use types::FeeBreakdown;
pub use types::Order;
pub use types::OrderQuote;
pub use types::OrderSide;
pub use types::OrderValidationError;
pub use types::PermitDetails;
pub use types::PermitSingle;
pub use types::Quote;
pub use types::QuoteOptions;
pub use types::QuoteRequest;
pub use types::QuoteStatus;
pub use types::Route;
pub use types::RouteValidationError;
pub use types::SingleOrderQuote;
pub use types::SolveError;
pub use types::SolveResult;
pub use types::Swap;
pub use types::TaskId;
pub use types::Transaction;
pub use worker_pool::pool::WorkerPool;
pub use worker_pool::pool::WorkerPoolBuilder;
pub use worker_pool::pool::WorkerPoolConfig;
pub use worker_pool::registry::UnknownAlgorithmError;
pub use worker_pool::TaskQueueHandle;
pub use worker_pool_router::config::WorkerPoolRouterConfig;
pub use worker_pool_router::SolverPoolHandle;
pub use worker_pool_router::WorkerPoolRouter;

Modules§

algorithm
Route-finding algorithms.
derived
Derived data computation system.
encoding
feed
price_guard
Price guard: validate solver outputs against external price sources.
solver
High-level solver setup via FyndBuilder.
types
Core type definitions for Fynd.
worker_pool
worker_pool_router
Orchestrates multiple solver pools to find the best quote per request.

Structs§

ComputationRequirements
Requirements for derived data computations.

Enums§

UserTransferType
Specifies the method for transferring user funds into Tycho execution.