> ## Documentation Index
> Fetch the complete documentation index at: https://docs.canton.network/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> If you are building a Canton Network application, start from https://docs.canton.network/appdev/quickstart.md. To run only a local network for your own Daml code, without building the QuickStart demo, see https://docs.canton.network/sdks-tools/development-tools/localnet.md.

# Splice.DSO.AmuletPrice

> Documentation for 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](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932) | |
> | sv | [Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932) | |
> | amuletPrice | [Optional](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-prelude-optional-37153) [Decimal](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-decimal-18135) | Set to None for new svs, but defined thereafter. |
> | lastUpdatedAt | [Time](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-time-63886) | 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](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932) -> \[[Party](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-party-57932)] -> \[[ContractId](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-contractid-95282) AmuletPriceVote] -> [Update](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-da-internal-lf-update-68072) [Decimal](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-decimal-18135)

median
: \[[Decimal](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-decimal-18135)] -> [Decimal](https://docs.canton.network/appdev/reference/daml-standard-library/prelude.md#type-ghc-types-decimal-18135)

See [https://en.wikipedia.org/wiki/Median](https://en.wikipedia.org/wiki/Median)
