With this smart contract, which is currently been tested in the jungle testnet under the account exchangeres , you can easily lease your tokens for bandwidth or rent them to have access to a vast amount of recourses for cents on the dollar.
This contract runs in cycles of 75 hours, each cycle, you will receive a proportional percentage of the fees collected from the renters proportional to your holdings.
If you hold 100 EOS.
The total tokens in the exchange is 1000 EOS.
And the fees collected are 10 EOS
Your reward this cycle is:
10/1000 = 0.01;
0.01 * 100 = 1 EOS
As such, users who are consuming resources from the exchange will be billed at the current market price. The market price is computed automatically based on the usage of the exchange and tokens remaining to rent.
price(total, liquid) = ((total-liquid)^2)/ ( total * 1.5 - liquid )
Users consuming resources can cancel or reduce their usage at any time and be billed accordingly on the next cycle.
Users with balance in the exchange can withdraw their tokens immediately or in the case their tokens are been staked they will need to wait a full cycle. This is a requirement imposed by the stake/unstake delays.
You can test it right now on jungle testnet with cleos, we encourage the community to test it before it goes to the main network.
cleos transfer myaccount exchangeres "10.0000 EOS"
cleos push action exchangeres withdraw '{"user": "myaccount", "quantity": "1.0000 EOS"}' -p myaccount
cleos push action exchangeres buystake '{"user": "myaccount", "net": "1.0000 EOS", "cpu": "1.0000 EOS"}' -p myaccount
cleos push action exchangeres sellstake '{"user": "myaccount", "net": "1.0000 EOS", "cpu": "1.0000 EOS"}' -p myaccount
Telegram group: https://t.me/resourceexchange
Source code: https://github.com/alepacheco/resource_exchange