RigoBlock / contracts

[DEPRECATED] directory of our contracts
Apache License 2.0
1 stars 0 forks source link

implement multi token subscription to fund #17

Open gabririgo opened 6 years ago

gabririgo commented 6 years ago

a useful feature would be to be able to deposit tokens to our vaults or dragos in finance it is called a contribution in-kind

from a technical perspective this is already possible transferring a ERC20 token means calling the functions: transfer(address _to, uint _value) or alternatively transfer(address _from, address _to, uint _value) for transferring on behalf the second function can be activated if address _from has allowance

the result is that the fund would be increased its ERC20 token balanceOf

here we have 2 problems/options: 1) the tokens sent to a fund will be technically lost as it would not be possible to move them from the fund unless there is an explicit function for transferring them 2) create an explicit function buyWithToken(address _token, uint _amount) which would account properly for the equivalent value of the tokens converted in shares of the fund (need an external oracle) 3) create an explicit function for sending them back 4) if tokens are sent to a drago, the tokens will be exchangeable for other tokens and eth on connected decentralized exchanges, provided the fund has allowance (potentially already have, but have to double check)

will be a cool feature of of 2.0 release, if we can research more in short time could be included in the first release

gabririgo commented 6 years ago

A possible solution, which could make it more ready to market, is to have special classes of vaults, each one holding just one single token. This is how Xapo works, for example. In this case, the price would be referenced in the local token and always 1to1. Same as Ether vault, but we will have RigoToken vaults, AugurToken vaults, ... and so on. This solves the problem of oracles until we develop a robust solution. Such classes would have a 0 reward factor. 2 reasons: 1) they are much smaller in market cap respect to ETH, hence we can ignore them as revenue makers for now 2) problem of price estimate.

This means that a wizard could:

This would solve the problem of connecting with decentralized exchanges, as they would not be needed for this type of product: technically we could offer multi-token custodian service before anyone else, and keep developing connections with hybrid exchanges for our dragos.