- simulation step size (in blocks or seconds)
- simulation steps
- smoothing factor
The domain parameters are static and read-only. They are fixed unless there is a fork of the chain. They affect behavior of both players and non-players.
chain parameters:
- initial amount of active coins
- block and tx reward
- max number of txs in a block
- scale factor for tx fee dynamics
- maximum stake change
- maximum stake ratio
market parameters:
- initial market liveness
- initial market value
- initial coin exchange rate
- initial interest rate of the outer world
- tx generation factor: controls the number of newly generated txs
- base number of txs for each block
- market growth factor: controls dynamics of market liveness
depletion parameters:
- depletion rate for active coins
- depletion rate for pending txs
The simulation runs a model in steps. A model is a state machine and keeps its internal state which consists of blockchain state and market state. In every step, the state is changed by the state transition function, which consists of severral actors as defined in later sections in this document.
Simulation statistics:
- total number of simulation steps elapsed
Simulation statistics for tx processing:
- total number of blocks generated (this measures time elapsed)
- number of newly generated txs in the last step
- number of processed txs in the last step
- number of lost txs in the last step
Tx status:
- current number of txs pending in blockchain nodes
- current tx fee
Chain asset status:
- sum of all coins = sum of all active, dormant, lost and locked coins(stakes)
- sum of all active coins
- sum of all dormant coins
- sum of all lost coins due to lost account keys and etc.
- sum of all stakes and delegated stakes
- market liveness: controls the number of newly generated txs
- market value: total value of all goods ready to be traded in the market (in USD)
- coin exchange rate (in USD for one AMO)
- interest rate of the stake
- interest rate of the outer world
NOTE: This is the only place where we use the unit USD.
Players have their own desires and decision making principles. To mimic real-world human decisions, a few random variables are used when calculating their decisions. Each player represents all entities of the same type, and appears as a single function in the simulation.
Represents user activities in the chain and market.
- generates txs (increase the number of pending txs)
- tx fee trend
The recent tx fee is the average fee during the recent blocks:
where is the tx fee for the step .
The suppressing factor by the tx fee is:
The number of txs newly generated for the step is
where is the tx generation force and is a random variable from the chi-square distribution with the degree of freedom .
where is tx generation factor per month, is the market value for the step , is the number of blocks in one step, is the number of blocks in one month, and is the suppressing factor.
More complex currency dynamics:
- conditions
- tx fee trend
- exchange rate expectation
- desires (affected by exchange rate expectation)
- want to sell out coins (in USD) (lower money demand)
- want to stock coins (in USD) (raise money demand)
- want to sell goods (in AMO) (lower money demand)
- want to buy goods (in AMO) (raise money demand)
- decisions (affected by tx fee trend)
- sell coins (lower exchange rate)
- buy coins (raise exchange rate)
- sell goods
- buy goods
Represents validator activities in the chain and market.
- update stakes
- update interest rate of the chain
- recent tx fee
- number of processed txs in the last step
The recent tx fee is dealt with as in user actor section.
The yearly gain from the stakes is
where is average number of processed txs in recent blocks, is the reawrd for each tx, is the number of blocks in one year, and is the number of blocks in one step.
The yearly cost for keeping the stakes is
It means it takes roughly 1,000 USD to keep the stake worth of 100,000 AMO, and the running cost decreases in log scale. The yearly net gain is .
The total amount of stakes for the step is , and is a stake change for the step . The stake change for the step is
where is the stake increase force and is a random variable from the chi-square distribution with the degree of freedom . is an opportunity cost by keeping stakes. is adjusted according to the total amount of coins. An opportunity cost is half of .
where is the interest rate of the outer world.
The interest rate of the chain for the step is
- desires
- want to sell coins (in USD)
- want to buy coins (in USD)
Non-players don't have their own desires, so no random variable is used when calculating their actions. Each non-player just calculate its output from the input based on the pre-determined rules. Non-players represents activities from AMO blockchain protocol execution or some environmental change.
Represents block generation process of the AMO blockchain protocol.
- process txs (decrease the number of pending txs)
- calculate block and tx reward and increase active coins accordingly
The number of processed txs is the mininum of the number of pending txs and maximum tx capacity of one simulation step.
- convert small amount of active coins to lost coins (asset loss due to lost account keys)
- decrease small number of pending txs (tx loss due to network problem or block limit)
Represents the supply-demand effect of the chain and amrket.
- update market value
- update tx fee
- update coin exchange rate
- the number of pending txs
- the amount of stakes and the amount of active coins
TODO