This is a "how to" guide for anyone interested in leasing out EOS tokens on Chintai with CLEOS.
Prerequisites:
-CLEOS installed on your machine
-Unstaked EOS tokens in an account with key in an unlocked wallet.
-At least 10 minutes of free time. (Grab yourself a cup of coffee).
This method worked for me, but this guide comes with no warranties. Do your own indpendent research and USE THIS GUIDE AT YOUR OWN RISK.
The difficulty with using cleos with chintai is that the contract requires three actions to be sent in one single transaction. Unfortunately, this can't be accomplished with "cleos push action" as this command only supports one action per transaction.
The three actions involved will be:
prepare, transfer, and activate.
So we are going to need to generate the json for each action, and compile them into a single .json transaction that can be signed and pushed to the EOS network.
In this example, I have 20 EOS unstaked that I would like to lease out to earn additional EOS. The requested lease term will be 7 days in which I'd like to earn 2 EOS during the period (a 10% weekly return).
Step one: Generate the json for prepare, transfer, and activate:
cleos -u https://api.eosdetroit.io:443 push action chintailease prepare '{"memo":"youraccount|0|20.0000|0.10|7|randomnumbers"}' -d -j -s -p youraccount > prepare.json
cleos -u https://api.eosdetroit.io:443 push action eosio.token transfer '{"from":"youraccount","to":"chintailease","quantity":"20.0000 EOS","memo":"youraccount|0|20.0000|0.10|7|randomnumbers"}' -d -j -s -p youraccount > transfer.json
cleos -u https://api.eosdetroit.io:443 push action chintailease activate '{"memo":"youraccount|0|20.0000|0.10|7|randomnumbers"}' -d -j -s -p youraccount@active > activate.json
Let's break down the "memos" in the transactions above. It is important you have the memo correct as this contains all the details of the lease arrangement that the smart contract will execute and place in the chintailease orderbook automatically:
|youraccount| == your EOS account name.
|0| == this is the side of the order. Leave this as "0" if you want to earn EOS by leasing. Switch it to "1" only if you want to spend all your EOS to borrow network resources.
|20.00| == number of tokens in the order. (Minimum is 10 or the transaction will fail)
|0.10| == desired interest rate. Please note -- that this is the rate of interest over the period, and not the entire year and it also takes 3 days to unstake at the end of the lease. So for example, if I wanted a 2% APR, I'd use the following period rates:
|7| == this is the lease term in days. At the time of writing, it must be 7, 14, 21, or 28.
|randomnumbers| == This is where you generate a string of random numbers that is used as a generator. For example: abcblahblah123. You will need to use the same random number string for the prepare, transfer, and activate actions.
Next, open up the prepare.json.
It should look something like this:
Now we need to add the actions for transfer.json and activate.json to this file. In the end, the prepare.json will contain all 3 actions and will look like this:
Finally, save your prepare.json file, confirm your wallet, and sign / push this transaction onto the EOS Mainnet:
cleos -u https://api.eosdetroit.io:443 push transaction prepare.json -p youraccount@acive
All done! Your order is placed in the orderbook at chintailease!
When the order is filled, you will immediately receive the interest payment to your account. The remainder will remain staked in the chantailease account until the end of the lease term, at which point the EOS will be unstaked and transferred back to your account.
If you have an order that hasn't filled, you will need to find the order number by using a block explorer like bloks.io and issue the command:
cleos -u https://api.eosdetroit.io:443 push action chintailease cancelorder '{"id":"123456789"}' -p youraccount
Good luck! Happy leasing!
--Eosinsiderio
Follow chintai on telegram for pinned announcements, etc. https://web.telegram.org/#/im?p=@ChintaiEOS
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @eosinsider! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit