1. Can someone explain in more detail the difference between client and lp nodes. In particular which one is better to earn fees with?
I'm still trying to understand the difference and the reasons to use client vs lp node with the dex.
As far as earning fees, it is expected that LP nodes are run by people who own the DEX (or JUMBLR or BOTS) assets and out of self interest they will keep an LP node running. Of course making the spread is always a nice income if you can manage (or dont care about) the overall market fluctuations
As far as what type of node to run, the LP nodes are able to do direct networking due to their published ip addresses so they have a speed advantage over pubkey based client nodes.
client nodes can now also be posting offers just like an LP node. and it is done automatically just like LP nodes. In addition, a client node can fill existing orderbook offers using the same utxo that are at the same time posted in N order books.basically you dont have to lock up your funds dedicated to a specific trade. It is your money, there is no need to withdraw it as you always control it, and you can make as many trade offers as you like, even use the same funds to fill existing offers (but I prevent self trading)
Even a basilisk node will be able to be an LP node. That has taken a bit more work, but I feel it is the more practical approach as this way anybody can be an LP node just by clicking a few fields in the GUI (not ready yet) without needing to download the entire blockchain.
as a client your node will connect to the peers but wont become a peer,
as an LP node, your node will become a peer but will only be able to be a maker and not a maker and taker like the client nodes can
I made a custom peer to peer network that the LP nodes create among themselves. This peer network is designed to propagate the list of peers, list of utxos and each node's prices among each other as efficiently as possible. It isnt a consensus requirement to have all nodes in 100% sync, but I think most of the time they should be
each node has a pubkey and of course an ip address, but only the peer networking is using ip addresses of the LP nodes
the orderbook is pubkey based, so each offer has the offer details and the pubkey
in order to enable client nodes that have no known ip address to the network to talk to each other, I made a forwarding service that the LP nodes provide
each node registers their pubkey/ipaddr to one or more LP nodes. After that, that LP node will respond positively to a lookup command when asked about a pubkey it is forwarding to. So, there isnt much ip privacy, but at least your ip address isnt posted on all the orderbooks and is mostly limited to the LP nodes. however since anybody can be an LP node, do not rely on any actual ip privacy. if you need that you need to take separate measures. Since there is no ip privacy guarantee, during the atomic swap process, the two nodes that are trading do establish a direct ip connection. Well it is using nanomsg so only the offering side is posting their ip address, but essentially it is direct ip link. Which means it is fast and reliable, only if one of the nodes disconnects will there be an issue
..Snip..
Due to the efficient nature of the peer network, it has a memory of all the peers, utxos and prices. Short of stopping all LP nodes at the same time, this memory will stay intact. This is good but it could be bad if some things that should be forgotten are not.
In order to prevent spamming, the client node must pay a dexfee (1/777th tradesize) to assure the LP node that he is serious. Putting an actual financial cost has the advantage in that it removes spammers at the first step and also it creates a revenue stream for our patient investors. There is an implicit assumption that LP nodes are more reliable than client nodes. Even before the dexfee is sent, the two nodes use the cut and choose protocol to perform a key exchange and create a trade specific set of addresses that will be used. Once this is done, then the dexfee is sent. Once the fee is verified to have been sent, the atomic swap starts for real. By convention the two parties trading are Alice (client) and Bob. Bob has the burden of providing a deposit in the protocol. To compensate, Bob has no dexfee at all, just the coins tx fee
From this it seems that the lp node is faster than the client, pays no dex fee -the client does, but has to put up 13% more per order than the client.
The lp broadcasts its ip address to others whereas the client only broadcasts to a single node. Ie: client is more anonymous
Its unclear to me if you will always need to dl each coin or if basilisk will work as a light wallet for each coin. Is the basilisk lpnode or client node? Not having to dl each coin would be huge.
Also it is unclear of why the client can be a maker taker and the lp node just a taker. How is the lp node supposed to make the spread?
It seems that the lp nodes are harder to setup, require coins to be downloaded and require your node to stay on and act as a server and require the extra %13 to be held but don't necessarily get enough perks for running one vs a client. Maybe im wrong.
It would be helpful to discuss scenerios or strategies that would use one vs the other.
Thanks.