# How "Tuner" Library Works?

The overall design of the simulator consists of several components (rough dependency graph shown below), this **does NOT** necessarily 100% reflect how everything is implemented, but to give you an intuitive understanding of the relationships between the components and their corresponding purposes:

**`SimulatorClient`** - *The high-level and easiest way to use the simulator*

|\_\_ **`ConfigurableCorePool`** - *To give **`CorePool`** snapshot and roadmap capabilities*

|\_\_ **`CorePool`** - *The re-implementation of* [*Uniswap-V3-Core logic*](https://github.com/Uniswap/v3-core/blob/main/contracts/UniswapV3Pool.sol)

|\_\_ **`MainnetDataDownloader`** - *The download-and-update utility to retrieve mainnet events*

|\_\_ **`EventDBManager`** - *To persist mainnet event data using SQLite*

|\_\_ **`SimulatorRoadMapManager`** - *To take snapshots and do state-change roadmap tracking*

|\_\_ **`SimulationDataManager`** - *To persist snapshots and roadmaps using SQLite*

There are 2 abstraction layers of the library:

## Top-Level: [`SimulatorClient`](https://github.com/Bella-DeFinTech/uniswap-v3-simulator/blob/main/docs/src/client/SimulatorClient.ts)

This is a convenient way to [get you started](https://github.com/Bella-DeFinTech/uniswap-v3-simulator/blob/main/docs/README.md#quick-start) immediately. We have wrapped the underlying logic of data downloading, data pre-processing, and simulated Uniswap V3 pool together instantiation together, so you don't have to deal with the details.

## Low-Level:

If you want more flexible ways to run your own simulation scenarios and have more granular control, you can wire things up manually as you like, by directly interacting with the below classes:

* **`ConfigurableCorePool`**
* **`MainnetDataDownloader`**
* **`SimulatorRoadMapManager`**

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bella.fi/getting-started/how-tuner-library-works.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
