Skip to content

Instantly share code, notes, and snippets.

@jooize
Created April 26, 2017 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jooize/a0c04acb6d553e46c348ea0c7b8bb397 to your computer and use it in GitHub Desktop.
Save jooize/a0c04acb6d553e46c348ea0c7b8bb397 to your computer and use it in GitHub Desktop.
Provide liquidity for NuBits using NuBot

Provide liquidity for Nu using NuBot

Exchange

  • Create separate account if using Nu funds.
  • Link account to primary account (from primary account).
  • Enable multi-factor authentication.
  • Enable API access.
  • Create API key.
  • Restrict API access to IP of gateway.

Setup server (VPS)

  • Create Droplet on DigitalOcean.
    • Use Ubuntu LTS.
    • Choose specifications: 4 GB RAM recommended.
    • Select SSH key, or use password (not recommended).
  • Open console and note its fingerprint if possible. Compare at SSH login. This can verify you're connecting to that server and not an impostor.

Set SSH alias for VPS

vpsip=REPLACE_WITH_NUBOT_SERVER_IP
cat << EOF >> ~/.ssh/config
Host nubotserver
    User nu
    HostName $vpsip
EOF

NuBot on VPS

ssh root@nubotserver

Enable firewall

ufw allow ssh
ufw enable

Press Y, Enter.

Add user nu without password

Passwordless logins are denied by default.

adduser nu --disabled-password
mkdir /home/nu/.ssh
chown nu:nu /home/nu/.ssh
chmod 700 /home/nu/.ssh
cat /root/.ssh/authorized_keys >> /home/nu/.ssh/authorized_keys
chown nu:nu /home/nu/.ssh/authorized_keys

Install unarchiver

apt-get install -y unzip

Install Java

add-apt-repository ppa:webupd8team/java

Press Enter.

apt-get update
apt-get install -y oracle-java8-installer

Accept the terms for Java. (Enter, Left, Enter)

Automate security updates

Won't reboot.

dpkg-reconfigure --priority=low unattended-upgrades

Setup NuBot

ssh nu@nubotserver
wget https://bitbucket.org/JordanLeePeershares/nubottrading/downloads/nubot-v0.5.0-RC5.zip
unzip nubot-v0.5.0-RC5.zip
ln -s nubot-v0.5.0-RC5 nubot

NuBot configuration

Bittrex

  • txFee: 0.25
  • bookSellOffset: 0.001
  • bookBuyOffset: 0.001

Cryptopia

  • txFee: 0.2
  • bookSellOffset: 0.003
  • bookBuyOffset: 0.003

Adjust these to your liking in the configuration panel of the web interface for NuBot. Use the Preview button to view a graph with the resulting walls.

EXCHANGE=bittrex
APIKEY=
APISECRET=
cat << EOF > ~/$EXCHANGE.json
{
  "exchangeName": "$EXCHANGE",
  "apiKey": "$APIKEY",
  "apiSecret": "$APISECRET",
  "dualSide": true,
  "pair": "usnbt_btc",
  "txFee": 0.25,
  "priceIncrement": 3.0E-4,
  "emergencyTimeout": 60,
  "keepProceeds": 0.0,
  "wallchangeThreshold": 0.15,
  "bookDisabletier2": false,
  "bookSellwall": 100.0,
  "bookBuywall": 100.0,
  "bookSellOffset": 0.001,
  "bookBuyOffset": 0.001,
  "bookSellMaxVolumeCumulative": 0.0,
  "bookBuyMaxVolumeCumulative": 0.0,
  "bookBuyInterval": 0.008,
  "bookSellInterval": 0.008,
  "bookSellType": "EXP",
  "bookBuyType": "EXP",
  "bookSellSteepness": "MID",
  "bookBuySteepness": "MID",
  "rpcUser": "",
  "rpcPass": "",
  "nubitAddress": "",
  "nudPort": 9091,
  "bypassStreaming": true,
  "nudIp": "127.0.0.1",
  "mailnotifications": "NONE",
  "mailRecipient": "",
  "submitLiquidity": false,
  "executeOrders": true,
  "verbosity": "NORMAL",
  "gitter": false,
  "multipleOperators": false,
  "webport": 8889,
  "poolModeActive": false,
  "poolURI": "",
  "poolPayoutAddress": "",
  "poolSubmitInterval": 50,
  "mainFeed": "coinmarketcap_ne",
  "backupFeeds": [
    "coinmarketcap_no",
    "bitcoinaverage"
  ]
}
EOF

ln -s $EXCHANGE.json config.json

Configure startup of NuBot

Create scripts for ease of use.

cat << 'EOF' > ~/start-nubot.sh
#!/bin/sh

tmux new-session -d -s "NuBot" -n "NuBot" "cd nubot && java -jar NuBot.jar -server -skipCredentials -cfg=../config.json ; /bin/bash || $SHELL"
tmux move-window -s "Gateway":0 -t 1
tmux set-option -t "Gateway" base-index 1
EOF
chmod +x ~/start-nubot.sh

Start NuBot

Open SSH tunnel to access NuBot's web interface

ssh -f nu@nubotserver -L 8889:REPLACE_WITH_NUBOT_SERVER_IP:8889 -N

Login to server

ssh nu@nubotserver

Start NuBot

./start-nubot.sh

Open NuBot's control panel

http://localhost:8889

Check your configuration in the “Configuration” tab. Preview the walls at the bottom.

Start with a low amount of funds on the entire exchange account until you're confident the configuration is correct.

Press “Start NuBot” under the “Dashboard” tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment