SimulationReport

Struct SimulationReport 

Source
pub struct SimulationReport {
Show 16 fields pub interval: i64, pub users: Option<Vec<User>>, pub profit_loss: Decimal, pub trades: u64, pub successful_trades: u64, pub failed_trades: u64, pub market_volatility: Decimal, pub liquidity: Decimal, pub adoption_rate: Decimal, pub total_burned: Decimal, pub burn_rate: Decimal, pub inflation_rate: Decimal, pub user_retention: Decimal, pub network_activity: u64, pub token_price: Decimal, pub total_new_tokens: Decimal,
}
Expand description

Report containing the results of a simulation.

Fields§

§interval: i64

Timestamp of the simulation interval.

§users: Option<Vec<User>>

List of users and their balances, behaviors, etc. Only available in the final report.

§profit_loss: Decimal

Profit or loss for the interval. Positive value indicates profit, negative value indicates loss.

§trades: u64

Number of trades made in the interval. This includes both successful and failed trades.

§successful_trades: u64

Number of successful trades made in the interval. A trade is considered successful if the user has a positive balance.

§failed_trades: u64

Number of failed trades made in the interval. A trade is considered failed if the user has a zero balance.

§market_volatility: Decimal

Market volatility during the simulation. This is the standard deviation of token prices.

§liquidity: Decimal

Liquidity of the token during the simulation. Liquidity is the number of trades per second.

§adoption_rate: Decimal

Adoption rate of the token. Adoption rate is the percentage of users who have a positive balance.

§total_burned: Decimal

Total number of tokens burned during the simulation.

§burn_rate: Decimal

Burn rate of the token. Burn rate is the number of tokens burned per user.

§inflation_rate: Decimal

Inflation rate of the token. Inflation rate is the number of new tokens created per user.

§user_retention: Decimal

User retention rate. User retention rate is the percentage of users who have a positive balance.

§network_activity: u64

Network activity (e.g., transactions per second). This is the number of transactions made in the interval.

§token_price: Decimal

Actual token price during the simulation. This is the price of the token at the end of the simulation.

§total_new_tokens: Decimal

Total number of new tokens created during the simulation.

Implementations§

Source§

impl SimulationReport

Source

pub fn calculate_liquidity( &self, trades: Decimal, interval_duration: Decimal, decimals: u32, ) -> Decimal

Calculate the liquidity of the token. Liquidity is the number of trades per second.

§Arguments
  • trades - Number of trades made in the interval.
  • interval_duration - Duration of the interval in seconds.
  • decimals - Number of decimal places to round to.
§Returns

The liquidity of the token as trades per second.

Source

pub fn calculate_adoption_rate(&self, users: &[User], decimals: u32) -> Decimal

Calculate the adoption rate. Adoption rate is the percentage of users who have a positive balance.

§Arguments
  • users - A list of users.
  • decimals - Number of decimal places to round to.
§Returns

The adoption rate as a percentage.

Source

pub fn calculate_burn_rate( &self, total_burned: Decimal, total_users: Decimal, decimals: u32, ) -> Decimal

Calculate the burn rate. Burn rate is the number of tokens burned per user.

§Arguments
  • total_burned - Total number of tokens burned.
  • total_users - Total number of users.
  • decimals - Number of decimal places to round to.
§Returns

The burn rate as a percentage.

Source

pub fn calculate_inflation_rate( &self, total_new_tokens: Decimal, total_users: Decimal, decimals: u32, ) -> Decimal

Calculate the inflation rate. Inflation rate is the number of new tokens created per user.

§Arguments
  • total_new_tokens - Total number of new tokens created.
  • total_users - Total number of users.
  • decimals - Number of decimal places to round to.
§Returns

The inflation rate as a percentage.

Source

pub fn calculate_user_retention(&self, users: &[User], decimals: u32) -> Decimal

Calculate the user retention rate. User retention rate is the percentage of users who have a positive balance.

§Arguments
  • users - A list of users.
  • decimals - Number of decimal places to round to.
§Returns

The user retention rate as a percentage.

Trait Implementations§

Source§

impl Debug for SimulationReport

Source§

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

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

impl Default for SimulationReport

Source§

fn default() -> Self

Create a new simulation report with default values.

§Returns

A new simulation report with default values.

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