Skip to main content

Crate deadeye_optimizer

Crate deadeye_optimizer 

Expand description

EV-maximizing trade picker + LP profitability helpers for Deadeye normal markets.

Mirrors @the-situation/optimizer from the TypeScript SDK. All math runs in f64 — the on-chain math runtime re-verifies the answer in Q128.128 once the trade is submitted, so off-chain we trade a tiny amount of bit-exactness for ~1000× speed-up.

Two-line user mental model:

  1. Call optimize_normal_trade to pick the highest-net-EV trade in the policy region given a budget and a belief.
  2. Call f_at / compute_lp_claim_component_value to reason about LP profitability at a settlement outcome.

Re-exports§

pub use lp::compute_lp_claim_component_value;
pub use lp::compute_total_lp_claim_value;
pub use lp::f_at;
pub use normal::NormalOptimizationInput;
pub use normal::NormalOptimizationResult;
pub use normal::OptimizerConstraints;
pub use normal::optimize_normal_trade;

Modules§

lp
Closed-form AMM f-position + LP claim-component math.
normal
2D grid-search trade optimizer for normal-distribution markets.