# spanDEX
> DEX meta-aggregator library for optimal token swaps
## Docs
- [Advanced](/advanced): Deadlines, timeouts, retries, etc
- [Examples](/examples): If you build something cool with spanDEX, let us know.
- [Fees](/fees): This page moved to [Configuration > Fees](/configuration/fees).
- [Getting Started](/getting-started): Depending on your project stack and state, there are multiple ways to get started with spanDEX.
- [Existing Projects](/getting-started): See [installation instructions](/installation.mdx) for details on how to add spanDEX to your existing project. For react applications, see the [React getting started guide](/react/getting-started.mdx). Otherwise, see the [Core getting started guide](/core/getting-started.mdx).
- [New Projects](/getting-started): We currently don't have a CLI available, but we're working on it! In the meantime, you can follow the instructions in the [Core getting started guide](/core/getting-started.mdx) to set up spanDEX in your project.
- [Installation](/installation): `@spandex/core` provides all the functionality to interact with multiple aggregators, simulate quotes onchain, and execute swaps. It depends on `viem` for blockchain interactions.
- [Why spanDEX](/overview): Let's clarify some key concepts in DeFi: DEX aggregators and meta aggregators.
- [Onchain Simulation](/simulation): While fetched quotes provide a good estimate of swap costs, simulating a swap
can provide a more accurate picture of how the swap will perform when executed
onchain.
- [ConfigParams](/reference/ConfigParams)
- [SwapParams](/reference/SwapParams)
- [Getting Started - React](/react/getting-started): To get started we will create a shared meta aggregator instance with three providers, default settings, and support for base. Then, we will fetch the best quote for a swap and execute it.
- [useQuote](/react/hooks/useQuote): Fetch quotes from all configured aggregators, simulate them, and select a winner using a strategy.
- [useQuoteExecutor](/react/hooks/useQuoteExecutor): Coming soon
- [useQuotes](/react/hooks/useQuotes): Fetch quotes from all configured aggregators and simulate each quote.
- [0x](/providers/0x):
- [Fabric](/providers/fabric):
- [KyberSwap](/providers/kyberswap):
- [LiFi](/providers/lifi):
- [Odos](/providers/odos):
- [Relay](/providers/relay):
- [Velora](/providers/velora):
- [Getting Started - Core](/core/getting-started): To get started we will create a shared meta aggregator instance with three providers, default settings, and support for base. Then, we will fetch the best quote for a swap and execute it.
- [createConfig](/core/functions/createConfig): Create a configuration object to customize providers and options for all aggregation functions.
- [decodeQuoteStream](/core/functions/decodeQuoteStream): Decode a quote stream produced by `newQuoteStream` into an array of quote promises.
- [executeQuote](/core/functions/executeQuote): Execute a simulated quote onchain using a wallet client. Handles approval requirements and supports EIP-5792 batch calls when available.
- [getPricing](/core/functions/getPricing): **Experimental:** This utility is still considered experimental and may change.
- [getQuote](/core/functions/getQuote): Fetch quotes, simulate them, and return a single winning quote based on a selection strategy.
- [getQuotes](/core/functions/getQuotes): Fetches quotes from all configured providers and simulates the quote transactions to validate the swap operation and the final token output amount.
- [getRawQuotes](/core/functions/getRawQuotes): Fetches quotes from all configured providers. This function does not perform any onchain simulation or validation. It is useful for scenarios where you plan to handle validation separately. Always simulate!
- [netOutputs](/core/functions/netOutputs): **Experimental:** This utility is still considered experimental and may be inaccurate for complex swaps.
- [newQuoteStream](/core/functions/newQuoteStream): Create a `ReadableStream` that emits serialized quotes as each promise resolves. This is useful for server-to-client streaming of quotes as they are fetched.
- [prepareQuotes](/core/functions/prepareQuotes): Prepare a list of swap quote promise chains for quote fetching and secondary actions such as simulation. This is useful when custom behavior is required, such as racing quotes+simulation for multiple providers.
- [selectQuote](/core/functions/selectQuote): Pick the best simulated quote from a set of in-flight quote+simulation promises. This is useful when you want to stream quotes and simulations concurrently and only commit to the best result once enough data is available.
- [simulateQuote](/core/functions/simulateQuote): Simulate a single quote onchain and decorate it with simulation results.
- [simulateQuotes](/core/functions/simulateQuotes): Simulate a batch of quotes given shared swap parameters and a client.
- [sortQuotesByPerformance](/core/functions/sortQuotesByPerformance): Sort successful simulated quotes by a selected performance metric.
- [Fees](/configuration/fees): There are several fee layers to consider in spanDEX, even though spanDEX itself does not impose fees:
- [Configuration](/configuration): Use configuration to tune how your meta-aggregator behaves in production: which providers are active,
how quote economics and optional integrator fee capture work, and what latency/retry behavior you
want globally.
- [Providers](/configuration/providers): Your provider set is the most important configuration decision in spanDEX. Think in terms of a
portfolio: you want enough provider diversity to improve route quality, resilience, and throughput
under real load. No single aggregator wins every trade or delivers 100% uptime.
- [Proxy Mode](/configuration/proxy): Use proxy mode when your meta-aggregation layer runs as a service and clients fetch quotes from
that service, instead of calling provider APIs directly from the client.
- [Move along... nothing to see here!](/blog)