Types & Enums Reference
Standard enums and TypedDict definitions used throughout the SDK.
types
Type definitions, enums, and typed dictionaries for revolut-x-python.
This module provides:
- Enums — :class:
OrderSide, :class:OrderType, :class:Interval, :class:TimeInForcefor type-safe parameter passing. - TypedDicts — :class:
Candle, :class:Trade, :class:Ticker, :class:Balance, :class:PairConfig, etc. for IDE autocompletion on API response data. - Type aliases — :data:
TimeLikefor time range parameters.
TimeLike
module-attribute
Anything accepted where the API expects a Unix timestamp in milliseconds.
Numbers are taken as milliseconds as-is; :class:~datetime.datetime and
:class:~datetime.date objects and ISO-8601 strings are converted by
:func:~revolut_x.helpers.to_timestamp_ms.
Balance
Bases: TypedDict
Account balance for a single currency.
Returned by :meth:RevolutXClient.get_balances.
Attributes:
| Name | Type | Description |
|---|---|---|
currency |
str
|
Currency symbol (e.g. |
available |
str
|
Amount available for trading. |
reserved |
str
|
Amount locked in open orders. |
total |
str
|
Total balance (available + reserved). |
Candle
Bases: TypedDict
A single OHLCV candlestick returned by :meth:RevolutXClient.get_candles.
Attributes:
| Name | Type | Description |
|---|---|---|
start |
int
|
Candle open time as Unix timestamp in milliseconds. |
open |
str
|
Opening price (string to preserve decimal precision). |
high |
str
|
Highest price during the interval. |
low |
str
|
Lowest price during the interval. |
close |
str
|
Closing price. |
volume |
str
|
Trading volume in the base currency. |
CurrencyConfig
Bases: TypedDict
Configuration for a single currency.
Returned by :meth:RevolutXClient.get_currencies.
Attributes:
| Name | Type | Description |
|---|---|---|
name |
str
|
Human-readable currency name (e.g. |
symbol |
str
|
Currency ticker (e.g. |
scale |
int
|
Number of decimal places. |
asset_type |
str
|
|
status |
str
|
|
Fill
Bases: TypedDict
A single fill (partial execution) of an order.
Returned by :meth:RevolutXClient.get_order_fills.
Attributes:
| Name | Type | Description |
|---|---|---|
tdt |
int
|
Trade timestamp in milliseconds. |
aid |
str
|
Asset ID (e.g. |
anm |
str
|
Asset name (e.g. |
p |
str
|
Execution price. |
pc |
str
|
Price currency (e.g. |
q |
str
|
Filled quantity. |
qc |
str
|
Quantity currency (e.g. |
tid |
str
|
Trade ID. |
oid |
str
|
Order ID. |
s |
str
|
Side ( |
im |
bool
|
|
Interval
Bases: int, Enum
Candlestick interval in minutes, as accepted by the Revolut X API.
Example::
from revolut_x import Interval
candles = client.get_candles("BTC-EUR", interval=Interval.HOUR_1)
OrderBook
Bases: TypedDict
Order book snapshot from :meth:RevolutXClient.get_order_book.
Each entry is an :class:OrderBookLevel dictionary — not a
[price, quantity] pair. Read the price and quantity from the
p and q keys::
best_bid = book["bids"][0]
print(best_bid["p"], best_bid["q"])
Attributes:
| Name | Type | Description |
|---|---|---|
bids |
list[OrderBookLevel]
|
Buy levels, sorted best (highest price) first. |
asks |
list[OrderBookLevel]
|
Sell levels, sorted best (lowest price) first. |
OrderBookLevel
Bases: TypedDict
A single price level in the order book.
The Revolut X order book uses short field names. The two fields you
normally want are p (price) and q (quantity).
Attributes:
| Name | Type | Description |
|---|---|---|
p |
str
|
Price in the quote currency. |
q |
str
|
Quantity available at this price, in the base currency. |
s |
str
|
Side — |
pc |
str
|
Price currency (e.g. |
qc |
str
|
Quantity currency (e.g. |
aid |
str
|
Asset identifier (e.g. |
anm |
str
|
Asset name (e.g. |
no |
str
|
Number of orders aggregated into this level. |
pn |
str
|
Price notation (e.g. |
qn |
str
|
Quantity notation (e.g. |
ve |
str
|
Venue (e.g. |
ts |
str
|
Trading system (e.g. |
pdt |
str
|
Price timestamp as an ISO-8601 string. |
OrderDetail
Bases: TypedDict
Detailed order information from :meth:RevolutXClient.get_order.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Exchange order ID. |
symbol |
str
|
Trading pair. |
side |
str
|
|
type |
str
|
|
status |
str
|
Order status ( |
quantity |
str
|
Requested quantity. |
filled_quantity |
str
|
Actually filled quantity. |
amount |
str
|
Requested amount in quote currency. |
filled_amount |
str
|
Actually filled amount in quote currency. |
average_fill_price |
str
|
Volume-weighted average fill price. |
total_fee |
str
|
Total fee charged. |
fee_currency |
str
|
Currency of the fee (e.g. |
created_date |
int
|
Creation timestamp in milliseconds. |
updated_date |
int
|
Last update timestamp in milliseconds. |
OrderResponse
Bases: TypedDict
Response returned after placing a new order.
Attributes:
| Name | Type | Description |
|---|---|---|
venue_order_id |
str
|
Exchange-assigned order ID. |
client_order_id |
str
|
Client-provided order ID (UUID). |
state |
str
|
Initial order state (e.g. |
OrderSide
Bases: str, Enum
Direction of an order.
Example::
from revolut_x import OrderSide
side = OrderSide.BUY
OrderType
Bases: str, Enum
Type of an order.
Example::
from revolut_x import OrderType
order_type = OrderType.LIMIT
PairConfig
Bases: TypedDict
Configuration and trading limits for a single pair.
Returned by :meth:RevolutXClient.get_pairs and
:meth:RevolutXClient.get_pair.
Attributes:
| Name | Type | Description |
|---|---|---|
base |
str
|
Base currency symbol (e.g. |
quote |
str
|
Quote currency symbol (e.g. |
base_step |
str
|
Minimum quantity increment (e.g. |
quote_step |
str
|
Minimum price increment (e.g. |
min_order_size |
str
|
Minimum order size in the base currency. |
max_order_size |
str
|
Maximum order size in the base currency. |
min_order_size_quote |
str
|
Minimum order value in the quote currency. |
max_order_size_quote |
str
|
Maximum order value in the quote currency. |
status |
str
|
Pair status — |
slippage |
int
|
Maximum allowed slippage percentage. |
Ticker
Bases: TypedDict
Ticker data for a trading pair from :meth:RevolutXClient.get_ticker.
Attributes:
| Name | Type | Description |
|---|---|---|
symbol |
str
|
Trading pair (e.g. |
bid |
str
|
Best bid (highest buy) price. |
ask |
str
|
Best ask (lowest sell) price. |
mid |
str
|
Midpoint between |
index_price |
str
|
Reference index price. |
last_price |
str
|
Last traded price. |
low_24h |
str
|
24-hour low price. |
high_24h |
str
|
24-hour high price. |
price_change_24h |
str
|
Absolute price change over the last 24 hours. |
volume_24h |
str
|
24-hour trading volume in the base currency. |
quote_volume_24h |
str
|
24-hour trading volume in the quote currency. |
region |
str
|
Venue region (e.g. |
TimeInForce
Bases: str, Enum
Time-in-force policy for limit orders.
Example::
from revolut_x import TimeInForce
client.place_limit_order(..., time_in_force=TimeInForce.GTC)
Trade
Bases: TypedDict
A single public trade returned by :meth:RevolutXClient.get_trades.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
str
|
Unique trade identifier (UUID string). |
symbol |
str
|
Trading pair (e.g. |
price |
str
|
Execution price. |
quantity |
str
|
Traded quantity in the base currency. |
timestamp |
int
|
Trade time as Unix timestamp in milliseconds. |
side |
str
|
|
region |
str
|
Venue region the trade was executed in (e.g. |