pub struct BotConfig {Show 17 fields
pub environment: String,
pub private_key: String,
pub address: String,
pub vault_address: Option<String>,
pub base_url_override: Option<String>,
pub strategy_type: String,
pub markets: Vec<Market>,
pub poll_delay_ms: u64,
pub grid: Option<GridConfigJson>,
pub mm: Option<MMConfigJson>,
pub dca: Option<DCAConfigJson>,
pub arbitrage: Option<ArbitrageConfigJson>,
pub orchestrator: Option<OrchestratorConfigJson>,
pub builder_fee: Option<BuilderFeeConfig>,
pub sync: Option<SyncConfigJson>,
pub simulation: Option<SimulationConfig>,
pub extra: HashMap<String, Value>,
}Expand description
Bot configuration - V2 format with markets array. This is the unified config format for all strategies.
Fields§
§environment: StringEnvironment: “testnet” or “mainnet”
private_key: StringPrivate key (hex, with or without 0x prefix).
Optional — resolved at runtime from ~/.supurr/credentials.json if absent.
address: StringWallet address.
Optional — resolved at runtime from ~/.supurr/credentials.json if absent.
vault_address: Option<String>Optional vault address
base_url_override: Option<String>Optional Hyperliquid base URL override. When set, both /info and /exchange requests use this gateway.
strategy_type: StringStrategy type: “grid”, “mm”, “dca”, or “arbitrage”
markets: Vec<Market>Markets to trade on (V2 format - uses bot_core::Market enum)
poll_delay_ms: u64Polling delay in milliseconds
grid: Option<GridConfigJson>Grid strategy configuration
mm: Option<MMConfigJson>Market Maker strategy configuration
dca: Option<DCAConfigJson>DCA strategy configuration
arbitrage: Option<ArbitrageConfigJson>Arbitrage strategy configuration
orchestrator: Option<OrchestratorConfigJson>Parent strategy configuration for grouped child strategies.
builder_fee: Option<BuilderFeeConfig>Builder fee configuration
sync: Option<SyncConfigJson>Trade sync configuration for upstream API PnL tracking
simulation: Option<SimulationConfig>Simulation configuration (paper/backtest) Optional — uses sensible defaults if absent.
extra: HashMap<String, Value>Catch-all for custom strategy configuration sections.
Any JSON key that doesn’t match a named field above lands here.
Custom strategies read their config via config.custom_config("mystrategy").
Implementations§
Source§impl BotConfig
impl BotConfig
Sourcepub fn primary_market(&self) -> &Market
pub fn primary_market(&self) -> &Market
Get the primary market from the markets array
Sourcepub fn is_spot_like(&self) -> bool
pub fn is_spot_like(&self) -> bool
Check if the primary market settles like spot with no margin/leverage.
Sourcepub fn primary_market_uses_margin(&self) -> bool
pub fn primary_market_uses_margin(&self) -> bool
Check if the primary market uses margin/leverage.
Sourcepub fn is_outcome(&self) -> bool
pub fn is_outcome(&self) -> bool
Check if this is a prediction market outcome
Sourcepub fn instrument_id(&self) -> InstrumentId
pub fn instrument_id(&self) -> InstrumentId
Get instrument ID from primary market
Sourcepub fn market_index(&self) -> MarketIndex
pub fn market_index(&self) -> MarketIndex
Get market index from primary market
Sourcepub fn hip3_config(&self) -> Option<Hip3MarketConfig>
pub fn hip3_config(&self) -> Option<Hip3MarketConfig>
Get HIP-3 config if this is a HIP-3 market
Sourcepub fn custom_config<T: DeserializeOwned>(
&self,
strategy_name: &str,
) -> Result<T>
pub fn custom_config<T: DeserializeOwned>( &self, strategy_name: &str, ) -> Result<T>
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Load config from environment variables. V2 configs require a JSON file, so this returns an error.
Sourcepub fn resolve_credentials(&self) -> Result<(String, String)>
pub fn resolve_credentials(&self) -> Result<(String, String)>
Resolve wallet credentials: use fields from config if present,
otherwise fall back to ~/.supurr/credentials.json.
Returns (private_key, address).
Sourcepub fn parse_environment(&self) -> Environment
pub fn parse_environment(&self) -> Environment
Parse environment from string
Sourcepub fn strategy_leverage(&self) -> Option<(Decimal, Decimal)>
pub fn strategy_leverage(&self) -> Option<(Decimal, Decimal)>
Extract strategy leverage and max_leverage from whichever strategy config is active.
Returns Some((leverage, max_leverage)) if the active strategy has leverage settings.
Sourcepub fn strategy_allocated_capital_usdc(&self) -> Option<Decimal>
pub fn strategy_allocated_capital_usdc(&self) -> Option<Decimal>
Capital allocated to the active strategy, used as the performance metric base.
This is deliberately strategy-scoped. Wallet/account equity is not used here because unrelated idle wallet capital would dilute APR, Sharpe, and drawdown percentages.
Sourcepub fn effective_simulation_config(&self) -> SimulationConfig
pub fn effective_simulation_config(&self) -> SimulationConfig
Get the effective simulation config, falling back to defaults if absent.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BotConfig
impl<'de> Deserialize<'de> for BotConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for BotConfig
impl JsonSchema for BotConfig
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more