Open Scalena opened 1 year ago
Hey @Scalena, thanks for submitting. I like the idea and will think about it and investigate a bit. Do you have suggestions or references for similar plugin systems implemented elsewhere I could look at?
@delta1 That's great! Actually, I got the idea while looking into Core Lightning (https://github.com/ElementsProject/lightning) which is, after all, a related application and has a very elaborate plugin system. I'm not sure if something similar would be appropriate for this project, but it is definitely worth looking at for inspiration. See also at https://github.com/ElementsProject/lightning/blob/master/doc/PLUGINS.md
Thanks!
Instead of a plug-in system, perhaps an easier approach to accomplish this would be to create a way to stream desired prices to the ASB through some kind of IPC, perhaps Unix sockets?
Neat idea, thanks @ikmckenz. However, I think that the source of the price feed is orthogonal to the method of calculation of the provider's spread.
Ultimately we want the provider to be able to specify both:
Once it's safer to trade larger amounts through atomic swaps, I think makers who want to quote higher volumes and tighter spreads will want features that will be difficult to implement in a plugin system.
Unless the plugins can stream in pre-calculated data from external applications, the plugin system would have to be pretty sophisticated with it's own DSL to define how all the inputs are set. Essentially the plugins would have to be a fully featured independent trading system.
By providing a hook for a plug-in to be queried on a quote request, two features could be added to the ASB:
min_buy_btc
andmax_buy_btc
limits using a custom algorithm, for example based on their wallet balances.The current websocket + fixed values solution could be extracted into an exchangable plug-in or be kept as a default solution. Starting a plug-in API might also lay the foundations for future costumization features around a robust ASB core.