Skip to content

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:TimeInForce for 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:TimeLike for time range parameters.

TimeLike module-attribute

TimeLike = Union[int, float, datetime, date, str]

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. 'EUR', 'BTC').

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. 'Bitcoin').

symbol str

Currency ticker (e.g. 'BTC').

scale int

Number of decimal places.

asset_type str

'crypto' or 'fiat'.

status str

'active' or 'inactive'.

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. 'BTC').

anm str

Asset name (e.g. 'Bitcoin').

p str

Execution price.

pc str

Price currency (e.g. 'EUR').

q str

Filled quantity.

qc str

Quantity currency (e.g. 'BTC').

tid str

Trade ID.

oid str

Order ID.

s str

Side ('buy' or 'sell').

im bool

True if this fill was a maker trade (0% fee).

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)

DAY_1 class-attribute instance-attribute

DAY_1 = 1440

1-day (24h) candles.

DAY_2 class-attribute instance-attribute

DAY_2 = 2880

2-day candles.

DAY_4 class-attribute instance-attribute

DAY_4 = 5760

4-day candles.

HOUR_1 class-attribute instance-attribute

HOUR_1 = 60

1-hour candles.

HOUR_4 class-attribute instance-attribute

HOUR_4 = 240

4-hour candles.

MIN_1 class-attribute instance-attribute

MIN_1 = 1

1-minute candles.

MIN_15 class-attribute instance-attribute

MIN_15 = 15

15-minute candles.

MIN_30 class-attribute instance-attribute

MIN_30 = 30

30-minute candles.

MIN_5 class-attribute instance-attribute

MIN_5 = 5

5-minute candles.

WEEK_1 class-attribute instance-attribute

WEEK_1 = 10080

1-week candles.

WEEK_2 class-attribute instance-attribute

WEEK_2 = 20160

2-week candles.

WEEK_4 class-attribute instance-attribute

WEEK_4 = 40320

4-week (28-day) candles.

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 — 'BUYI' for bids, 'SELL' for asks.

pc str

Price currency (e.g. 'EUR').

qc str

Quantity currency (e.g. 'BTC').

aid str

Asset identifier (e.g. 'BTC').

anm str

Asset name (e.g. 'Bitcoin').

no str

Number of orders aggregated into this level.

pn str

Price notation (e.g. 'MONE').

qn str

Quantity notation (e.g. 'UNIT').

ve str

Venue (e.g. 'REVX').

ts str

Trading system (e.g. 'CLOB').

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

'buy' or 'sell'.

type str

'market' or 'limit'.

status str

Order status ('new', 'filled', 'canceled', …).

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. 'EUR').

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. 'new').

OrderSide

Bases: str, Enum

Direction of an order.

Example::

from revolut_x import OrderSide
side = OrderSide.BUY

BUY class-attribute instance-attribute

BUY = 'buy'

Buy the base currency (e.g. buy BTC for EUR).

SELL class-attribute instance-attribute

SELL = 'sell'

Sell the base currency (e.g. sell BTC for EUR).

OrderType

Bases: str, Enum

Type of an order.

Example::

from revolut_x import OrderType
order_type = OrderType.LIMIT

LIMIT class-attribute instance-attribute

LIMIT = 'limit'

Limit order — placed in the order book at a specific price (maker fee: 0.00%).

MARKET class-attribute instance-attribute

MARKET = 'market'

Market order — executed immediately at the best available price (taker fee: 0.09%).

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. 'BTC').

quote str

Quote currency symbol (e.g. 'EUR').

base_step str

Minimum quantity increment (e.g. '0.00000001').

quote_step str

Minimum price increment (e.g. '0.01').

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 — 'active' or 'inactive'.

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. 'BTC/EUR').

bid str

Best bid (highest buy) price.

ask str

Best ask (lowest sell) price.

mid str

Midpoint between bid and ask.

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. 'EEA', 'UK').

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)

GTC class-attribute instance-attribute

GTC = 'gtc'

Good 'til canceled — the order stays open until filled or manually canceled.

IOC class-attribute instance-attribute

IOC = 'ioc'

Immediate or cancel — fill as much as possible immediately, cancel the rest.

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. 'BTC/EUR').

price str

Execution price.

quantity str

Traded quantity in the base currency.

timestamp int

Trade time as Unix timestamp in milliseconds.

side str

'buy' or 'sell'.

region str

Venue region the trade was executed in (e.g. 'EEA', 'UK').