[Activated at 2016-03-023] sell side gateway at hitBTC by masterOfDisaster

@masterOfDisaster can you make a liquidity calculation template manually llike you used to do for buyback calculations? I might find time to write a script to generate FLOTable tx depending on the liquidity info.

I’m not entirely sure that I understand correctly, what you mean.
You are referring to the buyback calculation, but to create tx automatically, output of getliquiditydetails per operation is required, right?
This would be helpful for sell side only gateways, but for dual side gateways as well!

The idea is to

1 get current buy and sell side liquidity amount. I remember getliquiditydetails has differences with alix often. Is it still the case? If yes the difference needs to be reconciled.

2 apply some criteria and determine if FLOT should take action

3.1 if FLOT-BTC should take action, calculate which gateways should get how much BTC
3.2 if FLOT-NBT should take action, calculate which gateways should get how much NBT

4 generate a ready-to-sign tx for the FLOT using results in step 3

The community can then contribute to define criteria and strategies for steps 2 and 3. FLOT can just rubber-stamp the results in 4.

Now I need your help in step 1. @Nagalim is welcome to comment how this could be related to T3 ops.

I’ll try to improve this (currently it’s using getliquidityinfo instead of getliquiditydetails; execpt for cybnate’s operation):

(link taken from here:
Current Liquidity)

It should be possible to read the exchanges from the output (the names are in the session ID).

Great. Sorry I forgot this script.

T3 is easy. Just check each address against a hardcoded number (the refill minimum, mine’s 1k per side) and refill to a different hardcoded number (the contract amount, mine’s 2.5k) where necessary.

With only 1 custodian, it’s prolly not worth it yet. Then again, build it and they will come.

###For the record: on 2016-03-23 the NuBot sell side gateway was activated:

status of mOD sell side only NuBot at Bittrex, hitBTC, ccedk:
nud getliquidityinfo B | grep BETwD8nSjtj9ADSvej2na34xmsMYwPRymv -A 2
        "BETwD8nSjtj9ADSvej2na34xmsMYwPRymv" : {
            "buy" : 0.01,
            "sell" : 1999.988
[...]
nud getliquiditydetails B | grep hitbtc:0.4.1_1458757219123_4f225b -A 2
        "1:NBTBTC:hitbtc:0.4.1_1458757219123_4f225b" : {
            "buy" : 0.0,
            "sell" : 499.988
--
        "2:NBTBTC:hitbtc:0.4.1_1458757219123_4f225b" : {
            "buy" : 0.01,
            "sell" : 1500.0
2 Likes

Big trouble at little hitBTC:

06:17:48.877 [Strategy Secondary Task] INFO  - Sell-Wall size :  : 0.0 NBT [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:539]
06:17:48.878 [Strategy Secondary Task] INFO  - Buy-Wall size :  : 0.0 NBT [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:544]
06:18:15.898 [checkNud] INFO  - Executing class com.nubits.nubot.tasks.CheckNudTask [com.nubits.nubot.tasks.CheckNudTask:37]
06:18:29.872 [Strategy Secondary Task] ERROR - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target [c.n.n.t.w.HitbtcWrapper:1171]
06:18:29.873 [Strategy Secondary Task] INFO  - Sell-Wall size :  : 0.0 NBT [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:539]
06:18:29.874 [Strategy Secondary Task] INFO  - Buy-Wall size :  : 0.0 NBT [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:544]
06:18:30.689 [priceTriggerTask] INFO  - Price Updated. bitfinex:1 BTC = 454.65 USD [com.nubits.nubot.tasks.PriceMonitorTriggerTask:359]
06:18:45.897 [checkNud] INFO  - Executing class com.nubits.nubot.tasks.CheckNudTask [com.nubits.nubot.tasks.CheckNudTask:37]
06:19:10.991 [Strategy Secondary Task] ERROR - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target [c.n.n.t.w.HitbtcWrapper:1171]
06:19:10.992 [Strategy Secondary Task] INFO  - Sell-Wall size :  : 0.0 NBT [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:539]
06:19:10.994 [Strategy Secondary Task] INFO  - Buy-Wall size :  : 0.0 NBT [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:544]
06:19:15.898 [checkNud] INFO  - Executing class com.nubits.nubot.tasks.CheckNudTask [com.nubits.nubot.tasks.CheckNudTask:37]
06:19:17.003 [checkOrders] ERROR - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target [c.n.n.t.w.HitbtcWrapper:1171]
06:19:17.004 [checkOrders] ERROR - ApiError [4 : Null Return] [c.n.n.s.BalanceManager:33]
06:19:17.005 [checkOrders] ERROR - java.lang.Exception: ApiError [4 : Null Return] [c.n.n.t.CheckOrdersTask:167]
06:19:17.296 [checkOrders] ERROR - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target [c.n.n.t.w.HitbtcWrapper:1171]
06:19:17.296 [checkOrders] ERROR - ApiError [4 : Null Return] [c.n.n.s.OrderManager:295]
06:19:17.927 [checkOrders] WARN  - Liquidity info submitted:
        tier=1 buy=0.0 sell=500.0 identifier=1:NBTBTC:hitbtc:0.4.1_1463249805072_2f0e73 response=true
        tier=2 buy=4.31 sell=1495.693 identifier=2:NBTBTC:hitbtc:0.4.1_1463249805072_2f0e73 response=true [c.n.n.t.CheckOrdersTask:142]
06:19:31.576 [priceTriggerTask] INFO  - Price Updated. bitfinex:1 BTC = 454.65 USD [com.nubits.nubot.tasks.PriceMonitorTriggerTask:359]
06:19:45.898 [checkNud] INFO  - Executing class com.nubits.nubot.tasks.CheckNudTask [com.nubits.nubot.tasks.CheckNudTask:37]

I updated the keystore (just in case; ./res/ssl/updateKeystore.sh) and tried to restart NuBot to no avail:

06:24:10.669 [main] ERROR - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target [c.n.n.t.w.HitbtcWrapper:1171]
06:24:10.673 [main] ERROR - could not launch bot com.nubits.nubot.bot.NuBotRunException: Problems while validating communication with exchange : [ ApiError [4 : Null Return] ] [c.n.n.l.MainLaunch:173]

@desrever, do you have a clue?
It looks like hitBTC uses a chained certificate to secure the API access, which NuBot can’t verify.
The web interface of hitBTC is working on my browser.

on it!

1 Like

ok. can you try now tu execute ./res/ssl/updateKeystore.sh and rr nubot?

Done

./res/ssl/updateKeystore.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 88647  100 88647    0     0  71421      0  0:00:01  0:00:01 --:--:-- 71431

Connection still fails

09:18:24.435 [main] ERROR - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target [c.n.n.t.w.HitbtcWrapper:1171]
09:18:24.438 [main] ERROR - could not launch bot com.nubits.nubot.bot.NuBotRunException: Problems while validating communication with exchange : [ ApiError [4 : Null Return] ] [c.n.n.l.MainLaunch:173]

NuLagoon’s NuBot on HitBTC is failed with same reason as well. Please let us know if there is a fix. Thank you.

ok, try now. apparently they have a different certificate for api.hitbtc.com than hitbtc.com

That didn’t fix it:

./res/ssl/updateKeystore.sh
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 91113  100 91113    0     0  77220      0  0:00:01  0:00:01 --:--:-- 77279
[...]
15:21:04.612 [main] INFO  - Starting task : Check connection with Nud [com.nubits.nubot.tasks.TaskManager:75]
15:21:04.615 [main] INFO  - Started BotTask checkNud [com.nubits.nubot.tasks.BotTask:57]
15:21:04.616 [checkNud] INFO  - Executing class com.nubits.nubot.tasks.CheckNudTask [com.nubits.nubot.tasks.CheckNudTask:37]
15:21:05.235 [main] ERROR - javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target [c.n.n.t.w.HitbtcWrapper:1171]
15:21:05.238 [main] ERROR - could not launch bot com.nubits.nubot.bot.NuBotRunException: Problems while validating communication with exchange : [ ApiError [4 : Null Return] ] [c.n.n.l.MainLaunch:173]

Can manually check the keystore to verify I have the right certificates?

@desrever any update? Liquidity provision at hitBTC is off for days, because nether NuLagoon nor me can run NuBot there.
5 minutes ago I updated the certificate store and tried again to no avail.

I just tested it here again and it worked right away. possible explanations:

  1. you are using a different keystore file from mine, This means the update bash script is not behaving correctly.
  2. hitbtc api servers use a different certificate in different geographical areas and no one is on my geographical area.

to eliminate 1) try to download the keystore and replace it manually. Download from this link : https://bitbucket.org/JordanLeePeershares/nubottrading/downloads/nubot_keystore.jks

if the above doesn’t work, see if you are seeing the same certificate I see. Navigate to https://api.hitbtc.com with chrome and click on the green lock icon, and download the certificate. ( compare it with [what I see here] (https://bitbucket.org/JordanLeePeershares/nubottrading/downloads/*.hitbtc.com.cer) .

If you find that the certificate you see is different then you can manually add it to the keystore with one line, which is well documented in nubot’s README.md

keytool -importcert -file filename.cer -keystore nubot_keystore.jks -alias “manualHITBTC-may-2016”

You will be prompted for a passphrase : type nub0tSSL

Please let me know what you find out .

EDIT: i tested the updateKeystore.sh script on branch develop and it works for me. Also tested in the 0.4.1 distribution of nubot

And up it is!
It was reason 1).
Before I manually downloaded the certificate file, the one that got updated by the script had a file size of 87050 Bytes, while it now has 91113 Bytes.

status of mOD single side NuBot at hitbtc:
        "1:NBTBTC:hitbtc:0.4.1_1464364733036_39d605" : {
            "buy" : 0.0,
            "sell" : 970.695
--
        "2:NBTBTC:hitbtc:0.4.1_1464364733036_39d605" : {
            "buy" : 1094.78,
            "sell" : 0.0

@henry, time to update the certificate at res/ssl/ file manually!

Thanks. I will do it soon

1 Like

I still don’t get it … I also tried using the script and it worked!

can you cat updateKeystore.sh for me here?

cat res/ssl/updateKeystore.sh
#!/bin/bash
#This script downloads the latest keystore
#first rename existing keystore
mv nubot_keystore.jks nubot_keystore_old.jks
#then download from repository (branch develop)
curl -L -O https://bitbucket.org/JordanLeePeershares/nubottrading/raw/develop/res/ssl/nubot_keystore.jks

What I did was (from within the directory res/ssl/)

wget https://bitbucket.org/JordanLeePeershares/nubottrading/downloads/nubot_keystore.jks