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

Continuing the discussion from [ANN] sell side gateway at Bittrex by masterOfDisaster:

Intro

To continue the path to a focussed liqudity provision scheme, I want to offer a sell side (sell side only!) gateway at hitBTC.
That’s why I thought a sell side gateway there might be appreciated.

About the exchange

I once provided liquidity there (“modPuddle”) with a dual side operation (MLP style, with funds of friends and later own funds) and found the experience (reliability, stability of API, user interface) using hitBTC extraordinarily great.

The NBT deposit address is BQuc7rf5NTbcCQ4zonjBSPq5gBFw4ibUYH.
I won’t post a BTC deposit address as I don’t intend to make it a dual side gateway.

One thing is different from hitBTC and all other exhanges that I know:
hitBTC differentiates between a “Main Account” and a “Trading Account”. Funds that are deposited are in the “Main Account”. To make them available (e.g. for NuBot), I need to manually move them to the "Trading “Account”.
I don’t think this is a big issue, but wanted to make this clear; “activating” deposits won’t be done automatically.

Awaking shareholders

I’m not intending to create a motion for the contract.
I will strictly refer to the discretion of FLOT.
If FLOT deposits funds from the FLOT multisig address, this contract will be enabled.
The proposal at Daology is to provide a hash to ensure the contract doesn’t get changed after it has started.

If NSR holders don’t want this to happen or want to stop it, they might create a motion to stop it.

Contract

Hashed version of this contract:
https://daology.org/proposals/3f31e3bd96c57f477ce6fc7062997d73df426903
Hash: 64a4e368d0bab0a06b87a8dd6d5224f42535b8b0

Copied version of the Daology version:

###Intro

@masterOfDisaster - below called "the operator" - will operate a NuBot on the exchange mentioned below. The liquidity is being broadcast using a custodial address to allow tracking the liquidity situation of the bot. If the gateway needs funding, Nu (FSRT, FLOT, JordanLee, etc.) sends NBT to the exchange account deposit address. The NBT get sold and the earned BTC are not put into orders, but get transferred to a Nu address (T4 buy side) on a regular basis.

The process of selling NBT can be tracked with the getliquiditydetails RPC.

### Disclaimer

The operator charges a low fee for this sell side gateway, but offers no guarantee for anything - neither the availability of NuBot nor malfunctions of NuBot nor outages of the internet access nor the funds on the exchange.
The operator promises to send all (remaining) NBT and traded BTC to Nu (FSRT, FLOT) on a regular basis.
The operator is not responsible for tracking the funding level of the gateway.
The operator won't take any of the funds or trade them.
Nobody except Nu should send NBT to the gateway as **all** proceeds (or remaining NBT) will solely be sent to Nu addresses.
Funds that have been put on the exchange account by the operator for testing/monitoring purposes before the contract starts, are excluded from this rule.

### Parameters

* Operator: @masterOfDisaster
* Type: NuBot
* Exchange: hitBTC.com
* NBT deposit address: BQuc7rf5NTbcCQ4zonjBSPq5gBFw4ibUYH
* Pair: NBT/BTC
* Mode: Sell side only
* Sell Side Offset: > 1%
* Duration: 30 days, automatically extended by 30 days until withdrawal of all funds has been requested by authorized entity (NSR holder motion, FLOT majority in the respective group)
* Liquidity broadcast address: BETwD8nSjtj9ADSvej2na34xmsMYwPRymv
* Operator Fee: 30 NBT

### Activation of the gateway / starting the contract

Operation starts the day a Nu representative group or person (JordanLee, FLOT, FSRT) deposits funds at the deposit address.

The NBT broadcast address was once granted here for sell side activities at Poloniex.
It will be reused here, as it’s not Poloniex, but still a sell side activity.

The broadcast address will be shared between the Bittrex gateway and this one (and maybe additional gateway I’ll offer).
That makes checking the liquidity a little bit more complicated, but after thinking twice, requesting and tracking a dedicated NBT address for each operation creates a lot of efforts for both the NSR holders and the operators.
Liquidity per exchange is still available through “getliquditydetails” RPC.
One NBT address for liquidity broadcasting per operator should be fine.

Economical comparison

To comapre the financial attibutes of this sell side gateway with an operation that was contracted by NSR holders under the name modPuddle, I compare the provided liquidity and the costs.
It’s a little bit of comparing apples and oranges, because one operation was an MLP with rebalancing, etc. and this will be a sell side gateway.
Still the numbers are:

modPuddle liquidity: $1,500 (both sides; balancing at least once a week; target: each side with at least 45% ($675) volume)
modPuddle costs: 225 NBT/30 days

gateway liquidity: as much as Nu wants to provide
gateway costs: 30 NBT/30 days

While Nu obviously got more service from modPuddle, an important part of the contract was

and that is something Nu can have here as well - there just need to be enough NBT there.

Oh, there won’t be a buy side supported by this gateway! Traders will need to move NBT from hitBTC, if they want to trade them for BTC or hope that somebody puts buy side orders there.
This gateway is designed in a way that it can offer NBT at a reasonable price (while stocks last), but won’t actively support the hedging activities of traders.

If Nu risks, say 1,500 NBT and puts them there, it will be at break even from month 8 on.
In other words: even if Nu deposits 1,500 NBT at once, it saves 195 NBT each 30 days compared to modPuddle.
From month 8 on, Nu is better off this way - if hitBTC doesn’t default in between or the funds don’t get lost in any other way.
As modPuddle offered only around 750 NBT on sell side, Nu might do the same with this gateway. That moves break even to month 4.

Test run

NuBot settings from the test run:

test results:

status of mOD sell side only NuBot at Bittrex, hitBTC:
nud getliquidityinfo B | grep BETwD8nSjtj9ADSvej2na34xmsMYwPRymv -A 2
        "BETwD8nSjtj9ADSvej2na34xmsMYwPRymv" : {
            "buy" : 0.0,
            "sell" : 3.0

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

3 Likes

FLOT can deposit funds to BQuc7rf5NTbcCQ4zonjBSPq5gBFw4ibUYH now? If so, we should send $2k.

The bot testing is complete.
I dare say, the bot is ready.
BQuc7rf5NTbcCQ4zonjBSPq5gBFw4ibUYH is the deposit address, right.
I deposited 3.99 NBT for my test. They arrived.

As what I’m doing with these gateway operations might be perceived as slightly controversial, I can create a deposit tx, but won’t sign it (same as for the Bittrex gateway).

What about starting with 1,000 NBT just to see how it goes? 250 NBT will be put on T1 at once and replenished as long as there’s NBT left.
There’s not much trading there - maybe due to a lack of liquidity.

I can adjust the order book settings in a lot of way, but the offset of >1% is a part of the contract.
The current setting is 1.5%, but I’m willing to lower it close to 1%.

2 Likes

Please, do make the deposit txn for $2k. I’ll endorse it verbally, though I’m not able to do it technically. Clearly, it will be up to a 3-of-4 FLOT decision, which is where the debate will proceed. Or, as you suggest, it will stimulate a motion.

1 Like

I trust your gut feeling regarding the dposited amount.
Mine says that I should increase the T1.1 (1.5% offset) funds from 250 NBT to, say 500 NBT.
The T1.2 order will be at 2% with the current settings.

What do you say about that?

2,000 NBT deposit to hitBTC prepared, but not signed from me and I won’t sign it (broken record effect…).

I’ll make a post in the “FLOT NBT” thread.

yes on the 500 T1.1

Done:

15:06:32.941 [Strategy Secondary Task] WARN  - The balance is not enought to place the tier2 liquidity. (Balance is entirely on tier1 wall) 3.0 [c.n.n.t.L.LiquidityDistributionModel:241]
15:06:32.952 [Strategy Secondary Task] INFO  - The current balance equivalent 3.0 NBT is not enought to place the full SELL wall defined in the liquidity model (500.0).
Resizing the size of the order [com.nubits.nubot.trading.LiquidityDistribution.LiquidityDistributionModel:153]
15:06:32.972 [Strategy Secondary Task] INFO  - SELL- OrderBook : ----- SELL-side order book :
1.116002,0.00270986,3.0
SELL wall volume : 3.0
SELL tier2 volume = 0.0 NBT
Total SELL volume = 3.0 NBT
Best price :0.00270986 (1.1160016438$)
SELL balance left = 0.0 NBT-----  [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:228]
15:06:32.979 [Strategy Secondary Task] INFO  - Trying to place 1 orders... [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:229]
15:06:34.244 [Strategy Secondary Task] INFO  - SELL wall order updated. ID : 72a0be1d18ad size: 3.0 [com.nubits.nubot.trading.TradeUtils:232]
15:06:34.265 [Strategy Secondary Task] WARN  - **SELL** orders re-initialized on  **hitbtc** :  1/1 placed successfully
total amount placed : 3.0
Tier1 order size : 3.0
Tier2 cumulative order size : 0.0 (0 orders)
 [c.n.n.s.S.StrategySecondaryPegUtils:247]

Result:

status of mOD sell side only NuBot at Bittrex, hitBTC:
nud getliquidityinfo B | grep BETwD8nSjtj9ADSvej2na34xmsMYwPRymv -A 2
        "BETwD8nSjtj9ADSvej2na34xmsMYwPRymv" : {
            "buy" : 0.0,
            "sell" : 3.0
[...]
nud getliquiditydetails B | grep BETwD8nSjtj9ADSvej2na34xmsMYwPRymv -A 1000 | grep 0.4.1_1458486198996_a73b18 -A 2
        "1:NBTBTC:hitbtc:0.4.1_1458486198996_a73b18" : {
            "buy" : 0.0,
            "sell" : 3.0
--
        "2:NBTBTC:hitbtc:0.4.1_1458486198996_a73b18" : {
            "buy" : 0.0,
            "sell" : 0.0

Current settings:

The bot is on standby until Nu decides to deposit funds to the hitBTC address and will be activated once I moved the funds from “Main Account” to “Trading Account”.
I’ve found room for improvement in my contract: the deposit doesn’t activate the 30 day window for 30 NBT; putting the funds on order does!
…then again: for 1 NBT/day who cares…

Last startup (with settings from above) before I put NuBot to sleep:

15:58:50.328 [Strategy Secondary Task] WARN  - The balance is not enought to place the tier2 liquidity. (Balance is entirely on tier1 wall) 3.0 [c.n.n.t.L.LiquidityDistributionModel:241]
15:58:50.340 [Strategy Secondary Task] INFO  - The current balance equivalent 3.0 NBT is not enought to place the full SELL wall defined in the liquidity model (500.0).
Resizing the size of the order [com.nubits.nubot.trading.LiquidityDistribution.LiquidityDistributionModel:153]
15:58:50.361 [Strategy Secondary Task] INFO  - SELL- OrderBook : ----- SELL-side order book :
1.016001,0.00246704,3.0
SELL wall volume : 3.0
SELL tier2 volume = 0.0 NBT
Total SELL volume = 3.0 NBT
Best price :0.00246704 (1.0160010832000002$)
SELL balance left = 0.0 NBT-----  [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:228]
15:58:50.369 [Strategy Secondary Task] INFO  - Trying to place 1 orders... [com.nubits.nubot.strategy.Secondary.StrategySecondaryPegUtils:229]
15:58:51.791 [Strategy Secondary Task] INFO  - SELL wall order updated. ID : 689ab2bf6149 size: 3.0 [com.nubits.nubot.trading.TradeUtils:232]
15:58:51.811 [Strategy Secondary Task] WARN  - **SELL** orders re-initialized on  **hitbtc** :  1/1 placed successfully
total amount placed : 3.0
Tier1 order size : 3.0
Tier2 cumulative order size : 0.0 (0 orders)
 [c.n.n.s.S.StrategySecondaryPegUtils:247]
[...]
16:01:27.580 [checkOrders] WARN  - Liquidity info submitted:
        tier=1 buy=0.0 sell=3.0 identifier=1:NBTBTC:hitbtc:0.4.1_1458489336585_79e40c response=true
        tier=2 buy=0.0 sell=0.0 identifier=2:NBTBTC:hitbtc:0.4.1_1458489336585_79e40c response=true [c.n.n.t.CheckOrdersTask:142]

Can you coordinate the gateways so thhat fund sent to one address can be distributed to your gateways on several exchanges? Can the distribution proportional to some figure of merit?

T4 singlesig. Specifically state that it counts as T4 for buyback calculations and give a maximum to the amount of funds, like 10 btc buy and 5k nbt sell. If you want you can ask for payment, but it seems like this is an extension of FLOT to me. Just about what’s easiest for y’all.

1 Like

For 30 NBT / 30 days I won’t provide any active fund management or balancing between the gateways.
FLOT (or any other Nu entity) can deposit NBT and I’ll withdraw BTC from time to time.
Using Cointoolkit, several output addresses can conveniently be included in one tx.
That’s it.

I won’t do any reporting in addition to the liquidity broadcast by the NuBots. I’ll check the NuBots to make sure they work.
Fund status etc. needs to be gathered from getliquiditydetails RPC.

I hope to see even more automation and less manual work.
Without more automation Nu will fail to introduce and support new products (and will have a hard time to keep the current system running).

1 Like

OK. Keep it simple.

Good idea. Create a bot to generate such tx based on current liquidity automatically. The algorithms can be refined by the community. FLOT can choose to sign rubber-stamp them.

1 Like

What have you set as txfee? I see that the fee is zero in Hitbtc?

I don’t know.
Most likely 0.02 ignoring the fact that the fee is 0.
It won’t do anything bad, though - just create a little bit extra offset.
As the terms state >1%, it’s still compliant :wink:

1 Like

@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.