Mathematical Overview
Last updated
Last updated
Longship prices all trades via an AMM. Trades are accepted if they will increase the market maker’s utility (possibly after some fee margin). The market maker’s utility function is the expected utility of its holdings evaluated at a price 4 hours in the future. Letting represent a function that produces the market maker’s wealth at a certain price, we have:
We use negative reciprocal utility (a barrier function). Barrier utility functions in automated market making were originally introduced in (note: Othman was a core contributor to Longship), building on the work of :
The positive homogeneous invariant corresponding to this utility function is simply the negative reciprocal itself:
Changes in the invariant function are used to calculate the issuance of LP tokens. Because the invariant function is positive homogeneous, a user whose LP contribution doubles the market maker’s wealth in all future price states would be issued LP tokens worth half of the resulting market.
The set of points p to calculate the future price and their probabilities are determined by the and the volatility of the individual underlying asset.