Expand description
Rust client for the Fynd DEX router.
fynd-client lets you request swap quotes, build signable transaction payloads, and
broadcast signed orders through the Fynd RPC API — all from a single typed interface.
§Constructing a client
Use FyndClientBuilder to configure and build a FyndClient:
let client = FyndClientBuilder::new(
"https://rpc.fynd.exchange",
"https://mainnet.infura.io/v3/YOUR_KEY",
)
.build()
.await?;§Minimal quote example
let weth: Bytes = Bytes::copy_from_slice(&[0xC0; 20]); // placeholder
let usdc: Bytes = Bytes::copy_from_slice(&[0xA0; 20]); // placeholder
let sender: Bytes = Bytes::copy_from_slice(&[0xd8; 20]); // placeholder
let order = Order::new(
weth,
usdc,
BigUint::from(1_000_000_000_000_000_000u64), // 1 WETH (18 decimals)
OrderSide::Sell,
sender,
None,
);
let quote = client
.quote(QuoteParams::new(order, QuoteOptions::default()))
.await?;
println!("amount out: {}", quote.amount_out());Structs§
- Approval
Params - Parameters for
FyndClient::approval. - Approval
Payload - An unsigned EIP-1559
approve(spender, amount)transaction. - Block
Info - Ethereum block at which a quote was computed.
- Client
FeeParams - Client fee configuration for the Tycho Router.
- Encoding
Options - Options that instruct the server to return ABI-encoded calldata in the quote response.
- Execution
Options - Options controlling the behaviour of
FyndClient::execute_swap. - FeeBreakdown
- Breakdown of fees applied to the swap output by the on-chain FeeCalculator.
- Fynd
Client - The main entry point for interacting with the Fynd DEX router.
- Fynd
Client Builder - Builder for
FyndClient. - Fynd
Payload - A ready-to-sign EIP-1559 transaction produced by the Fynd execution path.
- Health
Status - Health information from the Fynd RPC server’s
/v1/healthendpoint. - Instance
Info - Static metadata about this Fynd instance, returned by
GET /v1/info. - MinedTx
- The result of a successfully mined transaction (non-swap).
- Order
- A single swap intent submitted to the Fynd solver.
- Permit
Details - Per-token details for a Permit2 single-token authorization.
- Permit
Single - A single Permit2 authorization, covering one token for one spender.
- Quote
- The solver’s response for a single order.
- Quote
Options - Optional parameters that tune solving behaviour for a
QuoteParamsrequest. - Quote
Params - All inputs needed to call
FyndClient::quote. - Retry
Config - Controls how
FyndClient::quoteretries transient failures. - Route
- An ordered sequence of swaps that together execute a complete token swap.
- Settled
Order - The result of a successfully mined or simulated swap transaction.
- Signed
Approval - An
ApprovalPayloadpaired with its cryptographic signature. - Signed
Swap - A
SwapPayloadpaired with its cryptographic signature. - Signing
Hints - Optional hints to override auto-resolved transaction parameters.
- Storage
Overrides - Per-account EVM storage slot overrides for dry-run simulations.
- Swap
- A single atomic swap on one liquidity pool within a
Route. - Transaction
- An encoded EVM transaction returned by the server when
EncodingOptionswas set.
Enums§
- Backend
Kind - Which backend solver produced a given order quote.
- Error
Code - A structured error code returned by the Fynd RPC API.
- Execution
Receipt - A future that resolves once the swap transaction is mined and settled.
- Fynd
Error - Errors that can be returned by
FyndClientmethods. - Order
Side - The direction of a swap order.
- Quote
Status - High-level status of a single-order quote returned by the solver.
- Swap
Payload - A payload that needs to be signed before a swap can be executed.
- TxReceipt
- A future that resolves once a submitted transaction is mined.
- User
Transfer Type - Token transfer method used when building an on-chain swap transaction.