Skip to main content

AvellanedaGueant

Struct AvellanedaGueant 

Source
pub struct AvellanedaGueant {
    pub gamma: f64,
    pub sigma: f64,
    pub kappa: f64,
    pub a: f64,
    pub q_max: usize,
}
Expand description

The asymptotic approximation (infinite horizon) for the Avellaneda-Stoikov model. Based on the Gueant-Lehalle-Tapia closed-form solution.

Reference: Guéant, O., Lehalle, C. A., & Tapia, J. (2013). Dealing with the inventory risk: a solution to the market making problem.

Fields§

§gamma: f64§sigma: f64§kappa: f64§a: f64§q_max: usize

Inventory truncation used when evaluating the value reference.

Implementations§

Source§

impl AvellanedaGueant

Source

pub fn new(gamma: f64, sigma: f64, kappa: f64, a: f64) -> Self

Source

pub fn with_q_max(self, q_max: usize) -> Self

Sets the inventory truncation used for the value reference.

Source

pub fn approximate_spreads(&self, q: f64) -> (f64, f64)

Guéant-Lehalle-Tapia closed-form approximation for optimal spreads.

This approximation assumes infinite time horizon ($T \to \infty$) and small spreads, providing a stationary strategy that depends on inventory $q$ but not time $t$.

The spreads are symmetric around the mid-price, shifted by inventory: $\delta^\pm(q) \approx \text{RiskNeutral} \pm \text{InventorySkew} \cdot q$

Reference: Guéant, O., Lehalle, C. A., & Tapia, J. (2013). Dealing with the inventory risk.

Source

pub fn stationary_theta(&self, q_max: usize, q: i32) -> f64

Stationary value function theta(q) for the reduced Avellaneda model.

The exact stationary solution of the GLT linearized HJB is the principal eigenvector v(q) of the symmetric tridiagonal operator with diagonal -alpha q^2 and off-diagonal eta, where

alpha = (kappa / 2) gamma sigma^2
eta   = a (1 + gamma/kappa)^{-(1 + kappa/gamma)}

The reduced solver works directly in theta space, with v(q) = exp(kappa theta(q)). The value is normalized so theta(0) = 0, which removes the one-parameter translation invariance of the stationary HJB. Only differences theta(q) - theta(q') are invariant under the normalization and therefore meaningful.

§Panics

Panics if q is outside [-q_max, q_max].

Source

pub fn stationary_spreads(&self, q_max: usize, q: i32) -> (f64, f64)

Stationary bid/ask spreads implied by the principal-eigenvector value.

The bid spread is base + (theta(q) - theta(q+1)) / 2 adjusted for the half-inventory convention, and the ask spread is the mirror around the base spread. This matches the approximate_spreads small-gamma limit.

Trait Implementations§

Source§

impl AnalyticalSolution<2> for AvellanedaGueant

Source§

fn value_function(&self, _t: f64, state: &[f64; 2]) -> f64

Returns the theoretical value function V(t, state)
Source§

fn optimal_controls(&self, _t: f64, state: &[f64; 2]) -> MarketMakingControl

Returns the optimal controls (intensities) at (t, state)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V