Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Asset

Overview

The Asset class is the fundamental building block for representing financial instruments in roboquant. Every tradable instrument — whether a stock, option, forex pair, or cryptocurrency — is modeled as a specialized subclass of Asset.

Overview

All asset types extend the common base class, Asset, which provides:

Subclasses can add type-specific attributes and methods.

The symbol should be unique accross all assets.

If you deal with scenarios where there are conflicting symbol names, a solution is to extend the symbol name. For example, you want to differentiate between crypto-pairs on different exchanges, add the exchange name to the symbol name:

For assets to function correctly, it is important that (next to the unique symbol name):

Asset Classes

roboquant supports the following asset types out of the box:

Asset TypeSubclassTypical Use Case
STOCK StockStocks, ETFs, ADRs
OPTIONOptionEquity & index options
FOREXForexCurrency pairs (EUR/USD)
CRYPTOCryptoCrypto spot (BTC/USDT)

You add your own asset classes by extending Asset class.

Instantiation

Although most commonly the Assets are created by the Feed you use, you can also create your own instances.

Output
Stock(symbol='AAPL', currency='USD', info=None)
Stock(symbol='SAN', currency='EUR', info=None)
Forex(symbol='EUR/USD', currency='USD', info=None, contract_size=Decimal('1'))
Crypto(symbol='BTC/USDT', currency='USDT', info=None, contract_size=Decimal('1'))
{'underlying': 'TSLA',
 'expiration': datetime.date(2025, 2, 28),
 'option_type': 'C',
 'strike': 100.0}

Register an Asset

You can register an Asset upfront. Feeds will then pick the registered asset to publish events rather then their own logic.

{Stock(symbol='ASML', currency='EUR', info=None)}