(start of lsmr in current develop: https://github.com/BitShares/bitshares/blob/6d42fcab803983ec16f9ec094a71fa2078febad3/libraries/blockchain/include/bts/blockchain/lsmr_record.hpp
we can also copy the working lsmr impelmentation from TC's repo)
Right on. Glad you have an eye on this. We may see a test version in march to play around with that can be applied to Bitshares.
I thought some more and I'm thinking we'll have to worry a bit about additional interesting things that happen if, instead of having a bunch of agents doing one-shot deals with the market maker, we have a bunch of standing orders that will execute whenever the price (tries to) move past a given value.
Suppose there's a buy order for A at $0.40. The market maker's current price for A is $0.41 and current price for B is $0.45. Someone places a buy order for a large quantity of B at $0.50. Buying B will push up the price of B and push down the price of A, but once the price of A hits $0.40, the order for A starts to execute, putting a downward pressure on B which will fight the upward pressure from the buy order.
In other words, the buy order for A creates a floor at $0.40 below which the value of A cannot fall until the order is totally filled. Once the price hits this floor, it becomes harder for the guy buying B to raise the price (less price movement per quantity bought).
We can classify the assets as reactive, active or inactive based on the price of the top-of-book order relative to the market maker's price. Inactive order isn't matched by the market maker (buying more cheaply than the market maker's offering). Active order is matched by the market maker with nonzero quantity (i.e. buying strictly greater than the market maker's current price). Reactive order is exactly matched by market maker's price, it "executes at zero quantity" which means in practice it doesn't execute. But when an active order executes, every reactive order will execute and oppose the price forces exerted by the active order on themselves and the active order (but will push in the same direction as the active order on inactive prices!)
I'm trying to figure out how we end up implementing this without needing numerical integration. It might be possible; I'll have to think about it some more. OTOH maybe numerical integration is fine, especially if we smooth out the discontinuities a little (e.g. instead of having the boundaries be vertical cliffs, make them instead very steep slopes 0.1% wide with smooth curve-in and curve-out, which are less "confusing" to the integrator).
Since I'm not as close to the implementation as you are I won't share the same appreciation that you just mentioned. I tend to think this is natural function of price discovery, in this case information discovery. The random walk could be noise (which is greatest the shorter the time interval your looking at), or it could be that this rightfully prices the degrees of belief within the market.
However, this may help. Please do look at a this modified market maker that truthcoin and augur are going to use called Practical Liquidity Sensitive Market Maker. From what I've gathered since I started reading it today, there is a fee charged (say 3%), which is then applied to the liquidity pool. This alpha helps to limit the swings in the markets. The impact of loss is reduced and a bookie won't think hard about what the appropriate seed capital should be when authoring the contract.
http://forum.truthcoin.info/index.php/topic,130.msg886.html#msg886http://www.eecs.harvard.edu/cs286r/courses/fall12/papers/OPRS10.pdfhttp://www.bayesianinvestor.com/blog/index.php/2010/06/21/an-improved-automated-market-maker/btw since your pivoting to prediction mrkets don't be afraid to start jumping into the truthcoin forums and start picking everyone's brains there. Paul is always helpful when answering questions.