doc and whitepaper update
This commit is contained in:
@@ -3,16 +3,12 @@ pragma solidity ^0.8.30;
|
||||
|
||||
import {ABDKMath64x64} from "../lib/abdk-libraries-solidity/ABDKMath64x64.sol";
|
||||
|
||||
/// @notice Stabilized LMSR library with incremental exp(z) caching for gas efficiency.
|
||||
/// - Stores b (64.64), M (shift), Z = sum exp(z_i), z[i] = (q_i / b) - M
|
||||
/// - Caches e[i] = exp(z[i]) so we avoid recomputing exp() for every asset on each trade.
|
||||
/// - Provides closed-form ΔC on deposit, amount-out for asset->asset,
|
||||
/// and incremental applyDeposit/applyWithdraw that update e[i] and Z in O(1).
|
||||
/// @notice Numerically stable library for a Logarithmic Market Scoring Rule based AMM. See docs/whitepaper.md
|
||||
library LMSRStabilized {
|
||||
using ABDKMath64x64 for int128;
|
||||
|
||||
struct State {
|
||||
int128 kappa; // liquidity parameter κ (64.64 fixed point)
|
||||
int128 kappa; // liquidity parameter κ (64.64 fixed point)
|
||||
int128[] qInternal; // cached internal balances in 64.64 fixed-point format
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user