---
# System prepended metadata

title: Protocol Monetary Trade Policy Overview

---

# Protocol Monetary Trade Policy Overview
This feature opens a new space in cryptoeconomic design.  It can best be thought of as “Protocol Monetary Trade Policy” as far as we can tell at the moment.  We’re naming our first implementation of a feature of this kind after the category for now.  Hopefully, the name sparks additional creativity in the ideation of future extensions or alternative methods of execution.

Sifchain’s liquidity pool code sets a price ratio for assets in its two-sided liquidity pools.  The formula for this price ratio for a given swap is: 

$$y(x)=\frac{xYX}{(x+X)^2}$$

Please see [AMM Specification](https://hackmd.io/6VK2LSYjRTyeNCoHpVt2hg) for more details including variable definitions and the derivation of this formula.

An obvious extension of this formula to include oracle driven pricing or other forms of unequal pooling would be.  

$$y(x)=Y(1-(\frac{X}{x+X})^\frac{w_x}{w_y}) (1-\frac{x}{x+X})$$

Here, $w_x$ and $w_y$ control the weight that is assumed for each token in the pool, removing the pre-existing assumption that they were in the pool at equal quantities.  The variables $w_x$ and $w_y$ are analogous to the weights Wi and Wo in the [Balancer Whitepaper](https://balancer.fi/whitepaper.pdf), check there for further explanation.

The crux of Protocol Monetary Trade Policy is to set the ratio $w_x/w_y$ through governance.  That allows Sifchain governance to set a target ratio to be used in the swap formula for pools on Sifchain.  

For the first version, governance can set this ratio and a target block height by which that ratio should be achieved.  The protocol will shift the ratio to be one unit closer for every block until it reaches its target.

More formally, 

Let $h$ = current block height
Let $h_F$ = block height be the last block height in the policy's duration
Let $(w_{xF},w_{yF})$ be the values selected by Sifchain governance for $w_x$ and $w_y$ at $h_F$ 
Let $w_{xt}, w_{yt}$ be the weights for the block height at time t

$$w_{xt} = w_{xt-1} + (w_{xF} - w_{xh}) / (h_F-h)$$

$$w_{yt} = w_{yt-1} + (w_{yF} - w_{yh}) / (h_F-h)$$

Note: $w_x + w_y = 1$ and any proposed $(w_{xF},w_{yF})$ must hold $w_{xF} + w_{yF} = 1$.

## Monetary Policy and Trade Policy 

Fiat currency managers use monetary policy to influence the interest rates for short term borrowing or the supply of money.  They use trade policy to influence the rate at which goods in their sovereign domain are exchanged. 

This feature allows Sifchain governance to combine the two objectives by influencing exchange rates amongst assets (trade policy) to influence currency-wide purchasing power (monetary policy).  

Most cryptocurrencies influence monetary policy through inflationary rewards.  This is increasing the quantity of tokens a token holder has to trade.  Protocol Monetary Trade Policy allows Sifchain governance to instead influence the number of opportunities a currency holder has to trade their existing quantity of tokens at a specified ratio.  

Note that setting $w_x$ and $w_y$ does not necessarily set $P_{x,y}$.  Market participants inside Sifchain's DEX and outside it will be able to swap tokens freely and shift the ratio of X and Y in Sifchain's liquidity pools.  

## Outdated / Scrap

The content below is saved for posterity but is no longer relevant.  See https://hackmd.io/iolJD93KTFyGZm_J6INzWg?view for an updated description of how prices are calculated without directly focusing on weights

> For the first version, governance can set this ratio and a target block height by which that ratio should be achieved.  The protocol will shift the ratio to be one unit closer for every block until it reaches its target.
> 
> More formally, 
> 
> Let $h$ = current block height
> Let $h_F$ = block height be the last block height in the policy's duration
> Let $(w_{xF},w_{yF})$ be the values selected by Sifchain governance for $w_x$ and $w_y$ at $h_F$ 
> Let $w_{xt}, w_{yt}$ be the weights for the block height at time t
> 
> $$w_{xt} = w_{xt-1} + (w_{xF} - w_{xh}) / (h_F-h)$$
> 
> $$w_{yt} = w_{yt-1} + (w_{yF} - w_{yh}) / (h_F-h)$$
> 
> Note: $w_x + w_y = 1$ and any proposed $(w_{xF},w_{yF})$ must hold $w_{xF} + w_{yF} = 1$.