Browse Source

Improving the whitepaper and illustrations

master
Lev 2 years ago
parent
commit
7a85ddd23a
  1. BIN
      main.pdf
  2. 53
      main.tex

BIN
main.pdf

Binary file not shown.

53
main.tex

@ -33,6 +33,7 @@
\usepackage{svg} \usepackage{svg}
\usepackage{caption} \usepackage{caption}
\usepackage{subcaption} \usepackage{subcaption}
\usepackage{mathtools,extarrows}
\usepackage{fancyhdr} % Headers and footers \usepackage{fancyhdr} % Headers and footers
\pagestyle{fancy} % All pages have headers and footers \pagestyle{fancy} % All pages have headers and footers
@ -92,17 +93,18 @@
%---------------------------------------------------------------------------------------- %----------------------------------------------------------------------------------------
\section{Introduction and overview} \section{Introduction and overview}
\indent There is a variety of standard financial organizations that provide their capital for some simple purely financial deals: banks, brokers, gambling institutions, betting institutions and many more. Most of them have their own DeFi counterparts, as well as some services that are only possible on the blockchain --- for example, flashloans. \indent There is a variety of standard financial organizations that provide their capital for some simple purely financial deals: banks, brokers, gambling institutions, betting institutions, and many more. Most of them have their own DeFi counterparts, as well as some services that are only possible on the blockchain --- for example, flashloans.
All of these organizations can be generalized to an economic agent that has a utility function and who takes the deal if and only if it is the most beneficial in terms of this function. These particular implementations, however, only consider a very limited subset of deals. Also, all of them work only with purely financial deals which include not more than 3 parties\footnote{An example of such a deal with three parties is a stanard deal on a financial market.}, including the financial organization. All of these organizations can be generalized to an economic agent that has a utility function and accepts a proposed deal if and only if it is the most beneficial in terms of this function. These particular implementations, however, only consider a very limited subset of deals. Also, all of them work only with purely financial deals which include not more than 3 parties\footnote{An example of such a deal with three parties is a stanard deal on a financial market.}, including the financial organization.
Technologies of decentralization and smart contracts in particular provide the foundation for a much more fundamental entity --- one which goes far beyond standard simple templated purely-financial deals. Instead, this entity can be the implementation of the general economic agent. It can analyze deal proposals and combine them into a very complex deal, which it will evaluate and participate in. As a result, this entity can serve as a liquidity provider, loan broker, a service for finding a counterparty. It is worth noticing that as the blockchain technologies spread into multiple fields (not only financial), a service like that can become much more versatile and participate in deals including various assets (domain names, art, computational resources are the examples of what can be possible now, future applications will go much further). Technologies of decentralization and smart contracts in particular provide the foundation for a much more fundamental entity --- one which goes far beyond standard simple templated purely-financial deals. Instead, this entity can be the implementation of the general economic agent.
It can analyze deal proposals and their combinations into more complex deals (for example, combining two proposal in a risk-free deal, like with betting), which it evaluates and participates in. As a result, this entity can serve as a liquidity provider, loan broker, a service for finding a counterparty. It is worth noticing that as the blockchain technologies spread into multiple fields (not only financial), a service like that can become much more versatile and participate in deals including various assets (domain names, art, computational resources are the examples of what can be possible now, future applications will go much further).
The goal of this whitepaper is to present such an entity --- Agorata. The goal of this whitepaper is to present such an entity --- Agorata.
\section{Decision-making algorithm} \section{Decision-making strategy}
In this chapter, the strategy for making decisions will be described. In this chapter, the strategy for making decisions is described.
\subsection{Deal representation} \subsection{Deal representation}
@ -118,8 +120,8 @@ For a state of the contract we can determine the messages that can be sent to th
Each action (message) has parameters $\theta$, including: Each action (message) has parameters $\theta$, including:
\begin{enumerate} \begin{enumerate}
\item $t$ --- the time at which the message is sent.
\item $s$ --- the sender of the message. \item $s$ --- the sender of the message.
\item $t$ --- the time (block number) at which the message is sent (may be omitted in the representation if it is unimportant).
\item tokens sent with the message. \item tokens sent with the message.
\item any other possible information. \item any other possible information.
\end{enumerate} \end{enumerate}
@ -144,8 +146,10 @@ Given these parameters, the value function $V((x_{i}), (t_{i}))$ (or $V(S)$) can
The agent considers the worst case of the deal from the perspective of game theory: the best (from the perspective of the value function) actions of the agent and the ``worst'' actions of the counteragents. The agent considers the worst case of the deal from the perspective of game theory: the best (from the perspective of the value function) actions of the agent and the ``worst'' actions of the counteragents.
This sequence of events is the run through the value function in order to make a decision. This sequence of events is the run through the value function in order to make a decision.
Thus, a deal is considered profitable for the agent ($A$) $\iff$ $p(S_{i})$ $\iff$ Thus, a deal is considered profitable for the agent (denoted by $A$) $\xLongleftrightarrow{def}$ $p(S_{i})$ $\iff$
$$V(S_{i})>0 \vee \\ (\forall a_{ij} (V(S_{ij}) > 0 \vee a.s = A) \wedge a_{ij}: V(S_{ij})>0)$$ $$V(S_{i})>0 \vee \\ (\forall a_{ij} (p(S_{ij}) \vee a.s = A) \wedge \exists a_{ij}: V(S_{ij})>0)$$
Here, $S_{i}$ is state that is analyzed (the state includes the token movements to and from the agent), $a_{ij}$ are the possible actions (messages) in that state. The function $V(S)$ is the value function which analyzes the token movements in terms of profitability.
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. 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.
@ -167,15 +171,36 @@ The algorithm starts at the node $S_{0}$, then considers all the possible action
\end{figure} \end{figure}
\section{Contract evaluation algorithm} \section{Contract evaluation algorithms}
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? 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. This allows to make all the decision based on mathematically proven algorithms. 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} The algorithm for evaluating a path the deal can take has these main states:
\begin{enumerate}
\item Building the formal algorithm from the contract code
\item Finding the optimal language using the formal language
\end{enumerate}
\subsection{The formal representation}
The contract is represented as an actor with several states (a finite number of states which can have parameters --- i.e., variables in the contract) that can receive several (a finite numer of) types of messages and change the state. Each message has a fixed form with parameters and the output state, which parameters depend on the parameters of the message. This dependency is characterized by an algorithm in the form of code in a pure subset of Lisp --- A-Lisp\footnote{The choice of Lisp is motivated primarily by the fact that it is a good unified way to represent an algorithm. There are also ways to use Lisp programs in formal proofs}.
At first, the states and messages will not have parameters. The contract, therefore, will be a finite state machine. For that, the contract will have to check the incoming message on being in the list of allowed messages.
\subsection{Building the formal representation}
At the first stages of the project, the formal representation will be obtained in two ways:
\begin{itemize}
\item Pattern matching on the Fift code for standard contracts made from templates
\item The creation of the contract performed by the user through the constructor on the Agorata website
\end{itemize}
Pattern matching will be based on a set of templates with fields. Most prevalent field types will be addresses, token types, and amounts. This algorithm will be able to recognize proposals of many types, including loans, derivative, flashloans, bets. For example, for a loan the paramters are the two involved tokens, sums in them, participating address.
\subsection{Considering the deal} \subsection{Considering the deal}
% Here it's about the path consideration algo + formal maximization + *template matching* % Here it's about the path consideration algo + formal maximization + *template matching*
@ -190,8 +215,14 @@ The state parameters are represented as functions of action parameters expressed
\subsection{Bets} \subsection{Bets}
\subsection{More complex examples} \subsection{Derivatives}
\subsection{More complex examples and other usages}
Agorata can also be used as a platform for looking for a counteragent for a deal. As a service, it will also feature a constructor of smart contracts from the from the formal language (or its graphical, no-code, representation). This is an extremely useful service since writing programs in FunC is complex, while the logic in most cases is simple.
\section{Conclusion} \section{Conclusion}
% Mention constructor
\end{document} \end{document}

Loading…
Cancel
Save