Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs #1391

Open
wants to merge 3 commits into
base: develop-combo-futarchy
Choose a base branch
from
Open

Add docs #1391

wants to merge 3 commits into from

Conversation

maltekliemann
Copy link
Contributor

What does it do?

What important points should reviewers know?

Is there something left for follow-up PRs?

What alternative implementations were considered?

Are there relevant PRs or issues?

References

@mergify mergify bot added the s:in-progress The pull requests is currently being worked on label Nov 16, 2024
Comment on lines +27 to +28
/// The oracle evaluates to `true` if and only if the `positive_outcome` is more valuable than the
/// `negative_outcome` in the liquidity pool specified by `pool_id`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be changed by audit fixes. It will then use a scoreboard.

type MinDuration: Get<BlockNumberFor<Self>>;

// The type used to define the oracle for each proposal.
/// The type used to define the oracle a proposal.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// The type used to define the oracle a proposal.
/// The type used to define the oracle for a proposal.

Comment on lines +18 to +20
The oracle evaluates positively (meaning that it will allow the proposal to
pass) if and only if the positive outcome is move valuable than the negative
outcome.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scoreboard should be described here instead (look at audit fixes).

Comment on lines +24 to +25
- A hard-coded origin (usually root) submits a proposal to be approved or
rejected via futarchy. If the origin is root, this is done by running a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The newest version just uses the root origin, not a configurable hard-coded origin anymore.

Comment on lines +36 to +38
/// If `force_max_work` parameter is set, the calculation will use up the maximum amount of work
/// necessary, independent of the other parameters. Should only be used for benchmarking
/// purposes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be changed to Fuel parameter.


In addition to splitting and merging, combinatorial tokens can be redeemed if one of the markets involved in creating them has been resolved. For example, if the `XY` market above resolves to `X`, then every unit of `X & A` redeems for a unit of `A` and `Y & A` is worthless. If the scalar market above resolves so that `Long` is valued at `.4` and `Short` at `.6`, then every unit of `Yes & Long` redeems for `.4` units of `Yes` and every unit of `Yes & Short` redeems for `.6`.

And important distinction which we've so far neglected to make is the distinction between an abstract _collection_ like `X & A` or `Yes & Short` and a concrete _position_, which is a collection together with a collateral token against which it is valued. Collections are purely abstract and used in the implementation. Positions are actual tokens on the chain.
Copy link
Member

@Chralt98 Chralt98 Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
And important distinction which we've so far neglected to make is the distinction between an abstract _collection_ like `X & A` or `Yes & Short` and a concrete _position_, which is a collection together with a collateral token against which it is valued. Collections are purely abstract and used in the implementation. Positions are actual tokens on the chain.
An important distinction which we've so far neglected to make is the distinction between an abstract _collection_ like `X & A` or `Yes & Short` and a concrete _position_, which is a collection together with a collateral token against which it is valued. Collections are purely abstract and used in the implementation. Positions are actual tokens on the chain.


And important distinction which we've so far neglected to make is the distinction between an abstract _collection_ like `X & A` or `Yes & Short` and a concrete _position_, which is a collection together with a collateral token against which it is valued. Collections are purely abstract and used in the implementation. Positions are actual tokens on the chain.

Collections and position are identified using their IDs. When using the standard combinatorial ID Manager, this ID is a 256 bit value. The position ID of a certain token can be calculated using the collection ID and the collateral.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Collections and position are identified using their IDs. When using the standard combinatorial ID Manager, this ID is a 256 bit value. The position ID of a certain token can be calculated using the collection ID and the collateral.
Collections and positions are identified using their IDs. When using the standard combinatorial ID Manager, this ID is a 256 bit value. The position ID of a certain token can be calculated using the collection ID and the collateral.


- _Combinatorial token_: Any instance of `zeitgeist_primitives::Asset::CombinatorialToken`.
- _Complete set (of a prediction market)_: An abstract set containing every outcome of a particular prediction market. One unit of a complete set is one unit of each outcome token from the market in question. After the market resolves, a complete set always redeems for exactly one unit of collateral.
- _Merge_: The prcoess of exchanging multiple tokens for a single token of equal value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- _Merge_: The prcoess of exchanging multiple tokens for a single token of equal value.
- _Merge_: The process of exchanging multiple tokens for a single token of equal value.

Comment on lines +839 to +841
/// The `force_max_work` parameter can be used to force the `CombinatorialTokensApi` to
/// spend the maximum amount of work, independently of the parameters that it is called
/// with. This is useful for benchmarking purposes and should not be used in production.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be called Fuel after the audit fixes.

///
/// # Complexity
///
/// `O(n)` where `n` is the number of splits required to create the pool.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will also depend on the Fuel parameter.

Comment on lines +224 to +225
/// The `force_max_work` parameter can be used to trigger the maximum amount of allowed work
/// for the combinatorial ID manager. Should only be used for benchmarking purposes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Fuel parameter after audit fixes.

Comment on lines +280 to +281
/// The `force_max_work` parameter can be used to trigger the maximum amount of allowed work
/// for the combinatorial ID manager. Should only be used for benchmarking purposes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Fuel parameter after audit fixes.

Comment on lines +321 to +322
/// The `force_max_work` parameter can be used to trigger the maximum amount of allowed work
/// for the combinatorial ID manager. Should only be used for benchmarking purposes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Fuel parameter after audit fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:in-progress The pull requests is currently being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants