# 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): - [Nordstern](/providers/nordstern): - [Odos](/providers/odos): - [Relay](/providers/relay): - [Velora](/providers/velora): - [Cross-Chain Swaps](/core/cross-chain): **Experimental:** Cross-chain swaps are currently experimental. You must include relay in your provider list to yield cross-chain quotes. - [Getting Started - Core](/core/getting-started): To get started we will create a shared meta aggregator instance with four providers, default settings, and support for base. Then, we will fetch the best quote for a swap and execute it. - [Strategies](/core/strategies): Selection strategies decide when spanDEX stops waiting for quotes and how it picks a winner. - [buildCalls](/core/functions/buildCalls): Build the transactions needed to execute a simulated quote. The return value is an array of calls in execution order: an ERC-20 approval first when required, followed by the swap transaction. - [createConfig](/core/functions/createConfig): Create a configuration object to customize providers and options for all aggregation functions. - [decodeStream](/core/functions/decodeStream): Decode a stream produced by `newStream` into an array of 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. - [newStream](/core/functions/newStream): Create a `ReadableStream` that emits serialized values as each promise resolves. - [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. - [spanDEX Cloud](/configuration/cloud): spanDEX cloud is a managed service which adheres to the same principles as proxy mode, but is hosted and maintained by the spanDEX team. It is intended for simple setup, testing, agents, and small deployments. It can easily be switched to and from proxy mode, so it's a great way to get started with spanDEX without needing to set up your own infrastructure. - [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)