Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] List of interface enhancements #1521

Closed
raladev opened this issue May 5, 2020 · 4 comments
Closed

[Discussion] List of interface enhancements #1521

raladev opened this issue May 5, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request P2 mid priority question/tbd Further information or discussion needed

Comments

@raladev
Copy link
Contributor

raladev commented May 5, 2020

Background

I worked with xud during last weeks and as a result I collected inconveniences that I had to face. There is a little improvements and conceptual that should be discussed.

List

  • Done change addpair interface in cli from 'addpiar BTC LTC' to 'addpair BTC/LTC' because this format is used in other places.
  • add all pairs in error message when u delete currency with existed pair (if u have 2 pairs that block deletion of the currency, error message should contains 2 pairs);
  • make discover output more useful - now it returns number of discovered peers but does not return number of autoconnected peers after discover (it can be different because of tor using);
  • add plain text output in cli for removeorder/discover commands - now they have json output;
  • change output of removeorder. As a user I want to know status of the operation, but instead of that i got info about amount in hold (it is additional information, not main) - It seems removed qty should be returned in response + remained qty if it was partial removal + qty in hold if it exists.
  • Not Required add option to build orderbook using orders only from peers that have direct channels with me - as a user, I dont want to get No route errors when fill order because of channel states of another(third) user.
  • Boltz Add sort of mechanism to channel opening from second side. I found a very big minus for me in this system - for a successful trade I need remote balance for one of the currencies. There are two ways to get it: 1. push amount 2. liquidity maker should open channel with me for one currency.
    First is good only if I want to get profit in arbitrage and I have balances in both currencies and I completely trust the second side(because he can close channel forcely and I will lose push amount).
    Second is better but we have no clear mechanism to say to second part something like "I opened 3 BTC channel with u and want buy LTC periodically from u, can u please open channel with me". And second part after recivivng can see that someone have active channel with 3 BTC balance and he asked about LTC channel with equivalent balance.
@raladev raladev added enhancement New feature or request question/tbd Further information or discussion needed labels May 5, 2020
@kilrau
Copy link
Contributor

kilrau commented May 5, 2020

* change addpair interface in cli from 'addpiar BTC LTC' to 'addpair BTC/LTC' because this format is used in other places.

We should allow addpair ltc btc, addpair ltc/btc both (ignore caps as usual too). Should be a quick one right? @sangaman Please open an issue for beta.5 and assign to @sangaman

Background

I worked with xud during last weeks and as a result I collected inconveniences that I had to face. There is a little improvements and conceptual that should be discussed.

List

* change addpair interface in cli from 'addpiar BTC LTC' to 'addpair BTC/LTC' because this format is used in other places.

* add all pairs in error message when u delete currency with existed pair (if u have 2 pairs that block deletion of the currency, error message should contains 2 pairs);

* make discover output more useful - now it returns number of discovered peers but does not return number of autoconnected peers after discover (it can be different because of tor using);

* add plain text output in cli for removeorder/discover commands - now they have json output;

* change output of removeorder. As a user I want to know status of the operation, but instead of that i got info about amount in hold (it is additional information, not main) - It seems removed qty should be returned in response + remained qty if it was partial removal + qty in hold if it exists.

* add option to build orderbook using orders only from peers that have direct channels with me - as a user, I dont want to get No route errors when fill order because of channel states of another(third) user.

* Add sort of mechanism to channel opening from second side. I found a very big minus for me in this system - for a successful trade I need remote balance for one of the currencies. There are two ways to get it: 1. push amount 2. liquidity maker should open channel with me for one currency.
  First is good only if I want to get profit in arbitrage and I have balances in both currencies and **I completely trust the second side**(because he can close channel forcely and I will lose push amount).
  Second is better but we have no clear mechanism to say to second part something like "I opened 3 BTC channel with u and want buy LTC periodically from u, can u please open channel with me". And second part after recivivng can see that someone have active channel with 3 BTC balance and he asked about LTC channel with equivalent balance.

Agree on these, but not high prio, we can keep them in here for now.

add option to build orderbook using orders only from peers that have direct channels with me - as a user, I dont want to get No route errors when fill order because of channel states of another(third) user.

Disagree because most swaps will have two legs in future

* Add sort of mechanism to channel opening from second side. I found a very big minus for me in this system - for a successful trade I need remote balance for one of the currencies. There are two ways to get it: 1. push amount 2. liquidity maker should open channel with me for one currency.
  First is good only if I want to get profit in arbitrage and I have balances in both currencies and **I completely trust the second side**(because he can close channel forcely and I will lose push amount).
  Second is better but we have no clear mechanism to say to second part something like "I opened 3 BTC channel with u and want buy LTC periodically from u, can u please open channel with me". And second part after recivivng can see that someone have active channel with 3 BTC balance and he asked about LTC channel with equivalent balance.

IMO second part is the only way. So what you would want is to see (I agree) or to manage the remote channel balance? Sorry, I didn't get that clearly @raladev

sangaman added a commit that referenced this issue May 6, 2020
This modifies the `addpair` command to use the trading pair ticker
format such as LTC/BTC used in different commands, while keeping the
ability to specify currencies separately.

Related issue #1521.
@sangaman
Copy link
Collaborator

sangaman commented May 6, 2020

change addpair interface in cli from 'addpiar BTC LTC' to 'addpair BTC/LTC' because this format is used in other places.

Good idea. #1522

add all pairs in error message when u delete currency with existed pair (if u have 2 pairs that block deletion of the currency, error message should contains 2 pairs);
make discover output more useful - now it returns number of discovered peers but does not return number of autoconnected peers after discover (it can be different because of tor using);
add plain text output in cli for removeorder/discover commands - now they have json output;

I don't object to these but I'd agree these are low priority enhancements, making issues for each one and marking them as such or good first issue/help wanted would be good. The one I'm not sure about is the discover output but the other two should be fairly straightforward.

change output of removeorder. As a user I want to know status of the operation, but instead of that i got info about amount in hold (it is additional information, not main) - It seems removed qty should be returned in response + remained qty if it was partial removal + qty in hold if it exists.

This makes sense, at least the part about the amount of the order that was successfully removed. The remaining quantity are hold quantity will always be equal. I think this is a functional change and slightly more important than the issues above. I think it would also be better for this to be its own issue.

add option to build orderbook using orders only from peers that have direct channels with me - as a user, I dont want to get No route errors when fill order because of channel states of another(third) user.

I think this ties in with the sanity swap idea which accomplishes the goal of ensuring we can route orders but isn't so limiting as to require direct channels. It would take a decent amount of changing to potentially sensitive code to enforce this direct channel only requirement (especially if you want to ensure the channel remains open) so I don't think this is worthwhile, and like kilian said longer term it will be uncommon to only trade using direct channels.

Add sort of mechanism to channel opening from second side. I found a very big minus for me in this system - for a successful trade I need remote balance for one of the currencies. There are two ways to get it: 1. push amount 2. liquidity maker should open channel with me for one currency.
First is good only if I want to get profit in arbitrage and I have balances in both currencies and I completely trust the second side(because he can close channel forcely and I will lose push amount).
Second is better but we have no clear mechanism to say to second part something like "I opened 3 BTC channel with u and want buy LTC periodically from u, can u please open channel with me". And second part after recivivng can see that someone have active channel with 3 BTC balance and he asked about LTC channel with equivalent balance.

Joint funded channels have been a work in progress on the lightning network for a while. I think it's a bit out of scope from the perspective of xud, once joint funded channels are natively supported we can try to leverage those, or in the meantime we can provide a channel opening service separately that opens balanced channels, but it's hard to do through xud alone I think.

@raladev
Copy link
Contributor Author

raladev commented May 6, 2020

#1522 * change addpair interface in cli from 'addpiar BTC LTC' to 'addpair BTC/LTC' because this format is used in other places.
#1525 * add all pairs in error message when u delete currency with existed pair (if u have 2 pairs that block deletion of the currency, error message should contains 2 pairs);
#1526 * change output of removeorder + add plain text output in cli for removeorder
#1527 * change output of discover + add plain text output in cli for discover command

I don't think this is worthwhile, and like kilian said longer term it will be uncommon to only trade using direct channels.

Got it. I thought a little more about this case. It seems the goal that I want to achive is swapping only with peers that I want. I want orderbook only with orders of whitelisted peer/peers and i dont want to see orders of peers that establish connection with my whitelisted peer (and as a result I got connection with them too). Is there solution for that in current setup that I missed?

So what you would want is to see (I agree) or to manage the remote channel balance? Sorry, I didn't get that clearly @raladev

I want to have opportunity to ask second xud to open channel with me without additional communication channels like site, TG or email.

Problem:

  1. I open Generate simple html website from orderbook #1495 site and see the activity in LTC/BTC orderbook. I have monthly income in BTC and want periodically convert it to LTC.
  2. I start my xud node and depost my lnd-btc wallet and open btc channel with xud1/FirstMarketMaker/SecondMarketMaker
  3. I stucked. What I need to do now? How I should get LTC channel with remote balance?

My solution:

  1. User 1 opens 3 BTC channel with MM.
  2. User 1 sends Ask request to MM using cli: xucli askAboutChannel
  3. MM can monitor your list manually using ./xucli channelAsks or by bot using something like ./xucli streamAsks
    3.1 In channelAsks he can see following info: peer, reputation, channel_id_of_opened_channel, currency_of_opened_channel, amount_in_opened_channel, currency_of_asked_channel, preferable_amount_in_asked_channel.
  4. He can reject request or mark it as readed and after that open channel with this peer manually if he wants

Note:
Why we need opened channel on second step? As a MM or other user, I dont want to open channel and pay commissions without a reason.

@kilrau
Copy link
Contributor

kilrau commented May 6, 2020

Got it. I thought a little more about this case. It seems the goal that I want to achive is swapping only with peers that I want. I want orderbook only with orders of whitelisted peer/peers and i dont want to see orders of peers that establish connection with my whitelisted peer (and as a result I got connection with them too). Is there solution for that in current setup that I missed?

No solution in the current setup, but a plan for the future: #179

How I should get LTC channel with remote balance?

Good question! The short answer: if the maker you are trading with is using a LightningServerProvider (LSP) like boltz, it will automatically open a channel to you to make this swap happen (in future, still some tbds how this could work especially also since the maker will need to pay the costs for opening the channel). If he doesn't, then you can use a similar service from Boltz to get a LTC channel with remote capacity by sending BTC on-chain to Boltz. If you don't want to use a LSP, which is centralized as you noted, but the only real way of automating and making things convenient in lightning - you will have to send a telegram message...

Why we need opened channel on second step? As a MM or other user, I dont want to open channel and pay commissions without a reason.

See above, in the default case the maker will pay for this. But I need to think some more how we could convince the maker to open a channel to a brand new taker that we know nothing about and might be just costing us money and even bail out of the trade.

I have monthly income in BTC and want periodically convert it to LTC.

I advise against this :)

sangaman added a commit that referenced this issue May 7, 2020
This modifies the `addpair` command to use the trading pair ticker
format such as LTC/BTC used in different commands, while keeping the
ability to specify currencies separately.

Related issue #1521.
@kilrau kilrau changed the title [Discussion]List of interface enhancements [Discussion] List of interface enhancements May 15, 2020
@kilrau kilrau added the P2 mid priority label May 15, 2020
@kilrau kilrau closed this as completed Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P2 mid priority question/tbd Further information or discussion needed
Projects
None yet
Development

No branches or pull requests

3 participants