---
tags: Meetings
---
# 5/5/2022 Update
## Agenda
1. Streamr Discussion Questions
2. cadCAD Updates
3. Mathematical Specification Function Updates
## Streamr Discussion Questions
The following questions were raised by streamr for discussion.
### Bounty Agreements Question
#### Question
Bounty agreements can have "direct stakers" (brokers) and Broker agreements (pools of brokers?), Bounty can't differentiate between them. Both transfer DATA token into the Bounty contract (or withdraws from there when leaving).
#### BSCI Response
- This is a good area to delve into deeper.
- Is it feasible that stake can be tracked by whether or not it comes from the broker pool or broker directly by the address?
- Can a broker agreement act like a broker/pass through representation of the broker?
### Tracking Actors Question
#### Question
It could be good to have a "list of actors" to better keep track of brokers, delegators etc., for instance in a form of a scenario description. A detailed scenario could serve as a basis for a test, too.
#### BSCI Answer
- Currently the action space has the actors listed.
- State variables defined after graphics is meant to also list all the important actors in a system.
- Are there other places to show/actors not listed?
### Currency Question
#### Question
Is "currency" same as DATA token? Then there's also "pool token", so that's the "token"?
#### BSCI Answer
- We are working to iron out the exact verbiage to use. Right now currency would be DATA or token. The pool token would be called shares.
### Messages Question
#### Question
What are the "messages" anyway? Are they supposed to be an existing thing in smart contracts, or are they a CADcad artifact?
#### BSCI Answer
- I am using the term messages for any transient payload as opposed to state variables
- It is anything that is being trasmitted between actors to functions, functions to functions, or functions to change state in an actor
### Math Spec Questions 1
Comments to https://hackmd.io/6fN8ITTeTVyMwV3ToeApSw?view
Figure https://hackmd.io/6fN8ITTeTVyMwV3ToeApSw?view#Delegator-Vault-Transfers
Figure https://hackmd.io/6fN8ITTeTVyMwV3ToeApSw?view#Pool-Delegation
#### Question
* Is Vault same as Pool? What are Pool Tokens and how do they connect to DATA?
#### BSCI Answer
- Vault is overarching contract that controls accounting logic and makes transfers much more gas effecient.
- Prior deep dive of all architecture of the vault: https://hackmd.io/7Aippgj8S5uRV14unfMPJg
- Pool is broker pool, there is one broker pool related to the broker and the vault helps with transfers between pools and the actors.
- Pool tokens is the current way pool shares is described.
#### Question
* What are Vaults used for? What's the point of tracking tokens in a vault vs just using the tokens directly? Apparently a Vault has both Token balance (Pool tokens?) and Internal balance (currency i.e. DATA tokens?)
#### BSCI Answer
- Gas effeciency is one reason
- Starting with the vault in V1 allows for the possible extension to having liquidity providers in V2 to deal with rehypothecation issues
- Accounting is standardized across the ecosystem
#### Question
* Is there only one Vault per Pool? Can same Vault participate in many Pools?
#### Answer
- There is one vault for the whole system which deals with all transactions
- All pools + actors registered to this
### Math Spec Questions 2
In figure https://hackmd.io/6fN8ITTeTVyMwV3ToeApSw?view#Broker-Staking
#### Question
* Is "stake" next to Pool Contract same as "stake" next to Stream Contract?
#### Answer
- This is a good question, which should be addressed more in relation to the best smart contract data representation
- One way to define stake data would be that for:
- For brokers: stake maps different stream addresses to the stake that the broker has put in.
- For streams: stake maps different broker address to the stake which they have in the system.
- How is the current implementation done on the stream/bounty side?
#### Question
* Are the "funds" below part of Pool Contract? Is "stake" the bookkeeping of "funds" (that would be DATA tokens)?
#### BSCI Answer
- Yes that is exactly right.
#### Question
* "Deposit/Withdraw funds" ==> whose tokens are transferred? From where to where?
#### BSCI Answer
- Funds from the broker pool/broker agreement is transferred to and from the funds in the stream/bounty.
#### Question
* If the pool stakes into Bounty, then do we keep track of which broker initiated the staking? Are brokers supposed to only ask for "increase stake" if they're going to service the streams? If so, they probably should be held accountable somehow?
#### BSCI Answer
- It is one broker per pool so on the broker side that will be taken care of
- In terms of being held accountable, this would be done on the bountry side with slashing + rewarding
#### Question
* "The process by which a broker increases or decreases their stake in a given stream agreement is shown below." do brokers decide which streams the service? Wouldn't it make more sense that brokers simply join a pool to "be available" for any stream, then the pool would allocate them to the streams that pay the most (like nicehash)? Do delegators have any power in choosing the streams?
#### BSCI Answer
- Current implementation is they must choose the streams
- Having an auto-stream choice would be a good option but requires more thought to what the definition of paying the most is because the future benefits are not immediately known (especially if more brokers join and dilute revenue)
- Good topic for further discussion
### Math Spec Questions 3
In figure https://hackmd.io/6fN8ITTeTVyMwV3ToeApSw?view#Yield
#### Question
* Where does the broker get paid? Presumably the delegators invest in pools by buying pool shares, so they would benefit from pool value going up ("Yield allocated to Pool Value")
#### BSCI Answer
- A portion of the yield is disbursed to the broker
- In the cadCAD model, this is represented by the "owner_share" parameter which says what percent of revenue a broker gets for doing the work
## cadCAD Updates
### Delegator Leaving Behavior
- Leaving behavior for delegators has been created to mock up both a behavioral pattern for them leaving as well as the mechanisms that govern it.
### Increased Delegator Funds (Behavioral)
- A new substep for increasing the delegator outside funds randomly
- This substep is meant to simulate how delegators might have incomes outside of the system that can then be applied to do more delegation
### Smaller Improvements
- Better documentation of the functions has been written
- Variable names being cleaned up to align with the streamr team representations
- A types file is being created to reference what the different types for functions are
## Mathematical Specification Function Updates
### Updates
- Mathematical Specification Link: https://hackmd.io/6fN8ITTeTVyMwV3ToeApSw?view
- All behavioral policies and regular policies have been filled out with the new format.
- We want to validate all language used and the policy names to go through and do a full re-write with all the correct terminology.
- Also want to validate the policies
### Outstanding
- Create a dictionary of all the vocab to be applied across the spec + cadCAD
- Change all places where the language is not matched
- Figure out the broker leaving policies and mechanisms
- Finish the mechanisms section
- Finish the state sections
- Make it obvious that you can go through delegation without using the vault (no need to first transfer funds).