People, this is the kind of conversations that miss by not
joining our Slack jl777: I had been battling against how to best implement the LP logic. I finally stumbled onto the right solution, at least I am not having "writer's block", which I get when I am trying to do things the wrong way. Until this latest iteration, I was trying to do it a bit backwards, ie. have the client side auction trigger a balancing trade. I wont get into why that is backwards, just try to write it that way and you will see.
Anyway, now I am on the right path and it involves running a full market maker on an exchange so that it is in realtime making the spread on that exchange. Then when a DEX request comes in, it can just adjust the net positions as appropriate and the marketmaker will automatically balance the total exposure (once the bugs are fixed). Another advantage is that the LP marketmaker is a pure external application that calls iguana API so wont affect any non-LP deployments. This separation also makes things a lot easier. I expect some minor changes will be needed in the iguana API to support this, but the layering achieved will be well worth it. To allow a low risk operating mode, I will need to add a special case of a very low activity market maker, but that will be after the normal marketmaker is solid to answer the obvious question, yes, it means that part of the iguana release will include a fully functional market maker for supported exchanges as a side effect of this. Running an active marketmaker will have the usual risks, so it is not for everyone
pondsea: So the lp wont need the currency on hand and could just buy or sell via the exchanges
jl777: it would need to have both sides locally and on the exchange, otherwise how could it do the trades?
pondsea: Ah yeah no api to withdraw from exchange :stuck_out_tongue: How can we improve the security aide of things if we need to hold big amounts of btc/alts to be able to function as a LP? Unless there could be 2 modes? 1 is live/instant but for less spread there is a 2nd option where a contract is setup and the LP has say 24 hours to send the funds? LP still buys/sells at the rate from the exchanges but has to process the withdrawal manually
jl777: I dont like it, adds a lot of trust to the process, the "instant" will still need to wait for BTC confirms, which isnt instant nowadays, so maybe most people will use it in 0-conf mode with smaller amounts. Since the marketmaker will be part of the iguana desktop app (I am assuming), we will decentralize the marketmaking and anybody can make a market with their parameters via GUI
pondsea: cool :slightly_smiling_face:
jl777: It wont be an advanced market maker, just something you can set your risk capital limits, profit margin and activity level. As long as price doesnt move big distance to never come back to it, you end up making the specified profit margin liquidity of a coin is part of its value, so KMD whales would be motivated to use part of their capital for the marketmaker and incremental losses/profits wont really matter much compared to a whale's capital the first non-braindead version is live on bittrex now doesnt even check available balance or orderstatus yet and already 500+ lines of code. no wonder I didnt want to put this into iguana itself
pondsea: I could be a lab rat if you need someone to test it :grin: Once it is easy enough to run lol
jl777: Actually if you can trade against it on trex to make sure it isnt too easy to manipulate, that would help. It is trading about 0.1 BTC with a 1 % spread. If there is already a bid that is higher or ask that is lower, it doesnt post a quote
pondsea: Will have a look when i get home.
mark81: @jl777 do you mean next iguana app version or iguana core will be including market maker function? If iguana app (idex) would have this function build into in gui level it would draw lot of attention torwards komodo and supernet tech.
jl777: It is a standalone app, so not directly in the core, but it does use iguana core. I assume the desktop iguana app would be able to run it without much problems in order to do LP nodes properly a functioning market maker is required, so it seems it will be part of the iguana app
grewalsatinder: yep, I’ll be including that as a part of EasyDEX GUI :slightly_smiling_face:
jl777: so far it is breaking even but that is due to my setting its profit margin to match the bittrex commissions and there is no DEX side trading yet, that side should be a bit more profitable than the bittrex side, though I could set the profit margin to any arbitrary level, it is good to have KMD spreads at below 0.5% as that makes it one of the lowest spreads out of all the bittrex coins. I am surprised at how many trades it has done (almost 30) in a bit over 12 hours. The following are the current config variables internally:
char *base = "KMD", *rel = "BTC", *name = "komodo", *exchange = "bittrex";
char *apikey = "xxx";
char *apisecret = "ttt";
double profitmargin = 0.0025;
double maxexposure = 1.; // maximum risk level in BTC
double incrratio = 0.1; // max size of each order relative to maxexposure
double start_BTC = 3.15 + 0.10404197;
double start_KMD = 20000 + 1000;
Probably a few more before I am done, already past 700 lines in just a day and a bit and still need to complete the interface to DEX side of things
mark81: To use such tech would be good to make user invest directly to komodo by holding funds on iguana app. Not much but that would not come for free of work that devs have done. Also using it would cost fees in komodo. What you think ?
jl777: yes they need to have matching funds on the iguana side, or it wont work
mark81: I am thinking this tech beyond komodo to other altcoins. What if iguana market maker becomes cheapest bot technology for market?
jl777: considering that it is free, seems it wins on the cost front
mark81: Yes but thats why user have to invest directly to komodo to get that feature in works?
jl777: the iguana side needs to be funded for the LP code to work
mark81: Plus pay fees with komodo..
jl777: cant enforce that. Just getting liquidity into DEX is adequate compensation, not need to monetize it
mark81: How about users that want to play with centralized exchanges? You have said that supernet should get fees of its services. So why not allow to use market maker as bot feature on centralized exchanges and get money coming in that way.
jl777: the current bot is using bittrex on one side and DEX on the other
mark81: Tech could introduced free to world first but after period to start monetization.
jl777: by running it the bot node makes incremental profits on the DEX side, so profit motive would be enough to get most all of the market maker bots actively supporting iguana DEX by working via basilisk mode it will be very lightweight to run an LP node. Clearly the more money an LP node can make, the more people will run it, so I intend to make it make money from the DEX also, which will get liquidity coming into DEX and once iguana DEX has real liquidity, then its other advantages makes it a powerful force in the market
mark81: Ok, cant argue your points. You have figured thinks pretty well forward :+1: These kind of conversations only drive to one conclusion - - > i must by more komodo and soon!