-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QIP-0011.md: Initial commit of Quai-Qi Conversion Controller #32
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments, but there are a lot of LaTeX formatting issues which makes it hard to scrutinize the math. I'll take a look again once those are fixed
575f93a
to
78704b4
Compare
means that when there are equivalent value conversion flows from quai to qi | ||
and qi to quai for conversions, the exchange rate controller has found the | ||
market equilibrium exchange rate for Qi and Quai. When the miners are choosing | ||
rewards in Qu and rewards in quai for mining a block at an equivalent frequency, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Qu*
The projected GPU efficiency is introduced to help Qi be more strictly reflective of the electricity | ||
cost component in mining. This will help Qi maintain a more stable purchasing power compared | ||
to having a reward function that does not adjust with GPU efficiency. Again the primary goal | ||
being to have a low enough volotility in the change in purchasing power to allow goods and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volatility*
of the controller will be to maintain equivalent aggregate demand for Qi and Quai. The hash equivalent value | ||
needs to be updated with each step. The $\bar{R}_{hash}$ will be computed as follows: | ||
|
||
$$ \bar{R}\_{hash} = \sum_{l=n-m}^{n} \frac{D_{quai,l} - D_{qi,l}}{D_{quai,l} + D_{qi,l}} $$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this sum is not rendering properly, n should be above the summation symbol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to fix this
|
||
$$ \bar{R}\_{mined} = \frac{\sum_{l=n-m}^n M_{choice,i,j,l}}{m} $$ | ||
|
||
where $n$ is the block number, $m = 50$ is the depth over which the average is taken. This will create an output which ranges from 0 to 1. The controller for calulating the $k_{quai,reward}(\bar{R}_{mined})$ will take the form of: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it 50 or hundered, you say 100 in the above paragraph
$$ | ||
|
||
Based on the launch date of quai this function will need to be adjusted to account | ||
for both the start date as well as the conversion between block number and year. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we use this extracted data to determine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I derived the function that has an input in years, we need to convert that to an input in blocks. Then given t0 + n you can get a relative efficiency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you are saying
### Exchange Rate Controller ### | ||
|
||
The exchange rate controller input will be the simple moving average of the | ||
aggregate hash equivalent demand, $\bar{R}\_{hash}$ for Qi, $D_{qi}$, and Quai, $D_{quai}$ over a period of 100 prime blocks. The setpoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The demand for converting to Qi and the demand for converting to Quai measured in hash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to put that in the spec.
of the controller will be to maintain equivalent aggregate demand for Qi and Quai. The hash equivalent value | ||
needs to be updated with each step. The $\bar{R}_{hash}$ will be computed as follows: | ||
|
||
$$ \bar{R}\_{hash} = \sum_{l=n-m}^{n} \frac{D_{quai,l} - D_{qi,l}}{D_{quai,l} + D_{qi,l}} $$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use an inefficient FIR design (lots of memory and subsequent computations) instead of an IIR design (no memory and only a single iterative computation, just like the DAA, the gas limit filter, or any of the QIP10 filters)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not stable. Notice that the converted values are being recomputed to the relative hash at the current rate rather than converted them in each step and taking the average that incorporates the previous unadjusted rate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which values are getting recomputed? Are you saying
What I propose is this:
How does that result in instability?
Even your PI controller below is implemented as an IIR. Implementation would be a lot simpler for the final form of the controller to be a cascade of two first order IIR filters
|
||
where $n$ is the block number, $m= 100$ is the depth over which the average is taken. This will create an output that ranges from -1 to 1. This will be the input on which the controller operates. The controller for computing $k_{quai,exchange}(\bar{R}_{hash})$ will take the following form: | ||
|
||
$$ k_{quai,exchange}(\bar{R}\_{hash}) = k_{quai,exchange}(\bar{R}\_{hash}) + k_{quai}(\bar{R}\_{hash}) * (P * \bar{R}\_{hash} + I * \sum_{l=n-m}^{n} \bar{R}\_{hash}) $$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This equation is infinitely recursive:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to add n and n-1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the index is actually on
|
||
$$ k_{quai,exchange}(\bar{R}\_{hash}) = k_{quai,exchange}(\bar{R}\_{hash}) + k_{quai}(\bar{R}\_{hash}) * (P * \bar{R}\_{hash} + I * \sum_{l=n-m}^{n} \bar{R}\_{hash}) $$ | ||
|
||
The values for $P_{exchange}$ and $I_{exchange}$ should be chosen to create stable controllers over order of magnitude changes in difficulty. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you provide selections for
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. These are independent and are set based on aggregate system parameters and initial difficulties as well as desired system response.
But I think that the calibrated parameter for the controller is outside the scope of the controller definition.
|
||
where $n$ is the block number, $m = 50$ is the depth over which the average is taken. This will create an output which ranges from 0 to 1. The controller for calulating the $k_{quai,reward}(\bar{R}_{mined})$ will take the form of: | ||
|
||
$$ k_{quai,mined}(\bar{R}\_{mined}) = k_{quai,mined}(\bar{R}\_{mined}) + k_{quai}(\bar{R}\_{mined}) * (P * \bar{R}\_{mined} + I * \sum_{l=n-m}^{n} \bar{R}\_{mined}) $$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you mean to apply the
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same goes for the exchange control equation above, also
No description provided.