Struct NormalOptimizationInput
pub struct NormalOptimizationInput {
pub budget: f64,
pub belief_mean: f64,
pub belief_sigma: f64,
pub market_mean: f64,
pub market_sigma: f64,
pub effective_k: f64,
pub payout_amplifier: f64,
pub constraints: OptimizerConstraints,
}Expand description
Inputs to optimize_normal_trade.
Fields§
§budget: f64Trader’s budget in collateral tokens.
belief_mean: f64Trader’s belief mean.
belief_sigma: f64Trader’s belief σ (from the UI’s confidence selector).
market_mean: f64Current market mean.
market_sigma: f64Current market σ.
effective_k: f64AMM effective_k (post LP scaling).
payout_amplifier: f64Payout amplifier (default 1.0).
constraints: OptimizerConstraintsPolicy bounds.
Implementations§
§impl NormalOptimizationInput
impl NormalOptimizationInput
pub fn new(
budget: f64,
belief_mean: f64,
belief_sigma: f64,
market_mean: f64,
market_sigma: f64,
effective_k: f64,
) -> Self
pub fn new( budget: f64, belief_mean: f64, belief_sigma: f64, market_mean: f64, market_sigma: f64, effective_k: f64, ) -> Self
Convenience constructor with sane defaults (amplifier=1, default constraints).
Examples found in repository?
examples/sigma_arb_probe.rs (lines 31-33)
11fn main() {
12 let cases: &[(&str, f64, f64, f64, f64, f64, f64)] = &[
13 // (label, mu_b, sigma_b, mu_m, sigma_m, k_eff, budget)
14 ("live-CPI-2026-05-14", 4.3274, 0.2143, 4.2900, 0.3500, 75.07, 50.0),
15 ("μ-only arb HUGE budget", 4.5000, 0.3500, 4.2900, 0.3500, 75.07, 1e9),
16 ("σ-only HUGE budget", 4.2900, 0.2143, 4.2900, 0.3500, 75.07, 1e9),
17 ("classic README scenario", 2.4700, 0.1581, 2.1000, 0.2000, 50.00, 50.0),
18 ("scenario w/ low k", 4.5000, 0.3500, 4.2900, 0.3500, 1.00, 50.0),
19 ("CPI shape unequal-σ", 4.3274, 0.2143, 2.1000, 0.3500, 75.07, 50.0),
20 ("CPI σ + low-μ market", 4.3274, 0.2143, 0.1000, 0.3500, 75.07, 50.0),
21 ("README+CPI-μ μ-only", 2.4700, 0.2000, 2.1000, 0.2000, 50.00, 50.0),
22 ];
23
24 println!(
25 "{:<26} {:>9} {:>9} {:>9} {:>9} {:>11} {:>10} {:>9} {:>9} {:>9} {:>9}",
26 "case", "μ_b", "σ_b", "μ_m", "σ_m", "k_eff", "budget", "μ_g*", "σ_g*", "coll", "EV"
27 );
28 println!("{}", "─".repeat(132));
29
30 for (label, mu_b, sigma_b, mu_m, sigma_m, k, budget) in cases.iter().copied() {
31 let r = optimize_normal_trade(NormalOptimizationInput::new(
32 budget, mu_b, sigma_b, mu_m, sigma_m, k,
33 ));
34 println!(
35 "{label:<26} {mu_b:>9.4} {sigma_b:>9.4} {mu_m:>9.4} {sigma_m:>9.4} {k:>11.4} \
36 {budget:>10.2} {:>9.4} {:>9.4} {:>9.4} {:>9.4}",
37 r.optimized_mean,
38 r.optimized_sigma,
39 r.collateral_required,
40 r.expected_value,
41 );
42 }
43}Trait Implementations§
§impl Clone for NormalOptimizationInput
impl Clone for NormalOptimizationInput
§fn clone(&self) -> NormalOptimizationInput
fn clone(&self) -> NormalOptimizationInput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for NormalOptimizationInput
impl Debug for NormalOptimizationInput
§impl PartialEq for NormalOptimizationInput
impl PartialEq for NormalOptimizationInput
§fn eq(&self, other: &NormalOptimizationInput) -> bool
fn eq(&self, other: &NormalOptimizationInput) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for NormalOptimizationInput
impl StructuralPartialEq for NormalOptimizationInput
Auto Trait Implementations§
impl Freeze for NormalOptimizationInput
impl RefUnwindSafe for NormalOptimizationInput
impl Send for NormalOptimizationInput
impl Sync for NormalOptimizationInput
impl Unpin for NormalOptimizationInput
impl UnsafeUnpin for NormalOptimizationInput
impl UnwindSafe for NormalOptimizationInput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more