tokenomics_simulator::report

Struct SimulationReport

Source
pub struct SimulationReport {
    pub profit_loss: Decimal,
    pub trades: u64,
    pub successful_trades: u64,
    pub failed_trades: u64,
    pub token_distribution: Vec<Decimal>,
    pub market_volatility: Decimal,
    pub liquidity: Decimal,
    pub adoption_rate: Decimal,
    pub burn_rate: Decimal,
    pub inflation_rate: Decimal,
    pub user_retention: Decimal,
    pub network_activity: u64,
}
Expand description

Report containing the results of a simulation.

Fields§

§profit_loss: Decimal

Profit or loss for the interval.

§trades: u64

Number of trades made in the interval.

§successful_trades: u64

Number of successful trades made in the interval.

§failed_trades: u64

Number of failed trades made in the interval.

§token_distribution: Vec<Decimal>

Token distribution among participants.

§market_volatility: Decimal

Market volatility during the simulation.

§liquidity: Decimal

Liquidity of the token during the simulation.

§adoption_rate: Decimal

Adoption rate of the token.

§burn_rate: Decimal

Burn rate of the token.

§inflation_rate: Decimal

Inflation rate of the token.

§user_retention: Decimal

User retention rate.

§network_activity: u64

Network activity (e.g., transactions per second).

Implementations§

Source§

impl SimulationReport

Source

pub fn calculate_liquidity( &self, trades: Decimal, interval_duration: Decimal, ) -> 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.
§Returns

The liquidity of the token as trades per second.

Source

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

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

§Arguments
  • users - A list of users.
§Returns

The adoption rate as a percentage.

Source

pub fn calculate_burn_rate( &self, total_burned: Decimal, total_users: Decimal, ) -> 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.
§Returns

The burn rate as a percentage.

Source

pub fn calculate_inflation_rate( &self, total_new_tokens: Decimal, total_users: Decimal, ) -> 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.
§Returns

The inflation rate as a percentage.

Source

pub fn calculate_user_retention(&self, users: &[User]) -> 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.
§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.

Source§

impl<'de> Deserialize<'de> for SimulationReport

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SimulationReport

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,