title: Bid–ask matrix
text: # Bid–ask matrix
  
  The bid–ask matrix is a matrix with elements corresponding with exchange rates between the assets. These rates are in physical units (e.g. number of stocks) and not with respect to any numeraire. The $(i,j)$ element of the matrix is the number of units of asset $i$ which can be exchanged for 1 unit of asset $j$.
  
  ## Mathematical definition
  
  A $d\times d$ matrix $\Pi =\left[\pi _{ij}\right]_{1\leq i,j\leq d}$ is a bid-ask matrix, if
  
  * $\pi _{ij}>0$ for $1\leq i,j\leq d$. Any trade has a positive exchange rate.
  * $\pi _{ii}=1$ for $1\leq i\leq d$. Can always trade 1 unit with itself.
  * $\pi _{ij}\leq \pi _{ik}\pi _{kj}$ for $1\leq i,j,k\leq d$. A direct exchange is always at most as expensive as a chain of exchanges.
  
  ## Example
  
  Assume a market with 2 assets (A and B), such that $x$ units of A can be exchanged for 1 unit of B, and $y$ units of B can be exchanged for 1 unit of A. Then the bid–ask matrix $\Pi$ is:
  
      $\Pi ={\begin{bmatrix}1&x\\y&1\end{bmatrix}}$
  
  It is required that $xy\geq 1$ by rule 3.
  
  With 3 assets, let $a_{ij}$ be the number of units of i traded for 1 unit of j. The bid–ask matrix is:
  
      $\Pi ={\begin{bmatrix}1&a_{12}&a_{13}\\a_{21}&1&a_{23}\\a_{31}&a_{32}&1\end{bmatrix}}$
  
  Rule 3 applies the following inequalities:
  
  * $a_{12}a_{21}\geq 1$
  * $a_{13}a_{31}\geq 1$
  * $a_{23}a_{32}\geq 1$
  * $a_{13}a_{32}\geq a_{12}$
  * $a_{23}a_{31}\geq a_{21}$
  * $a_{12}a_{23}\geq a_{13}$
  * $a_{32}a_{21}\geq a_{31}$
  * $a_{21}a_{13}\geq a_{23}$
  * $a_{31}a_{12}\geq a_{32}$
  
  For higher values of d, note that 3-way trading satisfies Rule 3 as
  
      $x_{ik}x_{kl}x_{lj}\geq x_{il}x_{lj}\geq x_{ij}$
  
  ## Relation to solvency cone
  
  If given a bid–ask matrix $\Pi$ for $d$ assets such that $\Pi =\left(\pi ^{ij}\right)_{1\leq i,j\leq d}$ and $m\leq d$ is the number of assets which with any non-negative quantity of them can be "discarded" (traditionally $m=d$). Then the solvency cone $K(\Pi )\subset \mathbb {R} ^{d}$ is the convex cone spanned by the unit vectors $e^{i},1\leq i\leq m$ and the vectors $\pi ^{ij}e^{i}-e^{j},1\leq i,j\leq d$.
  
  Similarly given a (constant) solvency cone it is possible to extract the bid–ask matrix from the bounding vectors.
  
  