Splice.DSO.AmuletPrice

Templates and code for the SVs to agree on a amulet price using median-based voting.

Every sv can change its desired amulet price at any time they like provided they wait at least one tick duration (2.5 minutes by default) between changes.

New OpenMiningRounds are always openened with the median of the amulet prices voted for by the SVs.

Templates

template AmuletPriceVote

A vote by an SV for their desired amulet price.

Signatory: dso

Field

Type

Description

dso

Party

sv

Party

amuletPrice

Optional Decimal

Set to None for new svs, but defined thereafter.

lastUpdatedAt

Time

The last time this price was updated. Tracked to limit svs from changing their vote more than once per tick.

  • Choice Archive

    Controller: dso

    Returns: ()

    (no fields)

Functions

fetchMedianAmuletPrice

: Party -> [Party] -> [ContractId AmuletPriceVote] -> Update Decimal

median

: [Decimal] -> Decimal

See https://en.wikipedia.org/wiki/Median