OpenPit C++ SDK
C++17 SDK for the OpenPit pre-trade risk engine
openpit::Configurator Class Reference

Public Member Functions

 Configurator (const ::openpit::Engine &engine) noexcept
 
 Configurator (OpenPitEngine *engine) noexcept
 
void OrderSizeLimit (std::string_view name, std::optional<::openpit::pretrade::policies::OrderSizeBrokerBarrier > broker, std::optional< std::vector<::openpit::pretrade::policies::OrderSizeAssetBarrier >> assets=std::nullopt, std::optional< std::vector< ::openpit::pretrade::policies::OrderSizeAccountAssetBarrier >> accountAssets=std::nullopt) const
 
void PnlBoundsKillSwitch (std::string_view name, std::optional< std::vector<::openpit::pretrade::policies::PnlBoundsBrokerBarrier >> brokers=std::nullopt, std::optional< std::vector< ::openpit::pretrade::policies::PnlBoundsAccountBarrierUpdate >> accounts=std::nullopt) const
 
void RateLimit (std::string_view name, std::optional<::openpit::pretrade::policies::RateLimitBrokerBarrier > broker, std::optional< std::vector<::openpit::pretrade::policies::RateLimitAssetBarrier >> assets=std::nullopt, std::optional< std::vector<::openpit::pretrade::policies::RateLimitAccountBarrier >> accounts=std::nullopt, std::optional< std::vector< ::openpit::pretrade::policies::RateLimitAccountAssetBarrier >> accountAssets=std::nullopt) const
 
void SetAccountPnl (std::string_view name, ::openpit::param::AccountId accountId, const ::openpit::param::Asset &settlementAsset, ::openpit::param::Pnl pnl) const
 
::openpit::PolicyConfigurationResult SetSpotFundsAccountPnl (std::string_view name, ::openpit::param::AccountId accountId, ::openpit::accountadjustment::PnlHaltReason reason) const
 Replaces one SpotFunds live account P&L accumulator with a halt reason. More...
 
::openpit::PolicyConfigurationResult SetSpotFundsAccountPnl (std::string_view name, ::openpit::param::AccountId accountId, ::openpit::param::Pnl pnl) const
 Replaces one SpotFunds live account P&L accumulator with a numeric value. More...
 
void SpotFunds (std::string_view name, std::optional< std::uint16_t > globalSlippageBps=std::nullopt, std::optional<::openpit::pretrade::policies::SpotFundsPricingSource > pricingSource=std::nullopt, std::optional< std::vector<::openpit::pretrade::policies::SpotFundsOverride >> overrides=std::nullopt) const
 
void SpotFundsAccountGroupLimitMode (std::string_view name, ::openpit::param::AccountGroupId accountGroupId, std::optional<::openpit::pretrade::policies::SpotFundsLimitMode > mode) const
 
void SpotFundsAccountLimitMode (std::string_view name, ::openpit::param::AccountId accountId, std::optional<::openpit::pretrade::policies::SpotFundsLimitMode > mode) const
 
void SpotFundsGlobalLimitMode (std::string_view name, ::openpit::pretrade::policies::SpotFundsLimitMode mode) const
 
void SpotFundsPnlBoundsKillSwitch (std::string_view name, ::openpit::pretrade::policies::SpotFundsPnlBoundsGlobalBarrierUpdate global=::openpit::pretrade::policies::SpotFundsPnlBoundsGlobalBarrierUpdate::Unchanged(), std::optional< std::vector< ::openpit::pretrade::policies::SpotFundsPnlBoundsAccountGroupBarrier >> accountGroups=std::nullopt, std::optional< std::vector< ::openpit::pretrade::policies::SpotFundsPnlBoundsAccountBarrier >> accounts=std::nullopt) const
 Retunes the SpotFunds self-computed P&L bounds axis. More...
 

Constructor & Destructor Documentation

◆ Configurator() [1/2]

openpit::Configurator::Configurator ( const ::openpit::Engine engine)
inlineexplicitnoexcept

◆ Configurator() [2/2]

openpit::Configurator::Configurator ( OpenPitEngine *  engine)
inlineexplicitnoexcept

Member Function Documentation

◆ OrderSizeLimit()

void openpit::Configurator::OrderSizeLimit ( std::string_view  name,
std::optional<::openpit::pretrade::policies::OrderSizeBrokerBarrier broker,
std::optional< std::vector<::openpit::pretrade::policies::OrderSizeAssetBarrier >>  assets = std::nullopt,
std::optional< std::vector< ::openpit::pretrade::policies::OrderSizeAccountAssetBarrier >>  accountAssets = std::nullopt 
) const
inline

◆ PnlBoundsKillSwitch()

void openpit::Configurator::PnlBoundsKillSwitch ( std::string_view  name,
std::optional< std::vector<::openpit::pretrade::policies::PnlBoundsBrokerBarrier >>  brokers = std::nullopt,
std::optional< std::vector< ::openpit::pretrade::policies::PnlBoundsAccountBarrierUpdate >>  accounts = std::nullopt 
) const
inline

◆ RateLimit()

void openpit::Configurator::RateLimit ( std::string_view  name,
std::optional<::openpit::pretrade::policies::RateLimitBrokerBarrier broker,
std::optional< std::vector<::openpit::pretrade::policies::RateLimitAssetBarrier >>  assets = std::nullopt,
std::optional< std::vector<::openpit::pretrade::policies::RateLimitAccountBarrier >>  accounts = std::nullopt,
std::optional< std::vector< ::openpit::pretrade::policies::RateLimitAccountAssetBarrier >>  accountAssets = std::nullopt 
) const
inline

◆ SetAccountPnl()

void openpit::Configurator::SetAccountPnl ( std::string_view  name,
::openpit::param::AccountId  accountId,
const ::openpit::param::Asset settlementAsset,
::openpit::param::Pnl  pnl 
) const
inline

◆ SetSpotFundsAccountPnl() [1/2]

::openpit::PolicyConfigurationResult openpit::Configurator::SetSpotFundsAccountPnl ( std::string_view  name,
::openpit::param::AccountId  accountId,
::openpit::accountadjustment::PnlHaltReason  reason 
) const
inline

Replaces one SpotFunds live account P&L accumulator with a halt reason.

This is separate from barrier retuning and does not affect any position-level accumulator. When an effective account P&L barrier is configured, the result reports the block immediately recorded by the engine.

◆ SetSpotFundsAccountPnl() [2/2]

::openpit::PolicyConfigurationResult openpit::Configurator::SetSpotFundsAccountPnl ( std::string_view  name,
::openpit::param::AccountId  accountId,
::openpit::param::Pnl  pnl 
) const
inline

Replaces one SpotFunds live account P&L accumulator with a numeric value.

This is separate from barrier retuning and re-arms the accumulator after a calculation halt. It does not affect any position-level accumulator. A value outside the effective bounds returns the account block recorded by the engine immediately; otherwise the returned block list is empty.

◆ SpotFunds()

void openpit::Configurator::SpotFunds ( std::string_view  name,
std::optional< std::uint16_t >  globalSlippageBps = std::nullopt,
std::optional<::openpit::pretrade::policies::SpotFundsPricingSource pricingSource = std::nullopt,
std::optional< std::vector<::openpit::pretrade::policies::SpotFundsOverride >>  overrides = std::nullopt 
) const
inline

◆ SpotFundsAccountGroupLimitMode()

void openpit::Configurator::SpotFundsAccountGroupLimitMode ( std::string_view  name,
::openpit::param::AccountGroupId  accountGroupId,
std::optional<::openpit::pretrade::policies::SpotFundsLimitMode mode 
) const
inline

◆ SpotFundsAccountLimitMode()

void openpit::Configurator::SpotFundsAccountLimitMode ( std::string_view  name,
::openpit::param::AccountId  accountId,
std::optional<::openpit::pretrade::policies::SpotFundsLimitMode mode 
) const
inline

◆ SpotFundsGlobalLimitMode()

void openpit::Configurator::SpotFundsGlobalLimitMode ( std::string_view  name,
::openpit::pretrade::policies::SpotFundsLimitMode  mode 
) const
inline

◆ SpotFundsPnlBoundsKillSwitch()

void openpit::Configurator::SpotFundsPnlBoundsKillSwitch ( std::string_view  name,
::openpit::pretrade::policies::SpotFundsPnlBoundsGlobalBarrierUpdate  global = ::openpit::pretrade::policies:: SpotFundsPnlBoundsGlobalBarrierUpdate::Unchanged(),
std::optional< std::vector< ::openpit::pretrade::policies::SpotFundsPnlBoundsAccountGroupBarrier >>  accountGroups = std::nullopt,
std::optional< std::vector< ::openpit::pretrade::policies::SpotFundsPnlBoundsAccountBarrier >>  accounts = std::nullopt 
) const
inline

Retunes the SpotFunds self-computed P&L bounds axis.

The global update uses the explicitly named Unchanged, Clear, and Set operations. Optional group/account vectors are PATCH axes: std::nullopt leaves the axis unchanged and an engaged empty vector clears it. Account updates preserve each live accumulated P&L value.