From d36ec3befa366eb0b49d0417c179d97a048246fa Mon Sep 17 00:00:00 2001 From: Cody Butz Date: Thu, 1 Jun 2023 14:00:57 -0400 Subject: [PATCH 1/2] Remove volatility factor from SP rewards --- main.tex | 49 ++----------------------------------------------- preprocess.sh | 34 +++++++++++++++++----------------- to-docx.sh | 14 +++++++------- 3 files changed, 26 insertions(+), 71 deletions(-) diff --git a/main.tex b/main.tex index e9a8514..4dc1eb7 100644 --- a/main.tex +++ b/main.tex @@ -1101,43 +1101,12 @@ \subsubsection{Stability Pool Staking is based on three variables: \begin{enumerate} -\item - Volatility of the SP's iAsset's underlying asset (\(\sigma\)) \item Stability Pool Saturation (\(\varphi\)) \item Market cap of the SP's iAsset (\(\omega\)) \end{enumerate} -\hypertarget{volatility-for-a-sp-sigma}{% -\paragraph{\texorpdfstring{Volatility for a SP -(\(\sigma\))}{Volatility for a SP (\textbackslash sigma)}}\label{volatility-for-a-sp-sigma}} - -can be calculated using the formula: - -\[\sigma = \left\{ \begin{matrix} -\begin{pmatrix} -\text{let}\text{\ y\ }\text{equal}\ \left\langle \frac{x_{j}}{x_{j - 1}} - 1\ :j\ \in \ \left\langle 2,\ldots,\left| x \right| \right\rangle \right\rangle \\ -\ \\ -\sqrt{\frac{\sum_{i = 1}^{\left| y \right|}\left( y_{i} - \overline{y} \right)^{2}}{\left| y \right|}} \\ -\end{pmatrix} & \text{if}\ \left| x \right| > 30 \\ -\ & \ \\ -0 & \text{if}\ \left| x \right| \leq 30 \\ -\end{matrix} \right.\ \] - -Where: - -\begin{itemize} -\item - \(\sigma\) is the volatility of the iAsset -\item - \(x\) is the sequence of the iAsset's tracked asset's historical daily - close price for the past year (or maximum amount of time that data - exists for) denominated in iAsset's collateral (i.e., ADA) -\end{itemize} - -\filbreak - \hypertarget{stability-pool-saturation-varphi}{% \paragraph{\texorpdfstring{Stability Pool Saturation (\(\varphi\))}{Stability Pool Saturation (\textbackslash varphi)}}\label{stability-pool-saturation-varphi}} @@ -1204,12 +1173,6 @@ \subsubsection{Stability Pool Staking \(\sigma\), \(\varphi\), and \(\omega\), and is calculated daily using: \[\rho = \begin{pmatrix} -\text{let}\ \sigma_{s}\ \text{equal}\ \sum_{i = 1}^{\left| \sigma \right|}\left\{ \begin{matrix} -\frac{1}{\sigma_{i}} & \text{if}\ \sigma_{i} > 0\ \text{and}\ t_{i} > 0 \\ -\ & \ \\ -0 & \text{otherwise} \\ -\end{matrix} \right.\ \\ -\ \\ \text{let}\ \varphi_{s}\ \text{equal}\ \sum_{i = 1}^{\left| \varphi \right|}\left\{ \begin{matrix} \frac{1}{\varphi_{i}} & \text{if}\ \varphi_{i} > 0\ \text{and}\ t_{i} > 0 \\ \ & \ \\ @@ -1226,12 +1189,6 @@ \subsubsection{Stability Pool Staking 0 & \text{if}\ t_{a} \leq 0 \\ \ & \ \\ \begin{pmatrix} -\text{let}\ \sigma_{v}\ \text{equal}\ \left\{ \begin{matrix} -\frac{1}{\sigma_{a}}/\sigma_{s} & \text{if}\ \sigma_{a} > 0\ \text{and}\ \sigma_{s} > 0 \\ -\ & \ \\ -0 & \text{otherwise} \\ -\end{matrix} \right.\ \\ -\ \\ \text{let}\ \varphi_{v}\ \text{equal}\ \left\{ \begin{matrix} \frac{1}{\varphi_{a}}/\varphi_{s} & \text{if}\ \varphi_{a} > 0\ \text{and}\ \varphi_{s} > 0 \\ \ & \ \\ @@ -1245,9 +1202,9 @@ \subsubsection{Stability Pool Staking \end{matrix} \right.\ \\ \ \\ \left\{ \begin{matrix} -\frac{\sigma_{v} + \varphi_{v} + \omega_{v}}{3} & \text{if}\ \varphi_{s} > 0\ \text{and}\ \omega_{s} > 0 \\ +\frac{\varphi_{v} + \omega_{v}}{2} & \text{if}\ \varphi_{s} > 0\ \text{and}\ \omega_{s} > 0 \\ \ & \ \\ -\sigma_{v} & \text{otherwise} \\ +0 & \text{otherwise} \\ \end{matrix} \right.\ \\ \end{pmatrix} & \text{otherwise} \\ \end{matrix} \right.\ \\ @@ -1258,8 +1215,6 @@ \subsubsection{Stability Pool Staking \begin{itemize} \item \(\rho\) is the distribution coefficient for the iAsset -\item - \(\sigma\) is the sequence of volatility values of each iAsset \item \(\varphi\) is the sequence of Stability Pool saturation values of each iAsset diff --git a/preprocess.sh b/preprocess.sh index e4d1d6d..5d60f9c 100755 --- a/preprocess.sh +++ b/preprocess.sh @@ -6,11 +6,11 @@ set -e # Convert tabularx tables to longtables so pandoc can understand sed 's/\\end{tabularx}/\\end{longtable}/g' "${1:-main.tex}" > main.tex.tmp.pandoc -sed -i 's/\\begin{tabularx}{\\linewidth}{/\\begin{longtable}[]{/g' main.tex.tmp.pandoc -sed -i 's/\\begin{longtable}.*/\L&/g' main.tex.tmp.pandoc +sed -i '' -e 's/\\begin{tabularx}{\\linewidth}{/\\begin{longtable}[]{/g' main.tex.tmp.pandoc +sed -i '' -e 's/\\begin{longtable}.*/\L&/g' main.tex.tmp.pandoc # Fix texttt -sed -i 's/}\\texttt{//g' main.tex.tmp.pandoc +sed -i '' -e 's/}\\texttt{//g' main.tex.tmp.pandoc # Process with pandoc pandoc main.tex.tmp.pandoc -f latex -t latex -o main.tex.tmp.pandoc @@ -29,7 +29,7 @@ start=$(grep -n '\tableofcontents' main.tex.tmp | head -1 | cut -d ':' -f 1) end=$(grep -n '\hypertarget' main.tex.tmp | head -1 | cut -d ':' -f 1) start=$((start + 1)) end=$((end - 2)) -sed -i "${start},${end}d" main.tex.tmp +sed -i '' -e "${start},${end}d" main.tex.tmp # Copy over end of main.tex total_lines=$(wc -l main.tex | cut -d ' ' -f 1) @@ -39,20 +39,20 @@ echo "" >> main.tex.tmp tail -n "$end" main.tex >> main.tex.tmp # Format tables -sed -i 's/\\tabularnewline/\n\\tabularnewline\n\\midrule/g' main.tex.tmp -sed -i -e '1h;2,$H;$!d;g' -e 's/\\midrule\n\\midrule/\\midrule/g' main.tex.tmp -sed -i -e '1h;2,$H;$!d;g' -e 's/\\midrule\n\\toprule/\\toprule/g' main.tex.tmp -sed -i -e '1h;2,$H;$!d;g' -e 's/\\midrule\n\\bottomrule/\\bottomrule/g' main.tex.tmp -sed -i 's/\\strut//g' main.tex.tmp -sed -i '/^\\begin{minipage}/d' main.tex.tmp -sed -i 's/^\\end{minipage}.*/\&/g' main.tex.tmp -sed -i -e '1h;2,$H;$!d;g' -e 's/\&\n\\tabularnewline/\\tabularnewline/g' main.tex.tmp -sed -i '/\\endfirsthead/,/\\midrule/d' main.tex.tmp -sed -i -e '1h;2,$H;$!d;g' -e 's/\\\midrule\n\\midrule/\\midrule/g' main.tex.tmp -sed -i 's/\\ldots{}/\\ldots/g' main.tex.tmp +sed -i '' -e 's/\\tabularnewline/\n\\tabularnewline\n\\midrule/g' main.tex.tmp +sed -i '' -e '1h;2,$H;$!d;g' -e 's/\\midrule\n\\midrule/\\midrule/g' main.tex.tmp +sed -i '' -e '1h;2,$H;$!d;g' -e 's/\\midrule\n\\toprule/\\toprule/g' main.tex.tmp +sed -i '' -e '1h;2,$H;$!d;g' -e 's/\\midrule\n\\bottomrule/\\bottomrule/g' main.tex.tmp +sed -i '' -e 's/\\strut//g' main.tex.tmp +sed -i '' -e '/^\\begin{minipage}/d' main.tex.tmp +sed -i '' -e 's/^\\end{minipage}.*/\&/g' main.tex.tmp +sed -i '' -e '1h;2,$H;$!d;g' -e 's/\&\n\\tabularnewline/\\tabularnewline/g' main.tex.tmp +sed -i '' -e '/\\endfirsthead/,/\\midrule/d' main.tex.tmp +sed -i '' -e '1h;2,$H;$!d;g' -e 's/\\\midrule\n\\midrule/\\midrule/g' main.tex.tmp +sed -i '' -e 's/\\ldots{}/\\ldots/g' main.tex.tmp # Convert longtables back to tabularx -sed -i 's/\\end{longtable}/\\end{tabularx}/g' main.tex.tmp +sed -i '' -e 's/\\end{longtable}/\\end{tabularx}/g' main.tex.tmp tabularx_headers=($(grep '\\begin{tabularx}' main.tex)) longtable_headers=($(grep -n '\\begin{longtable}' main.tex.tmp | cut -d ':' -f 1)) @@ -67,7 +67,7 @@ script_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &> /dev/null && pwd) python3 $script_dir/figures.py # Remove height from images -sed -i 's/\,height=\\textheight//g' main.tex.tmp +sed -i '' -e 's/\,height=\\textheight//g' main.tex.tmp # Done mv main.tex.tmp main.tex diff --git a/to-docx.sh b/to-docx.sh index 3fc2c02..3614a13 100755 --- a/to-docx.sh +++ b/to-docx.sh @@ -6,15 +6,15 @@ set -e # Convert tabularx tables to longtables so pandoc can understand sed 's/\\end{tabularx}/\\end{longtable}/g' "${1:-main.tex}" > main.tex.tmp.pandoc -sed -i 's/\\begin{tabularx}{\\linewidth}{/\\begin{longtable}[]{/g' main.tex.tmp.pandoc -sed -i 's/\\begin{longtable}.*/\L&/g' main.tex.tmp.pandoc +sed -i '' -e 's/\\begin{tabularx}{\\linewidth}{/\\begin{longtable}[]{/g' main.tex.tmp.pandoc +sed -i '' -e 's/\\begin{longtable}.*/\L&/g' main.tex.tmp.pandoc # Convert formulas -sed -i 's/\\genfrac{}{}{}{}/\\frac/g' main.tex.tmp.pandoc -sed -i 's/\\cfrac/\\frac/g' main.tex.tmp.pandoc -sed -i 's/\\raisebox//g' main.tex.tmp.pandoc -sed -i 's/{\$/{/g' main.tex.tmp.pandoc -sed -i 's/\$}/}/g' main.tex.tmp.pandoc +sed -i '' -e 's/\\genfrac{}{}{}{}/\\frac/g' main.tex.tmp.pandoc +sed -i '' -e 's/\\cfrac/\\frac/g' main.tex.tmp.pandoc +sed -i '' -e 's/\\raisebox//g' main.tex.tmp.pandoc +sed -i '' -e 's/{\$/{/g' main.tex.tmp.pandoc +sed -i '' -e 's/\$}/}/g' main.tex.tmp.pandoc # Process with pandoc pandoc main.tex.tmp.pandoc -f latex -t docx -o main.docx From 79b87aee887c970ed3017cf55d0113d900bd6d85 Mon Sep 17 00:00:00 2001 From: Cody Butz Date: Thu, 1 Jun 2023 14:01:07 -0400 Subject: [PATCH 2/2] Update version --- main.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tex b/main.tex index 4dc1eb7..0099968 100644 --- a/main.tex +++ b/main.tex @@ -72,7 +72,7 @@ {\Huge Synthetic Assets on Cardano}\\[2\baselineskip] {\Large Indigo Laboratories, Inc.}\\[0.5\baselineskip] {\large info@indigo-labs.io}\\[3\baselineskip] -{\large November 2022, v1.0.1} +{\large November 2022, v1.1.0} } \end{titlepage}