diff --git a/flashloan_graph.png b/flashloan_graph.png index cfda777..8e4ed53 100644 Binary files a/flashloan_graph.png and b/flashloan_graph.png differ diff --git a/flashloan_graph.svg b/flashloan_graph.svg index 44a09fe..1cc3feb 100644 --- a/flashloan_graph.svg +++ b/flashloan_graph.svg @@ -9,9 +9,9 @@ sodipodi:docname="flashloan_graph.svg" id="svg574" version="1.1" - viewBox="0 0 92.600504 87.805092" + viewBox="0 0 79.329439 87.805092" height="87.805092mm" - width="92.600502mm" + width="79.329437mm" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns="http://www.w3.org/2000/svg" @@ -28,15 +28,15 @@ inkscape:deskcolor="#d1d1d1" inkscape:document-units="mm" showgrid="false" - inkscape:zoom="1.3594764" - inkscape:cx="357.12279" - inkscape:cy="214.42079" + inkscape:zoom="1.918622" + inkscape:cx="240.53721" + inkscape:cy="129.52004" inkscape:window-width="1900" - inkscape:window-height="1010" + inkscape:window-height="990" inkscape:window-x="10" - inkscape:window-y="60" + inkscape:window-y="80" inkscape:window-maximized="1" - inkscape:current-layer="svg574" /> + inkscape:current-layer="layer1" /> Agorata investsAgorata investsSmart contract returnsSmart contract returnsin the response message + width="31.903358" + height="12.611846" + x="91.812447" + y="166.81883" + ry="3.6046669" /> Agorata invests Agorata invests TON Agorata gets - - Contract with in X + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Inconsolata LGC';-inkscape-font-specification:'Inconsolata LGC Bold';stroke-width:0.381678" + x="109.24373" + y="322.60294" + id="tspan7658">Contract with User returns + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'Inconsolata LGC';-inkscape-font-specification:'Inconsolata LGC Bold';stroke-width:0.430554" + x="116.34772" + y="251.84459">User returns TON + style="font-style:italic;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:8.02251px;font-family:'Inconsolata LGC';-inkscape-font-specification:'Inconsolata LGC Bold Italic';stroke-width:0.401125" + x="148.74106" + y="264.85818">TON in in X + + + id="g20663" + transform="matrix(1.7583225,0,0,1.7583225,-30.175089,-171.47581)"> + id="g20659"> + id="g20577"> + id="g20583"> + id="g20589"> + id="g20595"> + id="g20601"> + id="g20607"> + id="g20611"> + id="g20615"> + id="g20619"> + id="g20625"> @@ -1813,106 +1803,135 @@ stroke-opacity="1" stroke-miterlimit="10" d="m 50.213776,10.48407 h 5.480468" - id="id-7548c2bf-a5a4-481f-b1c0-56b6ffc1b9b5" + id="path20629" style="fill:#ffffff;stroke-width:0" /> + id="g20633"> + id="g20639"> + id="g20645"> + id="g20651"> + id="g20655"> + + Value function + in X + style="fill:#62a0ea;stroke:#62a0ea;stroke-width:2.33207" + id="rect2180" + width="68.040405" + height="31.181599" + x="98.905983" + y="197.12395" + ry="7.839057" /> + style="fill:#26a269;fill-opacity:1;stroke:none;stroke-width:2.58483;stroke-dasharray:none;stroke-opacity:1" + id="rect2182" + width="58.358631" + height="22.674149" + x="104.15311" + y="202.11995" + ry="4.6281438" /> + id="g2334" + transform="matrix(1.7583225,0,0,1.7583225,-120.13344,-171.47581)"> + id="g2330"> + id="g2248"> + id="g2254"> + id="g2260"> + id="g2266"> + id="g2272"> + id="g2278"> + id="g2282"> + id="g2286"> + id="g2290"> + id="g2296"> @@ -2188,101 +2207,86 @@ stroke-opacity="1" stroke-miterlimit="10" d="m 50.213776,10.48407 h 5.480468" - id="path20629" + id="path2300" style="fill:#ffffff;stroke-width:0" /> + id="g2304"> + id="g2310"> + id="g2316"> + id="g2322"> + id="g2326"> - - Value function diff --git a/main.pdf b/main.pdf index 4ea6a23..c336f40 100644 Binary files a/main.pdf and b/main.pdf differ diff --git a/main.tex b/main.tex index 49daff2..c5bd45a 100644 --- a/main.tex +++ b/main.tex @@ -30,6 +30,9 @@ \usepackage{authblk} \usepackage{graphicx} +\usepackage{svg} +\usepackage{caption} +\usepackage{subcaption} \usepackage{fancyhdr} % Headers and footers \pagestyle{fancy} % All pages have headers and footers @@ -146,14 +149,34 @@ $$V(S_{i})>0 \vee \\ (\forall a_{ij} (V(S_{ij}) > 0 \vee a.s = A) \wedge a_{ij}: The algorithm starts at the node $S_{0}$, then considers all the possible actions (including the abscence of one) and calls the algorithm at $S_{0i}$. If there is any action of the counteragent that makes the contract non-profitable for the agent, the deal is considered non-profitable. If there is no possible action and the state includes profit for the agent, the deal is considered acceptable. -\subsection{Example} +\subsection{Examples} +\begin{figure}[!htb] + \centering + \begin{subfigure}[b]{0.48\textwidth} + \centering + \includegraphics[width=\textwidth]{flashloan_graph.png} + \caption{Flashloan} + \end{subfigure} + \hfill + \begin{subfigure}[b]{0.48\textwidth} + \centering + \includegraphics[width=\textwidth]{loan_graph.png} + \caption{Loan} + \end{subfigure} + \caption{Graphs for some simple contracts} +\end{figure} \section{Contract evaluation algorithm} In the previous section of the article we specified how the decisions are made. One of the most important parts of the process is finding out whether there exists any action that makes the deal profitable or unprofitable. It is also important to know which actions the agent should make to maximize its output. How do we do that? -The state parameters are represented as functions of action parameters expressed in a formal language. +The state parameters are represented as functions of action parameters expressed in a formal language. This allows to make all the decision based on mathematically proven algorithms. + +\subsection{Building the formal tree} + + +\subsection{Considering the deal} % Here it's about the path consideration algo + formal maximization + *template matching*