SimulationOptionsBuilder

Struct SimulationOptionsBuilder 

Source
pub struct SimulationOptionsBuilder {
    pub duration: Option<u64>,
    pub total_users: Option<u64>,
    pub market_volatility: Option<f64>,
    pub decimal_precision: Option<u32>,
    pub interval_type: Option<SimulationInterval>,
    pub transaction_fee_percentage: Option<f64>,
    pub adoption_rate: Option<f64>,
    pub valuation_model: Option<ValuationModel>,
}
Expand description

Builder for creating a new simulation options.

Fields§

§duration: Option<u64>

Duration of the simulation, depending on the interval type.

§total_users: Option<u64>

Number of users in the simulation.

§market_volatility: Option<f64>

Volatility level. 0.0 is no volatility, 1.0 is maximum volatility. This is used to simulate the price volatility in the market.

§decimal_precision: Option<u32>

Decimal precision for the simulation. Default value is 4.

§interval_type: Option<SimulationInterval>

Interval type for the simulation.

§transaction_fee_percentage: Option<f64>

Transaction fee for each trade, in percentage.

§adoption_rate: Option<f64>

Rate at which users adopt the token.

§valuation_model: Option<ValuationModel>

Valuation model for the token.

Implementations§

Source§

impl SimulationOptionsBuilder

Source

pub fn new() -> Self

Create a new simulation options builder to configure the simulation.

§Returns

New simulation options builder.

Source

pub fn duration(self, duration: u64) -> Self

Set the duration of the simulation.

§Arguments
  • duration - Duration of the simulation.
§Returns

The simulation options builder.

Source

pub fn total_users(self, total_users: u64) -> Self

Set the total number of users in the simulation.

§Arguments
  • total_users - Total number of users in the simulation.
§Returns

The simulation options builder.

Source

pub fn market_volatility(self, market_volatility: f64) -> Self

Set the market volatility level.

§Arguments
  • market_volatility - Market volatility level.
§Returns

The simulation options builder.

Source

pub fn decimal_precision(self, decimal_precision: u32) -> Self

Set the decimal precision for the simulation.

§Arguments
  • decimal_precision - Decimal precision for the simulation.
§Returns

The simulation options builder.

Source

pub fn interval_type(self, interval_type: SimulationInterval) -> Self

Set the interval type for the simulation.

§Arguments
  • interval_type - Interval type for the simulation.
§Returns

The simulation options builder.

Source

pub fn transaction_fee_percentage(self, transaction_fee: f64) -> Self

Set the transaction fee for each trade.

§Arguments
  • transaction_fee_percentage - Transaction fee for each trade, in percentage.
§Returns

The simulation options builder.

Source

pub fn adoption_rate(self, adoption_rate: f64) -> Self

Set the rate at which users adopt the token.

§Arguments
  • adoption_rate - Rate at which users adopt the token.
§Returns

The simulation options builder.

Source

pub fn valuation_model(self, valuation_model: ValuationModel) -> Self

Set the valuation model for the token.

§Arguments
  • valuation_model - Valuation model for the token.
§Returns

The simulation options builder.

Source

pub fn build(self) -> Result<SimulationOptions, SimulationError>

Build the simulation options.

§Returns

Built simulation options or an error if required fields are missing.

Trait Implementations§

Source§

impl Debug for SimulationOptionsBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SimulationOptionsBuilder

Source§

fn default() -> SimulationOptionsBuilder

Returns the “default value” for a type. Read more
Source§

impl PartialEq for SimulationOptionsBuilder

Source§

fn eq(&self, other: &SimulationOptionsBuilder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SimulationOptionsBuilder

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
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

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

Source§

fn vzip(self) -> V