> For the complete documentation index, see [llms.txt](https://docs.symm.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.symm.io/liquidity-provider-documentation/building-a-solver-on-symmio/5.-creating-the-apis/get-price-range.md).

# GET Price Range

### /price-range

```json
/price-range/{symbol}
```

**Example Query:**

```
https://base-hedger82.rasa.capital/price-range/BTCUSDT
```

**Example Response:**

```json
{
  "min_price": "1113.60",
  "max_price": "754960.6666666666666666666668176588"
}
```

#### **Data Source**

The `min_price` and `max_price` are configured by the hedger but **must align with the price range** of the external exchange where the hedger is actively hedging (e.g., Binance, Bybit).

**`min_price`**: The minimum acceptable order price for the symbol (in quote currency, e.g., USDT). Derived from the external exchange’s current price floor or liquidity constraints.

* Example: `"1113.60"` → Orders below this price are rejected.

**`max_price`**: The maximum acceptable order price for the symbol. Reflects the hedging platform’s upper price limit.

## Price Range Implementation (Rasa)

### Router

```python
@common_router.get(
    '/price-range/{symbol}',
    responses={status.HTTP_200_OK: {"model": SymbolPriceRangeInputSchema}},
    response_model=SymbolPriceRangeInputSchema
)
async def get_symbol_price_range(symbol: symbol_enum):
    # 1. Compute safe order-price bounds from the exchange
    _, _, min_price, max_price = BinanceConditionChecks.get_price_bounds(symbol, from_stats=True)

    # 2. Return JSON matching SymbolPriceRangeInputSchema
    return {
        "min_price": min_price,
        "max_price": max_price
    }

```

* Reads the exchange’s order-book or recent trades (via the Binance API or a cached copy).
* Computes a safe **min\_price** (floor) and **max\_price** (ceiling) for new orders.

#### Steps to Implement Your Own Version

**Define the Response Schema**

```python
class SymbolPriceRangeInputSchema(BaseModel):
    min_price: Decimal
    max_price: Decimal
```

**Build Your Condition-Checks Utility**

* Implement `BinanceConditionChecks.get_price_bounds(symbol, from_stats)` to return a tuple `(_, _, min_price, max_price)`.

**Add the FastAPI Route**

* In `common_router`, register the `GET /price-range/{symbol}` endpoint as shown above.
* Import `symbol_enum` for the path parameter (a class containing all Symbol names), and `SymbolPriceRangeInputSchema` for the response.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.symm.io/liquidity-provider-documentation/building-a-solver-on-symmio/5.-creating-the-apis/get-price-range.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
