Universal ALP bot collection - forked (and hopefully improved) @Nagalim edition :)

Disclaimer

I won’t take any responsibility for anything - not even that it still works.
I’m a total github noob and don’t know what I do.
Run the stuff at your own risk!


Getting down to the nitty-gritty:

Preparing the start of NuRiver I thought it might please people (who want to run different ALP bots) to have a (hopefully) complete set of ALP bots.
I leaned on the work of @Nagalim, who leaned on yada-yada-yada.

I tried to fork @Nagalim’s nu-pool, rework the unix folder section and adjust

python/client.py (include cryptsy wrapper)
python/server.py (include cryptsy wrapper)
python/exchange.py (include cryptsy wrapper)

Have a look at the commits if you are interested in the details of the changes :wink:

I haven’t changed the Windows section. On demand I’ll do that as well.
I admit that I had running ALPs on a RaspberryPi in mind when I did this (I recommend running the ALPs in screen sessions - maybe I work on a script to generate them automatically if I find the time…) :smile:

I haven’t changed any of @Nagalim’s pool parameters after forking the repo.
I leaned on @Nagalim’s suggestion for the pool settings of NuRiver’s USD pair and tried to derive the settings for the BTC pair from it followed his recommendation for the BTC pair as well.

The reason for creating a dedicated folder for each exchange and trade pair was to make it easier run 2 (or more) ALP bots on the same exchange - otherwise you’ll get a mess with the logs.
Piece of advice: make different exchange accounts if you want to run different bots on the same exchange - otherwise they’ll fight for your balance.
Another piece of advice :wink: if you use different NBT addresses for each ALP bot, you can easily track your compensation!


MAJOR EDIT:
Have a go at it, if you are fearless: https://github.com/Lamz0rNewb/nu-pool
The repo name changed. It can now be found at: https://github.com/Lamz0rNewb/alp-collection/
And it got an experimental branch with some scripts in the unix section and support for the test run of a fixed rate ALP: https://github.com/Lamz0rNewb/alp-collection/tree/experimental/unix

Remark: NuRiver on cryptsy with trade pair NBT/BTC doesn’t have a complete pool config (server data is missing), because @nmei is still busy with setting up the server for that.
NuRiver on cryptsy with trade pair NBT/BTC pool config complete.

If you are looking for bots that are considered stable, because they have undergone sufficient testing, you need to look here:

Not all exchanges/trading pairs are supported by this branch as it requires some testing before new wrappers/parameters are considered safe.
If you are interested in the latest versions, supporting more exchanges and more features, have a look at the experimental branches.
Keep in mind that the experimental branches bare that name for a reason!

experimental-0.50: https://github.com/Lamz0rNewb/alp-collection/tree/experimental-0.50
New/adjusted features:

  • “restime” in the pool config is now called “reset_timer” and by default on 0.5 hours
  • southxchange bots for windows and unix on liquidbits.net have been prepared (but are missing server conf as well as proper offset and deviation settings)
  • pool config contains a new option to limit the amount of NBT that is put into tier1 (=on the order book):
# Maximum NBT to place on sell side
fillfactor = 10000

experimental-0.51: https://github.com/Lamz0rNewb/alp-collection/tree/experimental-0.51
New/adjusted features:

  • cryptsy wrapper adjusted to make it compatible with the current fee structrure.
  • adjusted bot, because fixed cost test run on bter isn’t on cny but btc pair

Older bot versions might show this error:

ERROR: unable to place bid btc order of "X" nbt at "Y" on cryptsy: Insufficient BTC in account to complete this order

although there are enough funds to place the order.


KNOWN ISSUES:
1. Cryptsy wrapper
There’s some trouble with the NuRiver BTC bot that creates error messages like

unable to place bid btc order of "X" nbt at "Y" on cryptsy: Insufficient BTC in account to complete this order.

Repo will be updates as soon as a fix is available.
Fix has been applied and is available for testing.
As I don’t know what caused the trouble and what resolved it, this stays for the time being in the known issues section.
It looks like the trouble was related to the changes in cryptsy’s fee model.
The issue remains tracked until it’s verified that the latest change of the wrapper solves the problem and the change has been merged with the master branch.

An update was pushed to the cryptsy wrapper following the latest changes in https://github.com/inuitwallet/nu-pool/blob/extra-cryptsy-logging/python/exchanges.py#L330.

Only https://github.com/Lamz0rNewb/alp-collection/tree/experimental-0.51 contains this adjustment until further tests have shown that it’s safe to apply it to the other branches as well.

update:

  • removed nupond_bter_btc_fix_payout_test because nupond_bter_btc is now fixed cost
  • added southx usd trading bot
4 Likes

Update:
Renamed the repo…
https://github.com/Lamz0rNewb/nu-pool/blob/master/alp-bot-screens.sh
https://github.com/Lamz0rNewb/alp-collection/blob/experimental/unix/alp-bot-screens.sh
and
https://github.com/Lamz0rNewb/nu-pool/blob/master/alp-info.sh
https://github.com/Lamz0rNewb/alp-collection/blob/experimental/unix/alp-bot-info.sh

added to the repo.

The first one (alp-bot-screens.sh) is a script that starts multiple ALP bots - each one in its own screen.
That is very convenient if you operate a headless RaspberryPi where you connect via SSH.

You can attach to the screen sessions/terminals whenever you want screen -ls gives you an overview of existing screens.

If you have more than one ALP bot running checking the status can be a pain in the lower of your back.
The second script (alp-info.sh) takes care of this.
In the standard configuration it creates an output of the last two lines of the most recent log file per ALP bot.

Each scripts are with all ALP bot settings disabled in the repo.
You need to enable them manually by removing the # from the lines.
In each of the scripts there’s a little info.

Be careful with them!
I’ve tested them to the best of my knowledge but offer no guarantee in no way in case strange things happen! :wink:

Just in case somebody already played with this collection - an update might be required. The client-poloniex-btc settings needed to be corrected.

Update 2:
I should have labeled this branch “work in progress” or should have made use of branches different from master. Next time I’ll do better, I promise.
Another update was applied to the branch which makes navigating easier.

If alp-info.sh shows an output which you like to investigate, you can not not only dig in the log (the full path to the log is part of the output), you can easily connect to the screen, because the “pool names” are now identical with the names of the screen sessions.

Maybe you understand nothing of what I say. I’m not even sure you will if you try this ALP bot collection.
In any case: if you have questions: ask :slight_smile:

3 Likes

Update 3:
The ALP bot collection now has a fully populated windows tree including a script (alp-bot-sessions.bat) to make starting the bots (after a Windows system restart) convenient.
It can be found in the experimental branch of the project:

Remark: you might need a program like “notepad++” or similar to edit the batch file.
Standard notepad.exe doesn’t handle “CRLF” properly; with notepad the batch looks like a mess which in fact it isn’t :wink:
wordpad.exe can do it as well, but the display of the file is still quite crappy compared to notepad++

The unix “alp-[something]” scripts have been moved to the unix folder to avoid confusion.
So each supported operating system branch (unix, windows) has a full collection of ALP bots and a script to start them.
The unix branch in addition still has a script to conveniently check the status of the bot by investigating the log.
I saved myself making such a script for windows as the status of the bots can easily be checked in the command prompt.

…now I only have to find out how to merge the experimental branch with the master branch without breaking everything :wink:

Update 4:
First successful test by a user:

I’d love if we could get pool operators to update this each new term with the new pool parameters.

That could be very easy if only I received pull request from each pool operator :wink:
…and did find out how to accept/include them, lol
I’m still a git noob :smile:

As this is still a kind of test whether people like a “universal ALP bot collection” or not, I might be a lesser noob by the time we’ve found out; or I might not need to be a lesser noob - depending on the outcome!

The thing is, I played with so many bots on so many pools that I wanted to have one single place to look at for an up-to-date and hopefully complete set.
As this set wasn’t existing in the way I preferred it, I decided to make it.
The whole collection was built on self-interest combined with the hope someone else might like that idea as well.

1 Like

Update 5:
More fun with screens^^
The ALP bot collection now has a script to terminate (at least it tries to…) all bots gracefully (to have them delete the orders) in the unix section.

If you have up to 9 bots running and want to gracefully terminate them, you have to attach to the screen, terminate the bot, yada-yada-yada…
…or you use the script!

Here it is:

Obviously It’s part of the experimental branch.

A Windows version of it will likely not follow - I have no clue how to send CTRL+C to a command prompt and confirm the action (at least not without AutoIT - and I’m not going to do that :wink: ).
I’m not only a git noob, but a PowerShell noob as well^^ (at least I think it could be possible with PowerShell…).

I think that’s it for now with the ALP bot collection.

Have fun with it!
Send feedback, or suggest improvement if you like.

is there a parameter in conf file in order to set how much of our funds the bot could use in orders?
right now i see it uses full funds.

I’m not aware of such a setting.
But I didn’t dig deep in the inner workings of the bot.
I merely tried to streamline the structure to make it easy getting an up-to-date version of the bots and especially make running multiple bits in parallel more convenient.

I bet a parameter like reservebalance would be quite easy to be implemented for someone familiar with Python, or the other way round, a maximum value that shall be put into orders.

Or to keep it in line with the concept of liquidity operations a way to tell the bot how much to use for Tier 1 or Tier 2, respectively.

Update 6:
I hope I caught all links in the previous posts…
The repo was renamed. It’s now called “alp-collection” (formerly known as a fork of nu-pool that was called nu-pool).

The most interesting branch of it is not the master (which is hopefully quite stable) but the experimental branch, that can be found here:

The experimental branch contains some scripts that should make using the bots (especially if you intend to run more than one of them) more convenient.
I recently added support for the fixed payout ALP test pool - in the windows and the unix section!

Have fun with it!

Update7:
New branch for testing available with new features: https://github.com/Lamz0rNewb/alp-collection/tree/nagalim
Details about that are in @Nagalim’s subsequent post.

2 Likes

So this was pulled from an old (but stable) version. I’d like to see if we can pull some of the updates since then into the branch. Things that should happen:

  1. I’ll remake trading.py and client.py to absorb all the recently discussed changes as well as any updates to the main branch.
  2. Absorb all other updates to the main branch since I forked.
  3. Rename restime to reset_timer and wire out fillfactor
  4. Fix unix directory to take step 2 into account
  5. Fix the windows directory

This would best be done once I understand how to use github. I’ll give it a shot tonight, but fair warning if I can’t get it all done I won’t be able to work on it this weekend.

Edit: This is totally not going to get done tonight. I’m just going to take my time and try to get comfortable with github first.

3 Likes

Even if you did get comfortable with github I might not be able to handle your pull requests as I’m a github n00b.
If you can point me to adjusted files (trading.py, client.py) I can integrate them manually and we learn how to use github later :wink:
Or what about this: you fork https://github.com/Lamz0rNewb/alp-collection/tree/experimental and make the changes. We figure out how to make pull requests later?
ninjaedit: Doh! You already forked it.

I merged MoD’s branch in with my own. I’m almost done getting the client all updated with the main branch, but there’s a conflict about how we name our config files and how the inuitwallet branch labels its config files. This conflict happens in client.py about two lines in to the main routine. Anyway, I’ll get it figured out eventually, but that’s what’s holding me up for now.

Sorry - that was due to my attempt to provide a useful naming structure not knowing about code dependencies…

I like your structure better, I’m just trying to code it so that maybe the others will look at our changes and pull us in. The biggest issue is that to add a config parameter we have to wire it into every single pool, but if each pool can just check to make sure their folders are right then maybe everything will work out without too much work on any one person.

I consider that one of the big advantages - to have independent configuration for each pool! :wink:

@woolly_sammoth I found the thing that was tripping me up. Can you explain why there is a ‘not’ in the logical of line 374 here:
https://github.com/inuitwallet/nu-pool/blob/master/python/client.py#L374
As far as I can tell it makes your branch unusable for normal client-side ALP. Deleting that ‘not’ makes it work just fine, and logically it doesn’t make sense to me with the ‘not’ there. It’s not in any of the other case structures following it.

Alright, here you are:

By the way, nothing other than nupond works in there. All the others have the wrong name for ‘restart_timer’ and lack a fillfactor. Fixing this would just require a lot of copy and pasting.

I pulled your changes intp a new branch in my repo called “nagalim”:
https://github.com/Lamz0rNewb/alp-collection/tree/nagalim

and made changes for the other unix bots and the windows bots.

I fear it might confuse users to have yet another branch and intend to merge all the changes soon to the master branch.

It would be nice if somebody could test it before.
I won’t have time for through tests over the weekend.

I’m sorry, you missed the restime -> reset_timer. I can try to add something into the code to accept both if you’d rather.

Oh, also I think we should go to 0.5 hr default reset.

Doh!
Will fix that later…
…sed will do it in fact :wink:

Done: https://github.com/Lamz0rNewb/alp-collection/tree/nagalim