GET Price Range
/price-range
Example Query:
Example Response:
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
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
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 theGET /price-range/{symbol}
endpoint as shown above.Import
symbol_enum
for the path parameter (a class containing all Symbol names), andSymbolPriceRangeInputSchema
for the response.
Last updated