Hello to all the community.
I want to present a small program that i made, to automate the managing of poloniex coins lending.
Who am i : I'm an old school cobol coder, and cryptocoins fan.
By some months, i'm playing on poloniex exchange with some currencies, on the lending section of the site.
But as my managed currencies has grown a bit (now i manage BTC, ETH and FCT), the time to follow the return of the lending orders, and its managing, had a huge increase, auto renew function on poloniex is also so simple and is not the best choice.
So i decided to try to write a bot to automate all the investing processes.
I choose python scripting, as it was a long time that i want to learn that programming language.
It's also a wide known language, with a big community, and with a lot of documentation and tutorials available on-line.
I've started with the 3.4 release a few months ago.
Now i reached a first beta bot program that is running by some weeks on my computer, without issues.
At the moment i wrote code only for the three currencies mentioned above (BTC, ETH and FCT), as looking on poloniex site, i saw that this three currencies, have good movements and interest rates, all the other altcoins are very low both in interests rates than in volume movements.
The program is also ready (if poloniex enable it) to the new LISK currency.
If someone interested in beta testing of this bot, and to help me (with suggestions) to improve it, a group of ten people are welcome.
I made an executable that don't need anything installed on the computer, to run, at the moment for windows only.
What you need to do, is to create an Api Key, with trading and withdrawals disabled, as the program don't need that functions, and as a protection, to you account, (my program is safe) but we don't know each other, so is the right choice not to give to a program made by someone else, the capability to withdraw funds.
You only need to edit the polo_bot.ini file (in the folder of the program) to add Api Key and Secret, to start using it.
Here is a screenshot of the program.
I will briefly explain all the parts in which is made, and how they will function :
the program has 4 independent threads that watches and follow a group of task, to reach the goal of managing the loans.
The first thread, enabled by the check button "Ck.balance" as the name suggests, it's a thread that keep updated the info part of the program, updating the 1st, 2nd, 4th and 6th columns, with the total amount of coins in loans, eventually free balance not invested in loans, the 1st rate in the "loan offers" order book, The total interest in active loans gained till now, and the column (for every currency) when will be returned the first (in time order) loan.
The second thread, enabled by the check button "Enab. orders" activate the function that put loan request on order book, it watches the "Free balance" column, and when the total free amount of coins is major of the "Min.ord. amount" (5th column of entry fields where you can customize the threshold to start sending a new order to book, (remember that poloniex put a minimum order limit of 0.001 coin to put a live order, at the moment i don't have a check procedure in input fields to verify this) it will read again what is the lowest offered rate and put a new order for the free balance at "rate - 0.0001%" with auto renew enabled.
The third thread, enabled by the check button "Ck. opens" watches your orders that are stil open, and if they remains in that state form more than a defined time (customizable by the entry field "Min.ts stop open o." it cancels the ordfer to permit at the previous thread to reissue an order at a new % rate (I use 10 minutes to abort an open order).
The fourth thread, enabled by the check button "Ck. auto" watches all you active loans, and for the loans with the auto renew active, checks the actual minimum offered rate of the order book, and if the rate of you loan is plus or minus the market rate added or subtracted by the % (customizable by the entry field "Delta +/-% auto 0|1" it toggles to off the auto renew.
This is done, as i have noticed that often, in the first minutes your loan is picked, happens that the loan is closed quite immediately, so i enabled the auto renew, because, if the rates on order book are still near the same, there are good opportunity that the loan request is picked up again, passing the time, often happens that the rates changes a lot, so keeping the auto renew active, will put your loan, in order book, in a position that is difficult to be picked up in a small time frame.
So if the price swing more than a percent, that you can customize, the auto renew will be disabled, permitting to the thread, that put orders on the book, to reissue a new loan order with a rate competitive in the rank of the book.
Also the loan duration is customizable with the "Loans duration" input field.
I put also a field to set the time zone adjustment to calculate the real date and time when the first loan returns, for every currency, as poloniex stores on your active orders only the UTC time, in the future i will automate the code to find your time zone and set this variable automatically, but hadn't time now in this first release.
In my first stability test, i came to a conclusion, not to go down the 10 seconds polling time for every thread, as there can be site or program delays, so it's better not to force the program to work with polling intervals of only a few seconds, also i think that there is no necessity, as the loan market don't move so quick as the trading market.
If interested in my program, please send me a pm here on the forum, i will send you a google drive link to download the .zip file with the program, ready to work (only need to edit ini to insert api key infos).
The program is free, also if donations are welcome
at : 16Cj6GBLpe67oiS3bCbP2ZuwSapWts7yTB (BTC only at the moment)
Future plans for developing in my mind :
- A daily report (probably in csv format) with the total balance of the day for every currency
- Another entry field for every currency to put a value for an eventually amount to keep uninvested from the total balance, if, passing the time you need to accumulate some funds to be withdrawn
- A more sophisticated way to find the best rate for new orders, considering last "x" rates on order book and the amount in every rate to find better rate opportunity to place a new loan request
- Better customization of the currency to permit a wider choice of coins, not with three fixed coins as now
All the above are not in the priority order, but only as they comes to my mind.... priority suggestions are welcome.
As i stated before, the program is the first release for a python newbie programmer, also if i have more than 20 years of experience in developing business programs and suites. So could have some undiscovered bugs and also better possible improvements, suggestions and advice will be greatly appreciates.
If the program will reach a minimum interest, after a brief beta running with some other persons, i will setup a permanent and public site page, also with a minimum of pdf manual.
Installing instructions :
- Unzip the folder of the program in your pc
- edit the polo_bot.ini file to put api infos
- run polo_bot01.exe
Cheers
Cesmak
A second screenshot with the bot fully active (with real data) in my 24/7 pc used also for staking wallets. It's a win10 pc, so the graphics looks different.
I will use it surely,i trade at poloniex a lot and it is insane comfortable to have something like this,thanks!