# Market Data

Relevant data for pro-traders and arbitrageurs.

## Convergence volume formula

Here you are the Convergence Volume formula which may be useful for those who are willing to perform Convergence trading on EMDX. You can also access it through our API SET (which includes this one and many other relevant functions) here.
The formula is equal to:
$-Q_x + \sqrt{kp^{index}_{x,y}}$
In practice, Qy is called Base Asset Reserve, and Qx, Quote Asset Reserve.
Numerical Example Consider a pool with 40,000 units of USDC (X asset) and 1,000 units of AVAX (Y asset), meaning k = 40,000,000 and the mark price
$(p^{\Pi}_{x,y})$
is equal to
$\frac{40,000}{1,000} = 40$
USDC per unit of AVAX. On the other hand, the index price is
$41$
USDC per unit of AVAX. So, we want to calculate the volume (quantity of USDC) that has to be deposited into the pool for the mark price to reach the index price. Following the Convergence Volume formula, we arrive at the following solution:
$dQ_{USDC} = -40,000 + \sqrt{40,000,000 * 41} = 496.9134.$
This means a trader (or multiple traders) has to open a position with a notional of
USDC (this means leverage * margin has to be equal to 496.9134) for the mark price to converge to the index price. We can easily corroborate that this quantity is correct.

## Annualized and Historical Funding Rates.

### Annualized Funding Rates

Consider the funding rate (denoted as
$r$
) which is calculated as the relative difference between the time-weighted average (TWAP) index price and the TWAP mark price of a given pair of cryptocurrencies
$X/Y$
. Mathematically, we have:
$r_{x,y} = \frac{TWAP_{mark} - TWAP_{index}}{TWAP_{mark} * 24}$
where
$r_{x,y}$
is the funding rate for the pair
$X/Y$
.
Average Funding Rate.
We define the average funding rate
${r}_{x,y}^{t_i, t_n}$
as
${r}_{x,y}^{t_i, t_n} = \frac{1}{n} \sum^{t_n}_{k = t_i}{r^{k}_{x,y}}$
where
$r^{t_k}_{x,y}$
is the funding rate for pair
$X/Y$
at time
$t_k$
. For example
$r^{01/01/2022 00}_{USDC, BTC}$
is the funding rate for the pair
$USDC/BT C$
on the 1st January 2022 at 00hs. Remember that funding rate is calculated every hour.
Markets Data Dashboard.
The page https://app.emdx.io/markets-data displays several metrics in regard to the funding rates of all pairs traded in EMDX. Figure 1 shows a caption of the historical funding rates annualized for each pair. Figure 1: Caption of historical funding rates annualized for different pairs traded at EMDX (source: EMDX platform)
As one can observe, the table displays 5 different funding rates: Predicted, 24hs, 3d, 7d, and 30d. Each one corresponds to an average funding rate in a given time-frame. The 24hs rate is the average funding rate for the last 24 hours, the 3d rate is the average funding rate for the last 3 days, and so on. Mathematically, we can express these rates in the following way:
24hs rate :
${r}^{T - 24hs, T}_{x,y} * 24 * 365$
,
3d rate :
${r}^{T - (24*3)hs, T}_{x,y} * 24 * 365$
,
7d rate :
${r}^{T - (24*7)hs, T}_{x,y} * 24 * 365$
,
30d rate :
${r}^{T - (24*30)hs, T}_{x,y} * 24 * 365$
,
where
$T$
represents the date and time of the last funding rate calculated. On the other hand, the Predicted funding rate is calculated as the funding rate at the current time
$t$
annualized.
Predicted:
$r^{T}_{x,y} * 24 * 365$
For example, consider the current TWAP index price for the BTC/USDC pair is 100 USDC per unit of BTC, and the TWAP mark price is 101 USDC per unit of BTC, then the current funding rate is equal to:
$r_{USDC, BTC} = \frac{101 - 100}{101 * 24} = 0.041\%$
So, the predicted funding rate will be equal to:
$r^{predicted}_{USDC, BTC} = 0.041\% * 24 * 365 = 361.38\%.$

### Historical Funding Rates

In addition to the average annualized funding rates, EMDX will be soon displaying the historical funding rates, which are calculated as the aggregate of rates in a given period.
Mathematically, we define the historical funding rate as
$r^{t_i, t_n}_{x,y} = \sum^{t_n}_{k=t_i}{r^{k}_{x,y}}$
For example, the historical funding rate of the last 30 days for the BTC/USDC pair is calculated as:
$r^{T-(30*24)hs,T}_{USDC, BTC} = \sum^{T}_{k=T - 720hs}{r^{k}_{USDC, BTC}}.$