start fair mixnet detailed tokenomics chapter
This commit is contained in:
@@ -9,7 +9,19 @@ Nym Network is composed of two main elements, the Mixnet represented by [Nym Nod
|
||||
* Nym tokenomics are based on the research paper [*Reward Sharing for Mixnets*](https://nymtech.net/nym-cryptoecon-paper.pdf)
|
||||
* For a more comprehensive overview, live data and supply graphs, cisit [nymtech.net/about/token](https://nymtech.net/about/token)
|
||||
|
||||
## NYM Token
|
||||
**Formulas and Examples Annotation**
|
||||
|
||||
To make it easier for the reader, we will use a highlighting line on the left side, with a specific color:
|
||||
|
||||
```admonish tip title=""
|
||||
Green for formulas.
|
||||
```
|
||||
|
||||
```admonish example collapsible=true
|
||||
Purple collapsible for examples.
|
||||
```
|
||||
|
||||
## NYM Tokenomics
|
||||
|
||||
Besides the Mixnet itself, Nym Network is based on its own blockchain Nyx (IBC on Cosmos) with a native token NYM. NYM token key features are:
|
||||
|
||||
@@ -21,11 +33,53 @@ Besides the Mixnet itself, Nym Network is based on its own blockchain Nyx (IBC o
|
||||
|
||||
To learn more about rewards calculation and distributtion, read the next page [*Nym Operators Rewards*](mixnet-rewards.md).
|
||||
|
||||
### Supply & Distribution
|
||||
|
||||
NYM token is capped at 1b. Below is a table with actual\* token supply distribution.
|
||||
### Utility
|
||||
|
||||
<!--cmdrun cd ../../../scripts/cmdrun && ./api_targets.py s --api mainnet --endpoint circulating-supply --format --separator _ -->
|
||||
*NYM token is a first and foremost a utility to secure Nym Network.*
|
||||
|
||||
Nyx blockchain's validators run API to monitor the network and node performance. Based on the live input the operators and stakers of the active nodes get rewarded and the network is adjusted and re-randomized in the beginning of each epoch (60 min) using cosmwasm smart contracts.
|
||||
|
||||
On one hand node operators get [rewarded](mixnet-rewards.md) for the work they do, but their revenue is not forgranted. Only best performing nodes with a solid reputation can take part in the network. This creates an incentive for people to operate Nym nodes as quality and reliable service. The reputation system also works as a network defense against a large adversary take over or sybil attacks.
|
||||
|
||||
On the other, node reputation is calculated by delegation. Delegation is a stake done by NYM token holders on top of nodes they want to support to join the network as it compensate the stakers with APR. Therefore there is an incetive for NYM holders to stake their token on top of nodes which they believe will perform well. To prevent a whale take-over and centralisation, the revenue grows alongside nodes stake size only until a certain point, after which the rewards per staker start to decrease. We call this mark *node stake saturation*.
|
||||
|
||||
Thanks to Nyx blockchain API monitoring, the flow is dynamic and constantly optimized based on live metrics. Below is a detailed explanation and reckoning of Nym tokenomics logic.
|
||||
|
||||
### Tokenomics
|
||||
|
||||
Before we can arrive to a full comprehension of [node operators rewards](mixnet-rewards.md) and [delegators APR height](https://nymtech.net/about/token) we need to understand some basic logic and stats of Nym token economics. All the data can be [queryied from valdator API](#query-tokenomics-api).
|
||||
|
||||
* **Supply:** NYM token is capped at 1b. Visit [Nym token page](https://nymtech.net/about/token) to see live data and graphs. Current\* circulating supply is <-- cmdrun cd ../../../scripts/cmdrun && ./api_targets.py v --api mainnet --endpoint circulating-supply --value circulating_supply amount ---> NYM.
|
||||
|
||||
* **Staking target:** A number of aimed NYM tokens to be staked in the network. This number can be changed to optimize the following metrics below, currently\* it's set to be <!--cmdrun cd ../../../scripts/cmdrun && ./api_targets.py v --api mainnet --endpoint epoch/reward_params --value interval staking_supply_scale_factor --format percent -->.
|
||||
|
||||
* **Stake saturation:** Node reputation in a form of self bond or stakers delegation. Stake saturation is calculated as:
|
||||
```admonish tip title=""
|
||||
$stake\ saturation = staking\ target\ /\ total\ \#\ of\ nodes$
|
||||
```
|
||||
<!-- CODE AUTO COMPLETION:
|
||||
- # of nodes in the network
|
||||
- circulating supply * staking target
|
||||
- staking target / # of nodes in the network
|
||||
-->
|
||||
|
||||
With current\* circulating supply of <!-- cmdrun cd ../../../scripts/cmdrun && ./api_targets.py v --api mainnet --endpoint circulating-supply --value circulating_supply amount --> NYM, stake saturation of <!-- cmdrun cd ../../../scripts/cmdrun && --> and <!-- cmdrun cd ../../../scripts/cmdrun && --> nodes bonded in Nym Network, the stake saturation level is <!-- cmdrun cd ../../../scripts/cmdrun && --> NYM per node.
|
||||
|
||||
|
||||
### Summary in Numbers
|
||||
|
||||
Below is a table with Nyx chain data\* and token supply distribution.
|
||||
|
||||
<!--cmdrun cd ../../../scripts/cmdrun && ./api_targets.py v --api mainnet --endpoint circulating-supply --format markdown --separator _ -->
|
||||
|
||||
To get live data, visit [Nym token page](https://nymtech.net/about/token
|
||||
) or see `/circulating-supply` [API endpoint](https://validator.nymtech.net/api/v1/circulating-supply).
|
||||
) or see how to [query API endpoints](#query-tokenomics-api).
|
||||
|
||||
## Query Tokenomics API
|
||||
|
||||
<!-- MAKE A QUICK GUIDE TO QUESRY THE STATS -->
|
||||
|
||||
https://validator.nymtech.net/api/v1/circulating-supply
|
||||
|
||||
https://validator.nymtech.net/api/v1/epoch/reward_params
|
||||
|
||||
@@ -32,6 +32,7 @@ def subparser_read(args):
|
||||
response = r.json()
|
||||
return response
|
||||
|
||||
|
||||
def print_time_now(args):
|
||||
#now = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||
#now = time.ctime()
|
||||
@@ -54,7 +55,7 @@ def print_time_now(args):
|
||||
############################################
|
||||
|
||||
def convert_u_nym(unym):
|
||||
unym = int(unym)
|
||||
unym = float(unym)
|
||||
nym = unym / 1000000
|
||||
nym = int(nym)
|
||||
return nym
|
||||
@@ -99,17 +100,43 @@ def _get_desc_column():
|
||||
def read_supply(args):
|
||||
response = subparser_read(args)
|
||||
if args.endpoint == "circulating-supply":
|
||||
if args.format:
|
||||
if args.value:
|
||||
value = get_nested_value(response, args)
|
||||
value = convert_u_nym(value)
|
||||
print(value)
|
||||
elif args.format == "markdown":
|
||||
display_supply_table(response, args)
|
||||
else:
|
||||
print(response)
|
||||
elif args.endpoint == "foo":
|
||||
# placeholder for other endpoint args
|
||||
pass
|
||||
elif args.endpoint == "epoch/reward_params":
|
||||
value = get_reward_params(response, args)
|
||||
print(value)
|
||||
else:
|
||||
# placeholder for other endpoint args
|
||||
pass
|
||||
|
||||
def get_reward_params(response, args):
|
||||
#print(f"args.value = {args.value}, type = {type(args.value)}, lenm={len(args.value)}")
|
||||
#print(f"RESPONSE = {response}")
|
||||
value = get_nested_value(response, args) #THIS WILL COME OUT AS A VARIABVLE response["interval"]["staking_supply_scale_factor"])
|
||||
#value = response + keys
|
||||
if args.format == "percent":
|
||||
value = _return_percent_annotation(value)
|
||||
else:
|
||||
value = convert_u_nym(value)
|
||||
return value
|
||||
|
||||
def get_nested_value(response, args):
|
||||
value = response
|
||||
for key in args.value:
|
||||
value = value[key]
|
||||
return value
|
||||
|
||||
def _return_percent_annotation(value):
|
||||
value = float(value) * 100
|
||||
value = f"{value}%"
|
||||
return value
|
||||
|
||||
###########################################
|
||||
############ GH RELATED FNs ###############
|
||||
###########################################
|
||||
@@ -150,9 +177,9 @@ def parser_main():
|
||||
epilog=''
|
||||
)
|
||||
subparsers = parser.add_subparsers(help="")
|
||||
parser_supply = subparsers.add_parser('supply',
|
||||
help='reads API on supply',
|
||||
aliases=['s',]
|
||||
parser_supply = subparsers.add_parser('validator',
|
||||
help='Reads validaor API enpoints',
|
||||
aliases=['v']
|
||||
)
|
||||
|
||||
parser_supply.add_argument(
|
||||
@@ -166,10 +193,17 @@ def parser_main():
|
||||
type=str,
|
||||
help="choose from: https://validator.nymtech.net/api/swagger/index.html"
|
||||
)
|
||||
parser_supply.add_argument(
|
||||
"-v","--value",
|
||||
type=str,
|
||||
help="dictionary keys to get needed value separated by a space",
|
||||
nargs = '+'
|
||||
)
|
||||
|
||||
parser_supply.add_argument(
|
||||
"-f","--format",
|
||||
action="store_true",
|
||||
help="format the output for documentation purpose (.md) - default: False (raw output)",
|
||||
type=str,
|
||||
help="'markdown' formats the output for documentation purpose; 'percent' returns a number with % annotation",
|
||||
)
|
||||
|
||||
parser_supply.add_argument(
|
||||
@@ -181,6 +215,20 @@ def parser_main():
|
||||
|
||||
parser_supply.set_defaults(func=read_supply)
|
||||
|
||||
|
||||
|
||||
|
||||
parser_calculate = subparsers.add_parser('calculate',
|
||||
help='Print calculated values',
|
||||
aliases=['c']
|
||||
)
|
||||
|
||||
parser_calculate.add_argument(
|
||||
"-f ","--foo",
|
||||
type=str,
|
||||
help="foo"
|
||||
)
|
||||
|
||||
parser_time_now = subparsers.add_parser('time_now',
|
||||
help='Prints UTC time now',
|
||||
aliases=['time', 't']
|
||||
|
||||
Reference in New Issue
Block a user