Whats the best way to describe the set protocol contracts actions: Minting and splitting? something else?
When minting, how does the contract know what proportions to require? I think there are two fundamental ways:
It looks at the composition of the components in the DPI contract, and matches that. So if $DPI is worth $13 M, and contains 3,500 $MKR, then a deposit of $1,300 will need 0.35 $MKR and so on for all the tokens. Then a split transaction would just do the same: compare the transaction to the market cap of $DPI , and then remove that proportion of each of the 11 tokens.
It uses a price oracle to compare the individual tokens markets caps and the $DPI market cap and then works from that.
I think that #1 is much simpler to implement as all the information is readily available. So I’m assuming this is the case (and assumptions are dangerous).
In which case, if INDEXcoop remove part of the DPI holdings to participate in protocol governance or yield farming, we disupt the internal balance within the $DPI contract. E.g:
- 50% MKR removed for other activities(1,750 mKR)
- Mint / split contract only sees 1,750 MKR
- $ 1,300 deposits require 0.175 MKR (but a proportion more of the other tokens)
- $DPI composition slowly drifts off the peg to the market cap ratios as incoming (and outgoing) transactions are light on MKR.
If this is the case. Then one simple way to manage it would be to remove an equal proportion of all the underlying tokens, and place this into a second wallet. I.e. 50% of the MKR, 50% of the YFI, 50% of the UNI all move at the same time. Then this should preserve the ratios within the $DPI pool. and give INDEXcoop a second pool that we can work on.
I’m sure that there are other ways to do this to minimise the human input, but I think the above is simple and good enough.
A separate question: I think someone said that Set Labs currently manually apply the streaming fee. I assume that this means that every day or so, they remove a small proportion of the underlying tokens without a need to deposit $DPI. (~0.0026 % removed every 24 hours). Is this correct?
Final question: I’ve seen reports of people screwing up and depositing tokens in a contract and not being able to remove them (but there are some contract designs that prevent this), do any of the Set protocol smart contracts have this feature?