pub struct HestonHawkes {
pub gamma: f64,
pub kappa: f64,
pub v_kappa: f64,
pub v_theta: f64,
pub v_xi: f64,
pub rho: f64,
pub dv: f64,
pub alpha: f64,
pub beta: f64,
pub mu_lambda: f64,
pub lambda_step: f64,
pub dq: f64,
}Expand description
Combined Heston-Hawkes Model for Market Making (N=3).
Merges stochastic volatility (Heston) with self-exciting order flow (Hawkes) into a single three-dimensional model, demonstrating seamless N=3 extensibility.
§State Space
[q, v, lambda] where:
q(dim 0): Inventory level (discrete, jump-controlled)v(dim 1): Stochastic variance following CIR dynamicslambda(dim 2): Hawkes order arrival intensity (mean-reverting with self-excitation)
§Dynamics
- Inventory: $dq = +1$ (buy fill) or $-1$ (sell fill)
- Variance: $dv_t = \kappa_v (\theta - v_t) dt + \xi \sqrt{v_t} dW^v_t$
- Intensity: $d\lambda_t = \beta (\mu_\lambda - \lambda_t) dt + \alpha \lambda_t dt$
The optimal spreads incorporate both volatility risk premia (from Heston) and state-dependent arrival rates (from Hawkes).
Fields§
§gamma: f64Risk aversion for inventory holding.
kappa: f64Order filling intensity decay.
v_kappa: f64Mean reversion speed for variance.
v_theta: f64Long-run mean variance.
v_xi: f64Volatility of variance.
rho: f64Correlation between price and variance Brownian motions ($\rho$). Enters the HJB through the cross-variation drift: $-\gamma \rho \xi v q$.
dv: f64Grid step size for variance dimension.
alpha: f64Self-excitation jump size.
beta: f64Mean-reversion speed of intensity.
mu_lambda: f64Baseline intensity level.
lambda_step: f64Grid step for intensity dimension.
dq: f64Grid step for inventory dimension.
Implementations§
Source§impl HestonHawkes
impl HestonHawkes
pub fn new(gamma: f64, kappa: f64) -> Self
pub fn with_heston_params(self, v_kappa: f64, v_theta: f64, v_xi: f64) -> Self
pub fn with_rho(self, rho: f64) -> Self
pub fn with_hawkes_params(self, alpha: f64, beta: f64, mu_lambda: f64) -> Self
Sourcepub fn with_grid_steps(self, dx: &[f64; 3]) -> Self
pub fn with_grid_steps(self, dx: &[f64; 3]) -> Self
Sets grid step sizes from a Grid<3>. Dimension 0 = inventory (dq), Dimension 1 = variance (dv), Dimension 2 = intensity (lambda_step).
Sourcepub fn get_spreads(&self, derivs: &StateDerivatives<3>) -> (f64, f64)
pub fn get_spreads(&self, derivs: &StateDerivatives<3>) -> (f64, f64)
Compute optimal bid/ask spreads given the current state and value gradients.
Combines the Heston volatility risk premium with the Hawkes intensity dependence.
Sourcepub fn fill_rate_base(&self, state: &[f64; 3]) -> f64
pub fn fill_rate_base(&self, state: &[f64; 3]) -> f64
The base arrival intensity is state-dependent: returns the current
intensity state[2] (clamped above 0) for intensity-to-spread conversion.
Sourcepub fn fill_rate_decay(&self) -> f64
pub fn fill_rate_decay(&self) -> f64
The fill-rate decay parameter used for intensity-to-spread conversion.
Trait Implementations§
Source§impl Clone for HestonHawkes
impl Clone for HestonHawkes
Source§fn clone(&self) -> HestonHawkes
fn clone(&self) -> HestonHawkes
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ControlProblem<3> for HestonHawkes
impl ControlProblem<3> for HestonHawkes
Source§type Control = MarketMakingControl
type Control = MarketMakingControl
Source§fn optimize(
&self,
_t: f64,
state: &[f64; 3],
derivs: &StateDerivatives<3>,
) -> Self::Control
fn optimize( &self, _t: f64, state: &[f64; 3], derivs: &StateDerivatives<3>, ) -> Self::Control
(t, state).Source§fn running_reward(
&self,
_t: f64,
_state: &[f64; 3],
control: &Self::Control,
) -> f64
fn running_reward( &self, _t: f64, _state: &[f64; 3], control: &Self::Control, ) -> f64
f(t,x,u).Source§fn bsde_driver(
&self,
_t: f64,
state: &[f64; 3],
control: &Self::Control,
_derivs: &StateDerivatives<3>,
dt: f64,
) -> f64
fn bsde_driver( &self, _t: f64, state: &[f64; 3], control: &Self::Control, _derivs: &StateDerivatives<3>, dt: f64, ) -> f64
Source§fn generator(
&self,
_t: f64,
state: &[f64; 3],
_control: &Self::Control,
derivs: &StateDerivatives<3>,
) -> f64
fn generator( &self, _t: f64, state: &[f64; 3], _control: &Self::Control, derivs: &StateDerivatives<3>, ) -> f64
L^u V for the given control and
derivative bundle.Source§fn constant_discount_rate(&self) -> Option<f64>
fn constant_discount_rate(&self) -> Option<f64>
None (state dependent).Source§fn next_step(
&self,
_t: f64,
state: &[f64; 3],
dt: f64,
noise: &[f64; 3],
) -> [f64; 3]
fn next_step( &self, _t: f64, state: &[f64; 3], dt: f64, noise: &[f64; 3], ) -> [f64; 3]
t.Source§fn next_step_controlled(
&self,
_t: f64,
state: &[f64; 3],
control: &Self::Control,
dt: f64,
noise: &[f64; 3],
) -> [f64; 3]
fn next_step_controlled( &self, _t: f64, state: &[f64; 3], control: &Self::Control, dt: f64, noise: &[f64; 3], ) -> [f64; 3]
Source§fn is_diffusion_dimension(&self, dim: usize) -> bool
fn is_diffusion_dimension(&self, dim: usize) -> bool
Source§fn gradient_step(&self, dim: usize) -> f64
fn gradient_step(&self, dim: usize) -> f64
Source§fn driver(
&self,
t: f64,
state: &[f64; N],
control: &Self::Control,
derivs: &StateDerivatives<N>,
) -> f64
fn driver( &self, t: f64, state: &[f64; N], control: &Self::Control, derivs: &StateDerivatives<N>, ) -> f64
f(t,x,u) + L^u V. Read moreSource§fn apply_constraint(&self, _state: &[f64; N], value: f64) -> f64
fn apply_constraint(&self, _state: &[f64; N], value: f64) -> f64
V >= payoff for an American option. Read moreSource§fn is_reduced_value(&self) -> bool
fn is_reduced_value(&self) -> bool
Source§impl Debug for HestonHawkes
impl Debug for HestonHawkes
Source§impl PdeProblem<3> for HestonHawkes
impl PdeProblem<3> for HestonHawkes
Source§fn dimension_kind(&self, dim: usize) -> DimensionKind
fn dimension_kind(&self, dim: usize) -> DimensionKind
dim. Read moreSource§fn transport(
&self,
_t: f64,
state: &[f64; 3],
control: &Self::Control,
derivs: &StateDerivatives<3>,
) -> Transport<3>
fn transport( &self, _t: f64, state: &[f64; 3], control: &Self::Control, derivs: &StateDerivatives<3>, ) -> Transport<3>
Source§fn jump_kernel(
&self,
_t: f64,
_state: &[f64; N],
_control: &Self::Control,
_derivs: &StateDerivatives<N>,
transport: &Transport<N>,
) -> JumpKernel<N>
fn jump_kernel( &self, _t: f64, _state: &[f64; N], _control: &Self::Control, _derivs: &StateDerivatives<N>, transport: &Transport<N>, ) -> JumpKernel<N>
Auto Trait Implementations§
impl Freeze for HestonHawkes
impl RefUnwindSafe for HestonHawkes
impl Send for HestonHawkes
impl Sync for HestonHawkes
impl Unpin for HestonHawkes
impl UnsafeUnpin for HestonHawkes
impl UnwindSafe for HestonHawkes
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more