#include <fastmm/core/instrument.hpp>
|
| constexpr bool | enabled () const noexcept |
| |
| constexpr bool | inverse () const noexcept |
| |
| constexpr bool | coin_quoted () const noexcept |
| |
| constexpr Price | round_price (Price p, Side side) const noexcept |
| | Passive rounding: bids down, asks up.
|
| |
| constexpr Qty | round_qty (Qty q) const noexcept |
| |
| constexpr Price | ticks (std::int64_t n) const noexcept |
| | n ticks as a price distance (tick * n).
|
| |
| constexpr bool | valid_price (Price p) const noexcept |
| |
| constexpr bool | valid_qty (Qty q) const noexcept |
| |
| constexpr Notional | notional (Price p, Qty q) const noexcept |
| | Notional in the settlement currency: price * qty * multiplier for a linear contract, and qty * multiplier / price (base coin) for an inverse one, whose contract size is quoted in the quote currency.
|
| |
| constexpr Notional | pnl_per_tick () const noexcept |
| | PnL change (settlement ccy) for one tick move on one contract.
|
| |
| constexpr Notional | inverse_pnl (Price from, Price to, Qty qty) const noexcept |
| | PnL in the base coin of moving qty contracts from from to to: qty * multiplier * (1/from - 1/to).
|
| |
| constexpr std::string_view | settlement_ccy () const noexcept |
| | The currency PnL, fees and notional are denominated in: the base coin for an inverse contract, the quote currency otherwise.
|
| |
| constexpr bool | is_derivative () const noexcept |
| |
◆ Flags
| Enumerator |
|---|
| kEnabled | |
| kInverse | Priced in one currency and settled in another (Deribit's BTC perpetual: USD against BTC): notional is qty * multiplier / price and PnL moves with 1 / price, in the base coin.
|
| kReduceOnlySupported | |
| kCoinQuoted | An option whose premium is in its underlying coin (Deribit's BTC options, 0.0065 BTC): its model value is the USD price divided by the forward.
Valued linearly in that premium; not kInverse.
|
◆ enabled()
| constexpr bool fastmm::Instrument::enabled |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ inverse()
| constexpr bool fastmm::Instrument::inverse |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ coin_quoted()
| constexpr bool fastmm::Instrument::coin_quoted |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ round_price()
| constexpr Price fastmm::Instrument::round_price |
( |
Price |
p, |
|
|
Side |
side |
|
) |
| const |
|
inlineconstexprnoexcept |
Passive rounding: bids down, asks up.
◆ round_qty()
| constexpr Qty fastmm::Instrument::round_qty |
( |
Qty |
q | ) |
const |
|
inlineconstexprnoexcept |
◆ ticks()
| constexpr Price fastmm::Instrument::ticks |
( |
std::int64_t |
n | ) |
const |
|
inlineconstexprnoexcept |
n ticks as a price distance (tick * n).
◆ valid_price()
| constexpr bool fastmm::Instrument::valid_price |
( |
Price |
p | ) |
const |
|
inlineconstexprnoexcept |
◆ valid_qty()
| constexpr bool fastmm::Instrument::valid_qty |
( |
Qty |
q | ) |
const |
|
inlineconstexprnoexcept |
◆ notional()
Notional in the settlement currency: price * qty * multiplier for a linear contract, and qty * multiplier / price (base coin) for an inverse one, whose contract size is quoted in the quote currency.
Zero for an inverse contract at a non-positive price.
◆ pnl_per_tick()
| constexpr Notional fastmm::Instrument::pnl_per_tick |
( |
| ) |
const |
|
inlineconstexprnoexcept |
PnL change (settlement ccy) for one tick move on one contract.
An inverse contract's tick value depends on the price (multiplier * tick / price^2), so this is zero for one: use inverse_pnl() instead.
◆ inverse_pnl()
PnL in the base coin of moving qty contracts from from to to: qty * multiplier * (1/from - 1/to).
Zero unless both prices are positive.
◆ settlement_ccy()
| constexpr std::string_view fastmm::Instrument::settlement_ccy |
( |
| ) |
const |
|
inlineconstexprnoexcept |
The currency PnL, fees and notional are denominated in: the base coin for an inverse contract, the quote currency otherwise.
Empty when the instrument does not name it.
◆ is_derivative()
| constexpr bool fastmm::Instrument::is_derivative |
( |
| ) |
const |
|
inlineconstexprnoexcept |
◆ id
◆ venue
| VenueId fastmm::Instrument::venue {} |
◆ asset_class
◆ flags
| std::uint8_t fastmm::Instrument::flags = 0 |
◆ price_decimals
| std::uint8_t fastmm::Instrument::price_decimals = 8 |
◆ tick
| Price fastmm::Instrument::tick {} |
◆ lot
| Qty fastmm::Instrument::lot {} |
◆ min_qty
| Qty fastmm::Instrument::min_qty {} |
◆ max_qty
| Qty fastmm::Instrument::max_qty {} |
◆ min_notional
| Notional fastmm::Instrument::min_notional {} |
◆ contract_multiplier
8 units of underlying per contract
◆ max_notional
| Notional fastmm::Instrument::max_notional {} |
◆ expiry_ns
| std::int64_t fastmm::Instrument::expiry_ns = 0 |
◆ strike
| Price fastmm::Instrument::strike {} |
◆ symbol
| Symbol fastmm::Instrument::symbol {} |
◆ base
| FixedString<8> fastmm::Instrument::base {} |
◆ quote
| FixedString<8> fastmm::Instrument::quote {} |
◆ option_type
◆ cold_pad_
| std::uint8_t fastmm::Instrument::cold_pad_[8] = {} |