CoFiX Now: Understand CoFiX through 5 Questions

Logan King
CoFiX
Published in
10 min readDec 17, 2020

--

The upcoming new Automated Market Maker protocol (AMM) for CoFiX is the most anticipated project on the track of the decentralized trading in the DeFi field. Although there were many minor problems with its front-end functions, CoFix raised more than USD 100 million on the first day of the launch.

Many professional digital currency market makers and traders are optimistic about this product and quickly participate in CoFiX’s liquidity mining and transaction mining. However, for amateurs, CoFiX can be difficult to understand, and the densely packed formulas in the protocol white paper can be daunting. To allow more DeFi enthusiasts to better use CoFi, a new type of decentralized trading product, we compile the following Q&A, so that everyone can enjoy the beauty of mathematics and the charm of “all risks are calculable” that professional traders value.

Q1: What are the transaction costs in CoFiX?

Currently, CoFiX supports USDT/ETH, HBTC/ETH and HBTC/USDT exchange.
Transaction costs in CoFiX consist of:
1) NEST oracle price “call” fee: A 0.01ETH fee, which is charged per transfer regardless of the transaction amount.
2) Compensation factor K is the coefficient related to the volatility rate σ and delay T.
When a trader makes a transaction, he does not directly use the price P but rather P‘=P*(1+K)(or P’=P*(1-K)).
3) A 2‰ transaction fee, which has been included in the “Exchange Price” displayed on the front end
4) If the volume of a single transaction exceeds 500 ETH, there will be an extra fee called the Impact Cost.

Point 2, 3, and 4 above are reflected in the “Exchange Price” in the form of the bid-ask spread.

To elaborate on the composition of these costs:

NEST Oracle Call Fee: When anyone calls the price date from NEST oracle, he/she pays 0.01 ETH.
If the NEST oracle is called twice at the same time, 0.02 ETH is paid. For example, the USDT/ETH trading pair only needs to call the NEST oracle data once, while the USDT/HBTC trading pair needs to call the NEST oracle data twice, so the latter costs 0.02 ETH.

Impact Cost: When the size of the CoFiX asset pool is large enough, it is difficult for a single transaction or cumulative transaction per unit of time to reach the upper limit of assets, but a single large transaction volume may affect the hedging cost of the market makers. Therefore, a certain premium is charged for a single transaction with a large volume. This premium is called the impact cost (for the impact of a given transaction volume on the price)

The impact cost for transactions with different volume is shown in the following table :

(The impact cost is charged when the transaction volume ≥ 500ETH)

As shown in the table above, because of the NEST oracle call fees, CoFiX is suitable for high-value transactions (more than 10 ETH) instead of small-amount transactions.

The significant advantage of CoFiX is that there is no marginal price impact (buying 10 ETH is charged the same amount as buying 400 ETH), making it ideal for large-amount transactions.

One important reminder for CoFiX traders: the displayed price that users see on the front-end website is not necessarily the final transaction price, because the packaging time for each transaction is uncertain. If the packaging time is too long, the price may be updated to the latest transaction price. If the packaging time exceeds 10 minutes, or the spread is greater than 1%, the transaction will fail.

Q2: Is there any risks in providing liquidity for the CoFiX capital pool?

To put it simply, unlike other AMM mechanisms, providing liquidity (i.e. market-making) for CoFiX incur no impermanent loss and capital pool arbitrage. However, since it is a “market-making” protocol, risks are inevitable.

To better understand the possible risks of providing liquidity to CoFiX, let’s start with the “share” of the fund pool.

1) What is “share” and how it is calculated?

The XToken represents the proportion of the asset pool owned by a market maker. As market makers put assets into the pool, they receive corresponding XTokens. When a market maker exits the pool, they do so by redeeming their XToken, which entitles them to their share of the pool.

LP token for USTD-ETH capital pool: XT-1 Token
LP token for HBTC-ETH capital pool: XT-2 Token

CoFiX calculates its share based on ETH. Assuming that currently 1 ETH = 350 USDT, the net worth is 1:

If I provide 3500 USDT, which is converted into 10 ETH, then my share is 10 shares;

If I directly provide 10 ETH, it is also 10 shares;

If the net worth is 1.1 at this time, if I directly provide 10 ETH, it becomes to 10/1.1 = 9.0909. shares;

In other words, the number of shares is directly related to the net worth of the pool at that time.

After understanding the concept of “share”, let’s go further into the concept of “net worth”.

2) What is “net worth” and how it is calculated?
Npnok is the net worth of each share (XToken), it is represented by its ETH value, and the asset pool total issuance share is S (The total amount of XToken).
Npnok = the total value of asset pool (in ETH) / total number of shares.

Taking ETH-USDT as an example, when the market maker pool is created, initially Npnok=1. ETH-USDT asset pool total issuance share is S (The total amount of XToken). Assuming that the first liquidity provider provides 100 ETH to make the market, the initial net value is 1 by default, and the pool share is 100 at this point .

If I provide 3500 USDT with the exchange rate 1 ETH = 350 USDT, that is 10 ETH, which represents 10 shares;
Now the net worth is still 1:
Npnok = (100+10)/110 = 1

If another market maker provides 3500 USDT, but with a different exchange rate 1 ETH = 400 USDT. Now the 3500 USDT equals 8.75 ETH, which represents 8.75 shares;

The asset pool now has 100 ETH (first provider) + 3500 USDT (me) + 3500 USDT (the other market maker).

As for ETH, the pool has 117.5 ETH, while the number of shares is: 100 (firs provider) + 10 (me) + 8.75 (the other market maker) = 118.75 shares

At this point, Npnok = 117.5/118.75 = 0.98947

Therefore, if the price of ETH rises, the net worth will decrease; if its price drops, the net worth will increase.

3) What is net worth used for?

When the liquidity provider is “exiting” the pool, he/she needs to use net worth to redeem assets. Calculated on the basis of ETH, redeemable assets are converted into ETH = share (number of XToken ) * net worth (Npnok) (excluding the transaction cost of redemption).

4) How do liquidity providers redeem their assets?

Redemption means exiting a certain trading pool and stopping the market making. The liquidity provider transfers the XToken into the ETH or USDT based on the current net worth. The transferred XToken will be destroyed.

Calculated on the basis of ETH, redeemable assets are converted into ETH = share (XToken quantity) * Npnok;

Then, the liquidity provider can freely redeem the asset, either ETH or USDT;

If USDT is selected, the amount of USDT will be calculated at the current exchange price = the amount of ETH * exchange price P (P is at the time of redemption).

Note: The price P already includes a 2‰ transaction fee.

5) Do liquidity providers need to call NEST oracles?

Yes. When entering or exiting the liquidity pool, net worth needs to be calculated, during which the NEST oracle is called with a 0.01 ETH fee.

6) How do liquidity providers hedge?

The liquidity provider must do hedging, otherwise, there might be asset loss; The loss is not the so-called “ impermanent loss”, because CoFiX doesn’t price the asset by a fixed algorithm and no arbitrageurs are needed. Instead, CoFiX leverages the NEST oracle to decide the dealing price. The loss is caused by the rise and fall in the asset price, because the net value changes along with the price fluctuation.

Although the shares are fixed, the changed net worth will lead to the fluctuation of the redeemable assets of the liquidity provider.

Therefore, there are also requirements for the professionalism of liquidity providers. Qualified liquidity providers have to do hedging, otherwise, there is a probability of asset loss.

Note : Hedging strategy and script for CoFiX liquidity provider (the open-source script is provided by the community’s developer for reference only, please remain cautious) http://github.com/Computable-Finance/CoFiX-hedger

Q3: How to generate CoFi Token through mining?

CoFi tokens are generated through the 3 mining pools.

First, Mining pool A, the trading mining pool:
For dynamic mining in pool A, the total number of tokens is variant. The number of token generated per TX is based on the extra fees collected from that TX, the token generation speed (Token per block) of the latest 300 blocks, and the size and equilibrium of Mining pool B. 80% of the tokens generated from Mining pool A goes to traders, 10% goes to the corresponding liquidity providers, and 10% goes to the nodes.

Second, Mining pool B, the liquidity mining pool:
This mining pool consists of fixed token generation and floating token generation. For fixed token generation, each block generates 9 CoFi tokens and the number will drop by 20% for every 2,400,000 blocks (integer only). After the total number hits 9,600,000, the decrement stops. The floating part equals to 10% of transaction mining.

Third, Mining pool C, the node mining pool (development team & early supporters):
This mining pool consists of fixed token generation and floating token generation. For fixed token generation, each block generates 1 CoFi token and the number will drop by 20% for every 2,400,000 blocks (integer only). After the total number hits 9,600,000, the decrement stops. The floating part equals to 10% of transaction mining.

Assuming that the number of blocks produced per day in Ethereum is 6,400:

1) Traders will produce a certain number of CoFi for each mining transaction, of which 80% goes to traders, 10% goes to the node mining pool, and 10% goes to the market maker mining pool.

The generation of CoFi for each transaction mainly depends on the commission paid for the transaction, and the estimation of floating generation is made through the CoFiX mining algorithm:

Assuming that the number of transactions per day is 6,400, with 20 ETH for each transaction, and the size of the capital pool is USD 100 million then the daily floating volume is 7,800 CoFi and 2.85 million CoFi per year; (the number is larger on the first day while the figure is the estimated number for a stable situation)

2) The fixed amount generated by Ming pool B is 57600 CoFi per day and 21.02 million per year approximately. The number will drop by 20% per year and cease to decrease after reaching 9,600,000 blocks (about 4 years).

3) In Mining pool C, the number from fixed generation is 6400 CoFi per day, about 2.336 million CoFi per year approximately. The number will drop by 20% per year and cease to decrease after reaching 9,600,000 blocks (about 4 years).

From the estimation above, we can get:

The floating CoFi output generated by the transaction is approximately 2.85 million per year
Based on 2) and 3), we know that the fixed number of CoFi token is approximately 23.36 million per year. Therefore, the number of CoFi produced in the first year is around 26.21 million.

The number of CoFi token generated decreases by 20% every year, so:

CoFi tokens generated in the first year: 26.21 million;
CoFi tokens generated in the second year: 20.968 million;
CoFi tokens generated in the third year: 16.7744 million;
CoFi tokens generated in the fourth year: 13.4195 million.

The total mining output in the first four years is approximately 77,371,900. Taking into account the growth of transaction volume and capital scale, the number from floating transaction mining will increase. The total CoFi tokens generated in the first four years is estimated to be about 100 million.

According to the current data, after the decay ceases, the estimated annual output of CoFi tokens should be stabilized at 10.7356 million.

Q4: What are the mining strategies in CoFiX?

Liquidity mining:
1) Each block of the liquidity mining pool generates 9 CoFi tokens and then the tokens are allocated to different mining pools in proportion;
2) Each mining pool not only receives CoFi tokens from the liquidity pool but also possesses 10% of the tokens generated in transactions.
3) Each LP receives tokens proportionate to its share in the mining pool;

Thus, the basic strategy is:

1) Determine which pool is allocated the highest proportion;
2) Earn more shares in that pool;

After liquidity providers obtain XToken shares, they should deposit the tokens in the CoFi mining contract in order to generate CoFi tokens,

*Note: Liquidity mining consists of a fixed part (1) + a dynamic part (2)

Transaction mining:
1) Basically, the larger the transaction volume, the more you will mine’ but since there are threshold and density settings, output of transaction mining is controllable, preventing speculative activity of mining tokens by deliberately boost the transaction volume.

2) When assets in the capital pool are priced with a ratio of 1:3 to 3:1 to ETH, the transaction direction has no impact. When outside this range, buying more asset in the capital pool will generate more CoFi tokens (2–4 times)

Q5: What is the use of CoFi token and what rights and priviliges do CoFi hodlers get

1) CoFi token owners enjoy the rights to vote on CoFiX governance, with each CoFi token representing one vote,
2) CoFi token owners are entitled to ETH dividends in CoFiX. 20% of the ETH revenue will be distributed among CoFi owners, and the remaining 80% will be reserved in the system, which will be used for fund operation, dividend distribution, and repurchase, etc. through DAO governance.

* Source of CoFiX revenue: the 2‰ transaction fee

How to get ETH dividend for holding CoFi?

Deposit CoFi Token into the system revenue verification contract to obtain ETH dividend. (Operation can be conducted on the dividend page of CoFiX.io)

--

--

Logan King
CoFiX

Crypto & Blockchain Enthusiast, V Systems Community Ambassador, Marketing and Community Specialist, Gearhead-cum-Biker among a few other things…