Written by: Jackson
Source: CoFiX Fans
The opening is clear: market making is risky, hedging is essential!
The realization of CoFiX as a calculable financial transaction model requires the role of a market maker to provide liquidity. It must be pointed out that the act of adding liquidity to the CoFiX fund pool is not “saving”, but participation in “market making”! Liquidity providers should fully understand the risks involved.
In short, the addition of liquidity to CoFiX’s fund pool is the behavior of market makers to obtain profits in the transaction process by assuming a certain risk of price fluctuations. The market making, redemption, and exchange transactions defined in CoFiX may affect the capital structure of the CoFiX fund pool, which is the source of price fluctuation risks.
Risks are not terrible. The biggest advantage of CoFiX’s design is that these risks can be calculated, so that participants can effectively manage and perfectly hedge these risks according to their own risk preferences.
To put it simply, market makers can eliminate the risk of price fluctuations by hedging reverse transactions over the counter. The basic idea is: According to the structure of the funds in the fund pool and the proportion of your own shares, you can calculate the part you can get in real time, compare it with your selected reference point, eliminate negative increments, and ensure that the total Assets are in a state of growth.
What is hedging? What is the hedging logic?
Because different people have different knowledge backgrounds, the difficulty of understanding CoFiX’s hedging logic is also different. This article assumes that readers have a comprehensive understanding of the basic logic of CoFiX, have a basic understanding of Ethereum and Ethereum-based DeFi, and gradually derive the hedging logic of CoFiX from the simplest model.
Suppose Alice has total assets of 200ETH and 2000USDT, and thinks this is her ideal asset allocation, which we call the “reference state”. Later, Alice hopes to increase the value of assets by participating in certain activities (such as DeFi).
Asset changes
Suppose Alice participates in a certain DeFi, so that the asset becomes the following state:
1. Absolute growth – 200ETH, 2001USDT – 201ETH, 2000USDT – 201ETH, 2001USDT
Obviously, the above three situations are better than the reference state (200ETH, 2000USDT), no matter how the price of ETH/USDT changes. We call it “absolute growth.”
2. Relative growth – 201ETH, 1999USDT – 199ETH, 3000USDT
Suppose the current price is 400, that is, 1ETH=400USDT. At this point, it is obvious that Alice’s asset situation is better than the reference state (200ETH, 2000USDT). However, this preference depends on the price of ETH/USDT: – When the price of ETH falls below 1USDT, 201ETH and 1999USDT will lose money relative to the reference state. – When ETH rises above 1000USDT, 199ETH and 3000USDT will lose money relative to the reference state.
It can be seen that the profit and loss in this situation depends on the price. When the price changes, the profit and loss status may change, which we call “relative growth.”
3. Relative loss – 201ETH, 1500USDT – 199ETH, 2100USDT
Suppose the current price is 400, that is, 1ETH=400USDT. At this time, it is obvious that Alice’s asset situation is worse than the reference state (200ETH, 2000USDT). Of course, this worse situation also depends on the price of ETH/USDT. We call this “relative loss”.
4. Absolute loss – 200ETH, 1999USDT – 199ETH, 2000USDT – 199ETH, 1999USDT
Obviously, the above three situations are worse than the reference status (200ETH, 2000USDT), no matter how the price of ETH/USDT changes. We call it an absolute loss.
When this happens, it means that Alice participated in DeFi and made it a loss.
State analysis
1. absolute growth
For absolute growth, it shows that Alice directly profited from participating in DeFi without any uncertainty.
2. Relative growth
For relative growth, it means that Alice may make a profit while participating in DeFi, but it depends on price. In order to eliminate the uncertainty caused by price changes, Alice can change the state to an absolute growth state by doing an equivalent exchange.
- 201ETH, 1999USDT For this state, Alice can sell 1ETH for 400USDT; or sell 1/400ETH for 1USDT (or any state between these two points) to achieve absolute growth .
- 199ETH, 3000USDT For this state, Alice can use 400USDT to buy 1ETH, or 1000USDT to buy 2.5ETH (or any state between these two points) to achieve absolute growth.
We call Alice’s two operations above “hedging”. 3. Relative loss
For relative losses, losses have already occurred, and the hedging operations described in 2 cannot be used to change the loss situation. There are two possibilities in this situation:
– Alice’s participation in DeFi directly caused losses to Alice – Alice did not hedge in time, resulting in losses due to price fluctuations
4. Absolute loss
For absolute losses, losses have already occurred, and there is no way to change the loss situation through hedging. In this case, there are two possibilities: – Alice’s participation in DeFi directly caused Alice losses – Alice did not hedge in time, resulting in losses due to price fluctuations
As a person who invests in DeFi, Alice hopes to make a profit and ignores the risks brought by price fluctuations. This goal can only be achieved by maintaining absolute growth. That is, Alice’s goal is 1 state.
For the 2-state, Alice can transform the state into the 1-state by hedge in time.
For states 3 and 4, there are two possible causes:
- One of them is that DeFi brings losses to Alice, and Alice can avoid this situation by adjusting the strategy (participation strategy is incorrect), or not participating in this DeFi (DeFi itself may be arbitrage).
- Another possibility is that it did not hedge from state 2 in time, causing it to evolve into state 3 or 4. This shows the importance of hedging.
in conclusion:
- Hedging is the operation of changing the state of relative growth to the state of absolute growth and avoiding its evolution into a state of relative loss or absolute loss.
- To hedge, you must first select a reference state as a basis.
- To maintain a definite return, hedging is inevitable.
CoFiX market making
Assuming that Alice’s participation in DeFi is to make a market on CoFiX and to provide liquidity for the “ETH/USDT” fund pool, we can take a look at some of the choices she will face.
Assuming that Alice’s total assets are 200ETH and 2000USDT, she puts 100ETH and 1000USDT in CoFiX to make the market, and 100ETH and 1000USDT are placed off-market for hedging.
To simplify the problem, first consider that CoFiX only has Alice making the market. At this time, Alice’s share is 100%, and the following simulation operation process (the calculation below, ignoring transaction costs).
- Bob buys 1 ETH from CoFiX with USDT. At this time, the price of ETH/USDT is 400. Considering the K value of CoFiX and the θ handling fee, Bob actually exchanges 410USDT for 1 ETH. At this time, there are 99ETH and 1410USDT in the CoFiX fund pool. Since Alice’s share accounted for 100%, all funds in the CoFiX fund pool are owned by Alice, so Alice’s total assets at this time become 199ETH and 2410USDT, which corresponds to the relative growth state described in the previous section. There is a risk of price fluctuations and needs to be done Hedging operations.
- According to the previous description, Alice needs to do hedging operations at this time. The specific operation method is to take out 400USDT from the assets used for hedging and exchange it for 1ETH. After the exchange, Alice’s external hedging assets are 101ETH, 600USDT, and the total assets It is 200ETH and 2010USDT, which is in an absolute growth state.
- After that, CoFiX exchange transactions occurred successively, with different exchange directions. Alice needs to constantly repeat the hedging operation described in 2 according to the state of the transaction pool after being traded to ensure that the asset is always in an absolute growth state.
- If in a relatively short period of time, CoFiX has multiple forward and reverse transactions in succession, the changes in the asset ratio between these transactions will offset part of it. Considering the continuity of market prices, Alice can hedge against the total changes brought about by these transactions.
The previous description is that Alice alone makes the market, but this is usually not the case in reality. Let’s gradually evolve and analyze more complicated situations.
- Back to the original state, consider that Carol was already making the market before Alice, and after Alice joined, each share will account for 50%.
- Bob buys 1 ETH from CoFiX with USDT. At this time, the price of ETH/USDT is 400. Considering the K value of CoFiX and the θ handling fee, Bob actually exchanges 410USDT for 1 ETH. At this time, the CoFiX fund pool decreased by 1 ETH and increased by 410 USDT. Since Alice’s share accounted for 50%, Alice’s assets at this time decreased by 0.5 ETH and increased by 205 USDT, with total assets of 199.5 ETH and 2205 USDT.
- According to the previous description, Alice needs to perform hedging operations at this time. The specific operation method is to take out 200 USDT from the assets used for hedging and exchange them for 0.5 ETH on the exchange. After the exchange, Alice’s external hedging assets are 100.5 ETH and 800 USDT. The total assets are 200 ETH and 2005 USDT, which are in an absolute growth state.
Considering that the participation of CoFiX will increase the total share of the CoFiX fund pool, and the corresponding proportion of each market maker will decrease. First consider that market makers enter in proportion to their funds, that is, it will not affect other market makers Financial structure. At this time, when the CoFiX fund pool changes through transactions, each market maker only needs to hedge his own proportion of the incremental amount according to his own proportion. Then consider that market makers do not join in proportionate market makers. This will have two effects: 1. The share of the fund pool will increase, and the proportion of funds in the fund pool will change. This can be split into an equal proportion of market making and an exchange transaction.
- The new market maker’s own capital structure changes before and after market making. In this case, market makers need to deal with it themselves. There are two strategies: A) Accept the change in the capital structure, and use this status as the reference state. B) Not accept the change in the capital structure. After making the market, immediately initiate a hedging transaction.
Important concepts
Reference status: To judge profit and loss, a reference status must be selected. This reference status is the standard for users to judge profit and loss, and is also the target and basis for hedging operations.
How to formulate a CoFiX hedging strategy?
Three basic operations of market making, redemption, and exchange are defined in CoFiX. Market making and redemption are for market makers, and transactions are for ordinary users.
For exchange transactions, regardless of the direction from which they occur, they can be hedged according to the strategy described in the “CoFiX market making” section above. For market making and redemption, it can be divided into “proportional market making/redemption” and “range market making/redemption”.
- Ratio market making/redemption For ratio market making/redemption, it is equivalent to only changing the proportion of each market maker’s share, without changing the asset structure. Therefore, other market makers only need to recalculate in subsequent hedging Your own share is fine.
- Unequal ratio market making/redemption For unequal ratio market making/redemption, it can be divided into a ratio market making/redemption, and an exchange transaction for processing.
According to the above description, for the three operations of market making, redemption, and exchange, market makers do not have to deal with them separately, but can be treated in a unified manner, that is, according to the total amount of ETH, the total amount of USDT, and the total amount of funds in the CoFiX fund pool. Share, market maker’s own share, calculate the amount of ETH and USDT that you can obtain, compare with the reference state, and then hedge according to the method described above.
A simple and easy to use hedging program
According to the previous description, there can be multiple specific hedging strategies. In order to make it easier for users to participate in CoFiX market making, we have chosen a strategy to realize the automatic hedging function through coding. This hedging program implements a strategy for automated hedging according to the basic idea described above. The specific logic is as follows:
- The program defines a reference state of the asset structure, and then polls to detect state changes to get the state change increment.
- When the increment of an asset is less than 0, and the absolute value exceeds a set threshold, sell another asset to fill up the negative growth of assets (due to the CoFiX trading mechanism, it can ensure that market makers need to sell The amount of assets exported is less than its increment, thereby achieving profitability)
- After completing the hedging operation described in 2, update the new status to the reference status.
- When the program is running, the state obtained for the first time is used as the reference state.
For more information about this hedging program, please refer to:
FAQ
- How to deal with changes in the asset structure of market makers before and after market making?
Answer: Since the market making process is a process of integrating market maker funds and CoFiX funds pool funds, as long as the ratio of the two is inconsistent, the market making action will result in changes in the ratio of market maker to the funds pool before and after market making. For market makers who initiate market making operations. The following coping strategies can be adopted: A) Market making is based on the proportion of funds in the capital pool. Before and after this market, the capital structure on both sides will not change. B) Accept the change of the capital structure, and use this status as the reference status. C) Do not accept the change of the capital structure. After making the market, immediately initiate a hedging transaction.
- How to allocate market-making assets and hedging assets?
Answer: The allocation of hedging assets is essentially to fill in the incremental changes in the capital structure of the market maker in CoFiX. Since transactions can be conducted in both directions, the volume of transactions on both sides will not be strictly matched, resulting in an imbalance in the proportion of funds, which may be out of balance. , Determines the allocation ratio of hedging assets. There is no absolute recommendation for this ratio. In the previous example, it is 1:1. This is a safer approach, but the utilization rate of funds is not high. The actual ratio depends on the user’s expectation of the imbalance of the CoFiX fund pool assets. CoFiX has designed a mining balance coefficient to try to promote the balance of the CoFiX fund pool, but this is not an absolute guarantee. For pessimists, you can hedge The proportion of funds should be adjusted higher. For optimists, the proportion can be adjusted lower.
However, whether pessimistic or optimistic, when there is an imbalance in the proportion of funds, which leads to the consumption of a type of hedging funds, actions must be taken to consider stopping market making or re-adjusting the asset structure.
- Is it possible to hedge once at entry and exit?
Answer: No. Hedging is to avoid risks caused by price fluctuations that exist all the time. If hedging is done only once at the time of entry and exit, then during the market making period, it is assumed that the assets that are about to increase in value are exchanged each time, and the assets that are about to depreciate are exchanged in, so that each exchange will let the CoFiX fund pool Depreciation of assets in China. Of course, the actual situation may not be the case, and it may even be reversed, but we cannot make assumptions about price changes, because the purpose of hedging is to eliminate the risks caused by price fluctuations and achieve definite growth.
- What if the hedge funds are not enough?
Answer: Hedging funds need to be divided into two parts: ETH and USDT. There are two situations for insufficient funds: A) Generally, there are not enough hedge funds when one asset is not enough (usually because CoFiX is traded in one direction, resulting in one type of hedging asset being replaced by another One kind). B) Due to changes in transaction timing and market trends in the CoFiX fund pool, assets that are always about to depreciate are exchanged, so the CoFiX fund pool has been increasing through transactions. At this time, due to hedging, both hedging assets may be slow Slowly exhausted. (It should be noted that this does not mean a loss, because the essence of hedging is to eliminate the uncertainty of price fluctuations. This uncertainty may be beneficial or harmful, but whether it is beneficial or harmful, it It has been hedged. It is difficult to understand this logic and requires careful thinking)
At this time, it may not be possible to continue hedging. In order to avoid the risk of price fluctuations and ensure the safety of funds, it is necessary to immediately stop market making or readjust the allocation of funds.
- Can hedging be completed by initiating a transaction in CoFiX?
Answer: No. The essence of CoFiX is to allow market makers to bear certain price fluctuation risks in exchange for profits in the transaction process. The basic assumption is that the transaction cost of CoFiX is higher than the cost of over-the-counter transactions. In this way, marketers can achieve relatively certain profits through hedging. Due to the high transaction cost of CoFiX, if market makers complete hedging by trading in CoFiX, there will be a greater cost of hedging, resulting in unprofitable or even loss. This approach is tantamount to wanting to step on the right foot to the sky.
- Is it possible to make a loss in market making?
Answer: It is possible. Market makers obtain profits in the transaction process by assuming certain price fluctuation risks, and this risk can be minimized through hedging. However, some objective factors may still cause market makers to lose money, which is mainly reflected in two aspects: A) If the market makers do not hedge against this situation, the risk of price fluctuations will always affect the market makers, and losses are very likely to occur. . B) Hedging is not timely Due to hedging is not timely, or the price fluctuates too sharply, the hedging procedure execution interval is large, which may lead to losses.
- What should I do when all the ETH in the fund pool has been replaced by USDT and the ETH cannot be redeemed?
Answer: At this time, although USDT can only be redeemed in the fund pool, a large amount of ETH has been purchased in the hedge funds, and the total ETH quantity will not decrease.
Comments
Post a Comment