intrepidshape/elm-web3-ui/2.0.0

NOTE: the latest version is 4.0.0

Web3.Ui.BondingCurve

SVG sparkline of an A * x^N bonding-curve price function. Renders the price-vs-supply curve from supply 0 to a chosen max, with optional markers for the current spot price and floor price.

Web3.Ui.BondingCurve.sparkline
    { coeffA = curve.coeffA
    , exponent = 1.1
    , supply = curve.supply
    , maxSupply = maxSupply
    , floorPrice = Just curve.floorPrice
    , width = 320
    , height = 80
    }

The component is generic for any curve of shape price = A * supply^N, which covers x^1.1, classic x^2, and any sub-/super-linear issuance model. Math runs on Float because the chart is purely visual — do not consume the rendered points for on-chain calculation.

CSS classes: web3-bondingcurve, web3-bondingcurve__path, web3-bondingcurve__spot, web3-bondingcurve__floor. Stroke colors come from CSS.

{ coeffA : BigInt
, exponent : Float
, supply : BigInt
, maxSupply : BigInt
, floorPrice : Maybe BigInt
, width : Int
, height : Int
}
-> Html msg

Render the sparkline.