Some questions for the smart contract experts

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:

  1. 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.

  2. 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:

  1. 50% MKR removed for other activities(1,750 mKR)
  2. Mint / split contract only sees 1,750 MKR
  3. $ 1,300 deposits require 0.175 MKR (but a proportion more of the other tokens)
  4. $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?

Thanks

OA

Hey - good questions. The easiest resource for technical questions re: the Set Protocol is the dev docs. Specifically, the process is called “issuing” and “redeeming” - described in the link there.

The process it uses is the former or number 1, as you described.

The protocol tracks the “units” of each component / constituent and is able to handle external positions, positions where the underlying tokens are held in a 3rd party contract. If you look at the Litepaper, you can find more information about the types of integrations that are possible.

Re: the streaming fee, it is a public function on the “StreamingFeeModule” contract that anybody can call to actualize the fee. Currently, a bot periodically calls that function.

Final question: Set currently doesn’t have safeguards against people sending tokens in an unintended manner to the contract (most contracts don’t).

1 Like

Thanks Felix. That helps