Crypto Index Fund Construction
Smart contracts allow different approaches to index fund construction that are not practicable in Traditional Finance.
First published in my old blog in October 2020
Introduction
I’m not a computer coder or developer. I’ve been a holder of TradFi index funds since 2000 and crypto currencies since 2013. This post is based on my understanding of how smart contracts can be used for index fund creation. It is primarily based Tokensets and Balancer protocols. Errors and exceptions should be expected. Some terminology and names are undoubtedly incorrect (blame the proof reader — me).
The DeFi space replicates many of the features of TradFi markets. However, there are significant differences and protocols which offer different economic models.
Market cap weight
The simplest implementation of a market cap methodology is to lock the relevant tokens in a hardware wallet and lock the seed away. Zero fees to maintain, off line and secure. However, it has no access to the composability that makes DeFi so powerful. In addition you have to use blockfolio to work out how much it is worth today — how 2017.
So, how do we build a fund using smart contracts to fully integrate with DeFi. My mental model, based on my understanding of TokenSets implementation of $DPI is the following: The fund operates as a smart contract. This contains all the underlying tokens in the market cap weighs. The value of the pool can grow in two ways: 1) the contained assets become more valuable 2) more index units are issued by the addition of the underlying tokens. This is controlled by the Issue smart contract that ensures that the tokens added to match the exact proportions of those in the pool. Therefore the % composition based on coupon numbers is unchanged. Then a unit token is minted and given to the originator as proof of ownership of a proportion of the pool.
Redemption is the opposite process; the user returns the fund unit token (which is burnt) and in return receives the equivalent of the underlying tokens (So in table 1 in Part 2, the redemption of one fund token would produce $40 of A, $10 of B, $20 of C and $30 of D). In addition, the control contracts allow the composition of the pool to be modified to account for additions and deletions to the reference Index, inflation of the underlying token numbers, and the removal of and fees.
Direct issue and redemption has two main problems, for the 11 tokens within $DPI you would need to hold all 11, in the correct market cap weighings, and then do a single transaction to combine and deposit all 11 tokens. At 50 gwei gas price, Issue from the individual tokens costs ~ $18. Indirect purchase from ETH can be done using 11 Uniswaps to acquire the individual tokens which are then combined with the Issue contract to produce the fund unit. This would cost ~$50. For many smaller traders, it is much easier and cheaper to access the fund token by the secondary market (e.g. Uniswap) where the fees will be closer to $3 gas+ 0.3% pool fee + slippage. [Note for Whales: Issue and Redemption have no slippage!]
The presence of a secondary market makes it possible for arbitrage between the primary market and the secondary markets. At any time when the price on the secondary market is significantly miss-aligned with the underlying Net Asset Value (NAV) then there is an opportunity for arbitrage. i.e. if the fund token is available for $95 on the secondary market but the token represents a combined value of $100 in the underlying tokens, an arbitrator can buy on the secondary market, redeem the underlying tokens and then sell them for a $5 profit per unit token (before fees).
For efficient market operation of such a fund, there needs to be a large secondary market to ensure arbitration keeps the secondary market price of the fund unit token close to the NAV of the underlying tokens. Smaller liquidity pools are likely to be less accurate at following the index price (but do present opportunities for smaller buyers to purchase the fund at a discount to NAV).
Fixed Weight funds
In TradFi constant weight funds are generally not used as they require constant trades to maintain the weights. However, in DeFi we have AMM protocols that automatically do this.
The widest used is a UNISWAP liquidity pool. However, this is always maintained in the 50:50 weight with two tokens so it a little pointless. Of more use for index funds are Balancer pools .
Containing the fund in a Balancer pool has the advantage that it will reblance constantly as it interacts with traders / arbitrators. Any change in the underlying token prices will result in the pool containing more of that token than is required. This allows arbitrators to purchase the higher value token using the other tokens i.e, providing A, C or D to remove B from the pool in our example in part 2. Most DeFi investors would recognise the above process as “Divergent loss” as the tokens that are pumping are sold to buy more of the others. However, as explained in Part 2, such rebalancing strategies may result in long term gains compared to a market cap weighing. One man’s divergence loss is another man’s rebalancing strategy!
In the case of a balancer pool, the Liquidity Pool (PL) token, is the fund token as this represents a proportion of the total pool value and so the ownership of the underlying tokens. As with Figure 1 above, Unit tokens / LP tokens are issued and redeemed using a smart contract to ensure they are done in the correct (preset) weighs.
A single pool can contain upto 8 tokens at weights selected by the contract writer. Finalised pools have static parameters and so do not allow changes to the weights etc While this may be useful for a single token pricing pool it is less useful for indexes where changes to the weighing, additions etc can be expected over time. Of more interest for index funds are smart pools, these have some parameters fixed and others controlled by a separate smart contract. This lets the creator for the pool adjust selected parameters over the life of a fund or even pause it in times of market volatility.
The best known example of the use of balancer pools as investment funds are those provided by PieDOA (PieDAO was the first to launch a smart balancer pool). PieDAO currently has index funds aimed at large cap and small cap DeFi protocols and have more planned.
Synthetic funds
Synthetic funds differ in that they don’t contain the underlying tokens. Rather they are synthesised against collateral with the price determined by external oracles. The most widely available (/only ?) is sDeFi from Synthetix. This is a constant weight fund that has the advantage of zero cost rebalancing within the fund. Being a synthetic asset there is no need to issue / redeem from the underlying tokens. However, there is a subsequent counterparty risk introduced in the synthesis of the fund units.
Effect of fees
Fees are useful in that they allow the governance token holders to extract value from what they have created. This encourages them to create more and to maintain what they have created. However, each fee has an impact on the desirability of long term holding, or short term trading.
Asset under Vault (AUV) fees / streaming fees deter long term hold strategies as they slowly drain the holder’s assets.
Issue and Redemption fees have less impact on long term holders, but make arbitration less profitable. This means that a given pool is likely to drift further form the underlying NAV before an arbitration event happens. Less arbitration means more tracking errors compared to the index(and fewer fees for LP providers)
One advantage of the AMM type of structure is that fees can be charged on any arbitrators trading with individual tokens and the pool. So during the constant rebalencing, the pool is being enriched bu the fees.
Risk management within funds
Impact of individual token collapse
For a market cap based fund, the impact of a single component collapsing is the removal of that protocol’s value for the total market cap. So in the case in our example 4 token fund from part 2, if B collapsed, the total market cap would drop by 1,000,000 and each individual unit by 10%. At that point there should be no further consequences (although in reality, such a collapse is likely to impact other protocols prices)
For a constant weight fund in a AMM pool, as the value of B drops to zero, the pool would allow arbitrage to sell the other assets as they become overweight and the fund accumulates more B tokens. This is effectively a rug pull of the fund contract and should only occur for finalised pools. Smart pools have the ability to pause, or change weights so that they have the potential to manage this risk. in understand that PieDAO are developing advanced version of current smart pools with additional features including the ability to use voting rights of the underlying tokens. So this should further offer further downside protection.
A comparison between protocols
The table below summaries my thoughts on different aspects of the three different approaches I’ve been looking at:
Note: this is based on the types of protocols (not specific deployments of contracts) and my assumptions. I haven't examined any code in detail, so it’s possible that I’m misrepresenting the different risks. Finally, I’ve not been able to find much info on sDeFi.
Final thoughts
The three approaches I’ve reviewed to date all have pros and cons in different areas. Personally, I’m drawn to the simplicity of market cap structures. The constant rebalancing, with potential fee extraction, for smart Balancer pools has it’s benefits. I don’t know enough about synthetic assets (TradFi or DeFi) to judge them properly (I’ve found minimal info about sDeFi). However, the lack of the underlying tokens make it less attractive to me.
Disclosure and Disclaimer
I’m a long term investor in crypto currencies including DeFi. I hold $SNX, $INDEX and $DOUGH as well as $DPI and $DeFI+S along with other others (You could say that I like to diversify my risks…). I am an active member of the INDEXcoop which manages the $DPI fund.
This is not financial advice, all investments are risky, crypto investments are more risky than most. Do your own research. Do not invest more than you can afford to lose.