Skip to content

Commit

Permalink
feat: renames images, adds alt, links, data
Browse files Browse the repository at this point in the history
  • Loading branch information
R-K-H committed Sep 7, 2024
1 parent 0609605 commit f1b642a
Show file tree
Hide file tree
Showing 21 changed files with 170 additions and 49 deletions.
File renamed without changes
File renamed without changes
File renamed without changes
Binary file removed docs/.gitbook/assets/conditional-vaults (1).png
Binary file not shown.
Binary file added docs/.gitbook/assets/metadao-og-image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
5 changes: 4 additions & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

* [Discord](https://discord.gg/metadao)
* [X](https://x.com/MetaDAOProject)
* [Blog](https://blog.themetadao.org/)
* [Blog](https://blog.metadao.fi/)
* [GitHub](https://github.com/metaDAOproject)
* [Whitepaper](https://github.com/metaDAOproject/Manifesto/blob/main/Manifesto.pdf)
* [Linkedin](https://linkedin.com/company/metadaoproject)
* [WellFound](https://wellfound.com/company/metadao)
* [YouTube](https://www.youtube.com/@metaDAOproject)
12 changes: 12 additions & 0 deletions docs/book.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"plugins": [
"open-graph"
],
"pluginsConfig": {
"open-graph": {
"baseURL": "https://docs.metadao.fi",
"defaultDescription": "Explore MetaDAO's documentation to learn about futarchy, a revolutionary decision-making system. Discover how MetaDAO implements market-based governance to solve traditional voting problems.",
"defaultImage": ".gitbook/assets/metadao-og-image.jpg"
}
}
}
4 changes: 2 additions & 2 deletions docs/implementation/price-oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ For futarchy to work, you need a way of extracting the price of a proposal's con

The naive approach is to just use the spot price at the time of proposal finalization. But this is highly manipulable. For example, someone could pump the price of the pass market right before finalization in order to force the proposal to pass.

<figure><img src="../.gitbook/assets/conditional-markets(3).png" alt=""><figcaption><p>Someone could bid up the pass price in the last minute to force a proposal through</p></figcaption></figure>
<figure><img src="../.gitbook/assets/conditional-markets-dark.png" alt=""><figcaption><p>Someone could bid up the pass price in the last minute to force a proposal through</p></figcaption></figure>

### TWAP

Expand All @@ -16,7 +16,7 @@ However, TWAPs also have their flaws. Importantly, Solana validators can manipul

We deal with this by using a special form of TWAP we call a lagging price TWAP. In a lagging price TWAP, the number that gets fed into the TWAP isn't the raw price - it's a number that tries to approximate the price but which can only move a certain amount per update. We call this an _observation_. Each DAO must configure the _first observation_ and _max observation change per update_ that get used in its proposals' markets.

<figure><img src="../.gitbook/assets/image.png" alt=""><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/twap-chart.png" alt=""><figcaption></figcaption></figure>

To take an example, imagine that MetaDAO's first observation is set to $500 and its max change per update is $5. If a proposal opens with a pass market of $550, it will take 10 updates before the observation accurately reflects the price. Assuming each update is spaced evenly and the price stays at $550, the TWAP after 10 updates will be $527.5 (\[$505 + $510 + $515 + $520 + $525 + $530 + $535 + $540 + $545 + $550] / 10). After 10 more updates, it will be $538.75.

Expand Down
16 changes: 8 additions & 8 deletions docs/implementation/program-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,45 @@ Blockchains like Solana don't allow you to revert transactions after they've bee

Conditional tokens are tied to _conditional vaults_. Each conditional vault has a specific _underlying token, settlement authority,_ and _proposal_. In the case of futarchy, the underlying token would be either USDC or the DAO's token, the settlement authority would be the DAO's treasury, and the proposal would be a proposal to the DAO.

<figure><img src="../.gitbook/assets/conditional-vaults.png" alt="" width="563"><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/conditional-vaults.png" alt="Conditional Vault Program" width="563"><figcaption></figcaption></figure>

Once a vault is created, anyone can deposit underlying tokens in exchange for conditional tokens. You receive two types of conditional tokens: ones that are redeemable for underlying tokens if the vault is finalized and ones that are redeemable for underlying tokens if the vault is reverted. For example, if you deposit 10 USDC into a vault, you will receive 10 conditional-on-finalize USDC and 10 conditional-on-revert USDC.

<figure><img src="../.gitbook/assets/image (1) (1).png" alt="" width="563"><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/conditional-vault-quote.png" alt="Conditional Vault Quote Asset Interaction" width="563"><figcaption></figcaption></figure>

The settlement authority can either _finalize_ or _revert_ a vault.

If the settlement authority finalizes a vault, users can redeem their conditional-on-finalize tokens for underlying tokens. Conversely, if the settlement authority reverts a vault, users can redeem their conditional-on-revert tokens for underlying tokens.

<figure><img src="../.gitbook/assets/image (1) (1) (1).png" alt="" width="563"><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/settled-market-conditional-vault.png" alt="Conditional Vault Settlement" width="563"><figcaption></figcaption></figure>

There are two vaults for each proposal: a base vault and a quote vault. The base vault uses the DAO's token as the underlying token, and the quote vault uses USDC as the underlying token. For example, MetaDAO proposals have vaults for META and USDC.

If the proposal passes, both vaults are finalized. If it fails, both are reverted.

<figure><img src="../.gitbook/assets/image (2).png" alt="" width="563"><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/conditional-vault-underlying.png" alt="Conditional Vault Underlying Asset Interaction" width="563"><figcaption></figcaption></figure>

This allows us to achieve the desired reverting of trades. For example, if someone mints conditional-on-pass META and trades it for conditional-on-pass USDC, either the proposal will pass and they can redeem conditional-on-pass USDC for USDC or the proposal will fail and they can redeem their conditional-on-fail META for their original META.

So we create two markets per proposal: one where conditional-on-pass META is traded for conditional-on-pass USDC and one where conditional-on-fail META is traded for conditional-on-fail USDC. This allows traders to express opinions like “this token would be worth $112 if the proposal passes, but it’s only worth $105 if the proposal fails.”

<figure><img src="../.gitbook/assets/conditional-markets(1).png" alt="" width="475"><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/conditional-markets-interaction.png" alt="Layout Of Conditional Markets Interactions" width="475"><figcaption></figcaption></figure>

### AMM <a href="#conditional-vault-program" id="conditional-vault-program"></a>
### AMM <a href="#amm" id="amm"></a>

Decision markets are facilitated through a constant-product AMM.&#x20;

Importantly, this AMM provides an on-chain time-weighted average price (TWAP) oracle that can be used by autocrat to determine when to pass or fail proposals. The oracle follows the same design as [Uniswap V2](https://docs.uniswap.org/contracts/v2/concepts/core-concepts/oracles), and uses several additional mechanisms to ensure manipulation-resistance.

### Autocrat <a href="#conditional-vault-program" id="conditional-vault-program"></a>
### Autocrat <a href="#autocrat" id="autocrat"></a>

The last piece of the puzzle is _autocrat_, the program that orchestrates futarchy.

Anyone can interact with autocrat to create a _proposal_, which contains fields such as a proposal number, proposal description link, and an executable Solana Virtual Machine (SVM) instruction. For example, someone could create a proposal to transfer 150,000 USDC to a development team to improve a product that’s managed by a DAO.

The requisite conditional vaults and markets are created at the same time.

<figure><img src="../.gitbook/assets/image (1).png" alt="" width="563"><figcaption></figcaption></figure>
<figure><img src="../.gitbook/assets/autocrat-markets.png" alt="The Program Structure For Autocrat" width="563"><figcaption></figcaption></figure>

After a configurable amount of time (3 days by default), anyone can trigger proposal finalization. In finalization, autocrat checks if the TWAP of the pass market is x% higher than the TWAP of the fail market, where x is a DAO-configured threshold.

Expand Down
17 changes: 16 additions & 1 deletion docs/using-the-platform/creating-proposals.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Creating Proposals

TODO
[Introduction To MetaDAO](https://blog.metadao.fi/a-futards-guide-to-the-meta-dao-7a6b8d66443a)

[Explainer Blog Post](https://blog.metadao.fi/so-you-want-to-raise-a-proposal-2d83304c0b9d)

Business projects are how MetaDAO converts financial capital into revenue-generating products. Business direct actions operate over those products, tweaking parameters in the pursuit of customer satisfaction and profitability. Operations projects and direct actions support the business, ensuring that MetaDAO has the right people and resources to create new products and manage existing ones.

Each of these four proposal types has its own template. These are listed here:

- [Business project](proposal-templates/business-project.md)
- [Business direct action](proposal-templates/business-direct-action.md)
- [Operations project](proposal-templates/operations-project.md)
- [Operations direct action](proposal-templates/operations-direct-action.md)

Project proposals should generally be raised by entrepreneurs who are accountable to the DAO for their execution. Direct action proposals can be raised by anyone.

You can use any document app you want to create proposals.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Business Direct Action Template

This is the template you can use for creating business direct action proposals. Just delete this part at the top.

# Proposal x - INSERT NAME HERE

## Overview

A brief description of this proposal. Cover why it's good for the Meta-DAO.

## Financial projections

If you can, cover how this is projected to affect the cash flows and enterprise value of the Meta-DAO.
25 changes: 25 additions & 0 deletions docs/using-the-platform/proposal-templates/business-project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Business Project Template

This is the template you can use for creating business project proposals. Just delete this part at the top.

# Proposal x - INSERT NAME HERE

**Entrepreneur(s):** insert name(s) here

## Overview

Insert a brief description of the product being built. Be sure to touch on the following:
- Who the target customer is
- What problem the product would solve for them
- How the product would monetize
- What the key metrics would be (e.g., DAUs, MRR, TVL, volume, etc.)

Also insert a very brief (1-2 sentence) description of how this project relates to the Meta-DAO's business:
- How much value this could create for the Meta-DAO
- An estimated budget

## Problem

Talk about what problem the target customer is currently facing. You can prove that this is a problem for the customer in a few different ways:
- Citing customers complaining (e.g., publicly on Twitter / in DMs)
- Showing that customers are using other products to solve this problem (in hopefully a worse way t
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Operations Direct Action Template

This is the template you can use for creating operations direct action proposals. Just delete this part at the top.

# Proposal x - INSERT NAME HERE

#### Type

Operations Direct Action

#### Author(s)

{name #1}, {name #2}

## Overview

A brief description of this proposal. Cover why it's good for the Meta-DAO. If the Meta-DAO has previously committed to taking this action, link that committment (e.g., a transaction signature of a passed proposal).
33 changes: 33 additions & 0 deletions docs/using-the-platform/proposal-templates/operations-project.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Operations Project Template

This is the template you can use for creating operations project proposals. Just delete this part at the top.

# Proposal x - INSERT NAME HERE

#### Type

Operations project

#### Entrepreneur(s)

insert name(s) here

## Overview

Insert a brief description of the project. Be sure to touch on the following:
- What problem the Meta-DAO is currently facing or what metric this project is supposed to improve
- What this project would do to address the issue or improve the metrics
- What metrics others can use to measure success

Also insert a very brief (1-2 sentence) description of how this project relates to the Meta-DAO's business:
- How much value this could create for the Meta-DAO, if applicable
- An estimated budget

## Focus area

Talk about what problem this project is intended to address or what metrics this project should improve.

## Project

Describe in 1-3 paragraphs what the project would consist of and why it would improve the relevant metrics.

77 changes: 40 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
{
"scripts": {
"lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
},
"dependencies": {
"@coral-xyz/anchor": "0.29.0",
"@metaplex-foundation/mpl-token-metadata": "^3.2.0",
"@metaplex-foundation/umi": "^0.9.1",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.1",
"@metaplex-foundation/umi-uploader-bundlr": "^0.9.1",
"@noble/ed25519": "^2.0.0",
"@noble/secp256k1": "^2.0.0",
"@openbook-dex/openbook-v2": "0.1.7",
"@solana/spl-token": "^0.3.7",
"@solana/web3.js": "^1.90.0",
"@sqds/multisig": "^2.0.0",
"anchor-bankrun": "^0.3.0",
"arweave": "^1.14.4",
"solana-bankrun": "^0.3.0",
"spl-token-bankrun": "0.2.5",
"@metadaoproject/futarchy": "0.3.0-alpha.8"
},
"devDependencies": {
"@mercurial-finance/dynamic-amm-sdk": "^0.4.19",
"@solana/spl-memo": "^0.2.3",
"@solana/spl-token-registry": "^0.2.4574",
"@types/bn.js": "^5.1.0",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"@types/node": "^20.8.6",
"chai": "^4.3.4",
"mocha": "^9.0.3",
"prettier": "^2.6.2",
"ts-mocha": "^10.0.0",
"tsx": "^4.7.1",
"typescript": "^4.3.5"
}
"scripts": {
"lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
},
"dependencies": {
"@coral-xyz/anchor": "0.29.0",
"@metadaoproject/futarchy": "0.3.0-alpha.8",
"@metaplex-foundation/mpl-token-metadata": "^3.2.0",
"@metaplex-foundation/umi": "^0.9.1",
"@metaplex-foundation/umi-bundle-defaults": "^0.9.1",
"@metaplex-foundation/umi-uploader-bundlr": "^0.9.1",
"@noble/ed25519": "^2.0.0",
"@noble/secp256k1": "^2.0.0",
"@openbook-dex/openbook-v2": "0.1.7",
"@solana/spl-token": "^0.3.7",
"@solana/web3.js": "^1.90.0",
"@sqds/multisig": "^2.0.0",
"anchor-bankrun": "^0.3.0",
"arweave": "^1.14.4",
"gitbook": "^2.6.9",
"gitbook-cli": "^2.3.2",
"gitbook-plugin-open-graph": "^0.0.1",
"solana-bankrun": "^0.3.0",
"spl-token-bankrun": "0.2.5"
},
"devDependencies": {
"@mercurial-finance/dynamic-amm-sdk": "^0.4.19",
"@solana/spl-memo": "^0.2.3",
"@solana/spl-token-registry": "^0.2.4574",
"@types/bn.js": "^5.1.0",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"@types/node": "^20.8.6",
"chai": "^4.3.4",
"mocha": "^9.0.3",
"prettier": "^2.6.2",
"ts-mocha": "^10.0.0",
"tsx": "^4.7.1",
"typescript": "^4.3.5"
}
}

0 comments on commit f1b642a

Please sign in to comment.