---
tags: Legacy
---
# Streamr Parameter Selection Under Uncertainty
This document outlines the formal process for building simulations in regards to the streamr system.
## Methodology Description
PSuU is a workflow for standarizing experiments and analysis for enabling agile scientific iterations over recommendations on multi-stakeholder scenarios that are based on complex models. Defining the system goals and linking them to a success criterion allows for understanding what parameterizations are optimal and behave as desired. Given both enviromental parameters (those that can't be controlled) and control parameters (those that are changed by the system owner), simulations over a search region can be conducted to determine how to set up the system.
## Background on Streamr
## System Goals
There are three groups of stakeholders to consider in terms of the system goals.
1. The agreement owner: The individual who has initialized the agreement.
2. Brokers within the agreement: The individuals working to keep the agreement running.
3. Consumers: The parties that are consuming the content and paying the fees.
We now define the goals of the context of each one of the stakeholders:
### Agreement Owner
1. There are enough brokers to quickly enter the functioning state for an agreement
2. There are enough brokers to ensure that when other brokers leave they are replaced quickly enough
### Brokers
3. Payments are fairly distributed in terms of the whole group (total payments are not too low per epoch) as well as between the group (better brokers at a minimum get the same but hopefully get more)
4. Free-riding is minimized
### Consumers
5. There is high quality in terms of the streams.
6. Payment is considered fair
## KPIs
| KPI | System Goal | Description | Variable Name|
| --------|------- | ----- | ----- |
| Spin Up Time | 1 | A measure of median time between initializing an agreement and it being live with brokers. | spin_up_time |
| Percentage time without enough brokers | 2 | A measure of the time during a live agreement that there are not enough brokers. | broker_down_time |
| Return on stake | 3 | A measure of the average of the total earnings of brokers divided by stake | return_on_stake |
| Percentage allocation to bad actors | 4 | The allocations given to bad actors (defined by a maximum performance metric) divided by the total allocation less slashed stakes | bad_actor_allocation|
| Average Performance | 5 | The average of the average performance of brokers per epoch | avg_performance|
| Derived utility | 6 | A utility function incorporating performance less payments into the system by payers | derived_utility|
## Success Criterion
### Parameters
| Parameter Name| System Goal | Description |
| --------|------- | ----- |
| maximum_spin_up_time | 1 | A maximum amount of spin up time for the median value to not exceed |
| maximum_broker_down_time | 2 | A maximum amount of broker down time as a percent|
| minimum_return_on_stake | 3 | A minimum return on stake|
| maximum_bad_actor_allocation | 4 | A maximum allocation to bad actors|
| minimum_avg_performance | 5 | A minimum average performance|
| minimum_derived_utility | 6 | A minimum derived utility|
### Success Criteria
| Criterion Name| System Goals | Specification |
| --------|------- | ----- |
| owner_success | 1, 2 | (spin_up_time < maximum_spin_up_time) AND (broker_down_time < maximum_broker_down_time) |
| broker_success | 3, 4 | (return_on_stake > minimum_return_on_stake) AND (bad_actor_allocation < maximum_bad_actor_allocation) |
| payer_success | 5, 6 | (avg_performance > minimum_avg_performance) AND (derived_utility > minimum_derived_utility) |
| system_success | 1, 2, 3, 4, 5, 6 | owner_success AND broker_success AND payer_success |
## Control Parameters
| Parameter Name| Description | cadCAD Variable| Domain |
| --------|------- |------- |------- |
| Minimum Brokers | The minimum brokers in a system|min_brokers| {1, 2, 3, 4} |
| Maximum Brokers | The maximum brokers in a system|max_brokers| {5, 10, 15, 20} |
| Performance Policy | The policy for performance in the system |performance_policy| {NULL, Oracle Connection, Stake Based Weighting}|
| Allocation Policy | The policy for allocations to brokers |allocation_policy| {Equal Weight, Performance/Weight Based Allocation, Salary and Bonus} |
| Global Leave Policy | The policy for when stake is not slashed globally |global_leave_policy| {Minimum Funding, Large Number of Brokers} |
| Local Leave Policy | The policy for when stake is not slashed for brokers |local_leave_policy| {Minimum Time, Broker Whitelist Leaving} |
| Ability to join policy | The policy for when a new broker is allowed to join|ability_to_join_policy| {Auto-Allow, Broker and Stake, Broker Whitelist} |
## Enviromental Parameters
| Parameter Name| Description | cadCAD Variable|
| --------|------- |------- |
| Joining Distribution| The distribution of joining brokers| |
| Leaving Distribution| The distribution for likelihood of brokers leaving| |
| Performance Function| A parameterized function which simulates the performance of brokers| |
| Topping Up Function| A parameterized function which simulates how often payers will top up the agreement| |
## Search Regions
The cartesian product of all the different potential policies as well as different parameterizations of other parameters.