GET Contract Symbols
/contract-symbols
Example Query:
Example Response:
Data Sources
Values are derived from two sources:
On-Chain Contract Data: Immutable parameters fetched directly from the blockchain (via
getSymbol(symbolId)
orgetSymbols(start, size)
).Hedger-Defined Parameters: Configurable values set by the market maker/hedger, subject to on-chain constraints.
Contract-Sourced Values
symbol_id
: Unique identifier for the trading pair (e.g.,1
for BTCUSDT). Mapped directly from the contract’ssymbolId
.name
: Trading pair name (e.g.,BTCUSDT
).is_valid
: Indicates if the symbol is active for trading. Mapped from the contract’sisValid
.min_acceptable_quote_value
: Minimum quote value (e.g., $120) required to open a position. Converted from the contract’s fixed-point value (e.g.,120000000000000000000
→120
).min_acceptable_portion_lf
: Minimum portion of the liquidity fee (e.g.,0.003
). Converted from the contract’s fixed-point value (e.g.,3000000000000000
→0.003
).trading_fee
: Fee charged per trade (e.g.,0.0006
or 0.06%). Derived from the contract’stradingFee
(e.g.,600000000000000
→0.0006
).
Hedger-Defined Values
max_leverage
: Maximum leverage allowed (e.g.,60x
). Must be ≤ the contract’sLeverage
(e.g.,60
≤100
).max_notional_value
: Maximum position size (e.g., $2,100,000). Must be ≥ the contract’sminAcceptableQuoteValue
(e.g.,2100000
≥120
).max_quantity
: Maximum tradable quantity (e.g.,1000
BTC). No on-chain constraints.max_funding_rate
: Upper limit for funding rate (e.g.,200
). Set by the hedger.min_notional_value
: Minimum position size (e.g., $100). Configured by the hedger.hedger_fee_open
/hedger_fee_close
: Additional fees charged by the hedger (e.g.,0.0006
).rfq_allowed
: Whether Request for Quote (RFQ) is enabled for the symbol.
Derived Values
symbol
/asset
: Base and quote assets (e.g.,BTC
andUSDT
). Parsed from thename
field (e.g.,BTCUSDT
→symbol: BTC
,asset: USDT
).price_precision
: Number of decimal places for price (e.g.,1
→ $100.1). Determined by the hedger based on market conventions.quantity_precision
: Number of decimal places for quantity (e.g.,3
→ 0.001 BTC). Derived frommin_acceptable_portion_lf
(e.g.,0.003
implies 3 decimals).lot_size
: Always0
(no minimum lot size enforced).
Contract Symbols Implementation (Rasa)
Router
Controller Logic
Caching
Uses @redis_ttl_cache(ttl=300)
, so the entire symbol list is stored in Redis for 5 minutes. Subsequent calls within that window skip on-chain and DB work.
On-Chain Fetching
Calls the SYMMIO “diamond” contract’s getSymbols
method to retrieve up to 500 entries and returns a list of tuples matching the on-chain Symbol
struct fields.
Filters & Whitelists
Drops any symbol with isValid == false
or if the symbol is not in your hedger’s own whitelist (normalized to uppercase).
Price Precision and Quantity Precision
These methods query the Postgres Symbol
table for the precision values you configured.
USDT-Pair Restriction
Only includes symbols quoted in USDT.
Composing the Response Object
The response dict consists of:
On-chain fields:
symbolId
,name
,isValid
,minAcceptableQuoteValue
, etc.DB/config fields:
price_precision
,quantity_precision
, plus hedger parameters (max leverage, fees, notional caps) viaHedgerParameters
.Returns a list of dicts, one per symbol.
Full Controller Snippet
For reference, the structure of an on-chain Symbol
is here:
Last updated