Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ module.exports = {
["meta", { name: "twitter:title", content: "JuiceDollar (JUSD) Documentation" }],
["meta", { name: "twitter:description", content: "JuiceDollar (JUSD) - A decentralized, over-collateralized stablecoin on Citrea. No oracles, no admin keys, fully permissionless." }],
["meta", { name: "twitter:image", content: "https://docs.juicedollar.com/assets/logo.png" }],
// Weglot
[ "script", { type: "text/javascript", src: "https://cdn.weglot.com/weglot.min.js" }, ],
[
"script",
{},
`Weglot.initialize({
api_key: 'wg_3fa7772719c0808c3a058c58e13b59890'
});
`,
],
],

themeConfig: {
Expand Down
Binary file modified src/.vuepress/public/assets/adjust-position.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/.vuepress/public/assets/arch.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/.vuepress/public/assets/clone-list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/.vuepress/public/assets/clone-position.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/.vuepress/public/assets/collateral.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/.vuepress/public/assets/financial-terms.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/.vuepress/public/assets/liquidation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/.vuepress/public/assets/new-position-button.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/.vuepress/public/assets/proposal-process.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/.vuepress/public/assets/reserve.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 2 additions & 12 deletions src/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Structure and Purpose

The purpose of this page is to provide potential users of the JuiceDollar system with everything they need to know to meaningfully interact with it. For actually interacting with the system, there is a standard [frontend](https://app.juicedollar.com/). The name JuiceDollar hints at its self-governing nature, but also the risks associated with releasing an artificial machinery into the wild. If you encounter errors or if things are not clear to you, you can [file a suggestion for improving this page on GitHub](https://github.com/JuiceDollar/smartContracts/issues).
The purpose of this page is to provide potential users of the JuiceDollar system with everything they need to know to meaningfully interact with it. For actually interacting with the system, there is a standard [frontend](https://bapp.juicedollar.com/). The name JuiceDollar hints at its self-governing nature, but also the risks associated with releasing an artificial machinery into the wild. If you encounter errors or if things are not clear to you, you can [file a suggestion for improving this page on GitHub](https://github.com/JuiceDollar/smartContracts/issues).

## The Cypherpunk Heritage

Expand Down Expand Up @@ -65,18 +65,8 @@ JUSD can also be minted 1:1 against trusted external stablecoins through [bridge
| **USDC** | [`0x920DB0aDf6fEe2D69401e9f68D60319177dCa20F`](https://citreascan.com/address/0x920DB0aDf6fEe2D69401e9f68D60319177dCa20F) |
| **USDT** | [`0x5CC0e668F8BA61E111B6168E19d17d3C65040614`](https://citreascan.com/address/0x5CC0e668F8BA61E111B6168E19d17d3C65040614) |
| **CTUSD** | [`0x8D11020286aF9ecf7E5D7bD79699c391b224a0bd`](https://citreascan.com/address/0x8D11020286aF9ecf7E5D7bD79699c391b224a0bd) |
| **StartUSD** | [`0x51ff8141D731676Fb21aE1E5D5A88c04511994dD`](https://citreascan.com/address/0x51ff8141D731676Fb21aE1E5D5A88c04511994dD) |

Bridge volume is limited and time-restricted to minimize risk from external stablecoin failures.

### Bootstrap Phase (Temporary)

::: warning
During the initial 6-week bootstrap phase, JUSD can also be minted via the StartUSD bridge. StartUSD has no intrinsic value - it exists solely to initialize the system. After 6 weeks, this bridge expires permanently and all JUSD will be backed only by real collateral and audited stablecoins.

See [StartUSD Bridge](swap.md#startusd-bridge) for full details.
:::

### The Role of JUICE

JUICE holders provide an additional safety buffer. If liquidations result in bad debt, JUICE holders absorb the loss. This makes JUICE similar to bank equity - profitable in good times, but first in line to take losses.
Expand All @@ -99,5 +89,5 @@ Anyone can mint new JuiceDollars against a collateral using the built-in borrowi

## Technical Architecture

The JuiceDollar system consists of a set of smart contracts on Citrea. The two token contracts serve as a foundation for everything else. JuiceDollar can have an arbitrary number of contracts that have the power to mint and burn JUSD. Anyone can propose new such contracts and once they passed the governance process, they can start minting and burning JuiceDollar. Today, there are two such contracts. One is a simple bridge to bootstrap JuiceDollar based on StartUSD. The other is a contract named minting hub that serves as the central point to manage all debt positions. The JUICE token has built-in governance features and holds the equity capital of the system.
The JuiceDollar system consists of a set of smart contracts on Citrea. The two token contracts serve as a foundation for everything else. JuiceDollar can have an arbitrary number of contracts that have the power to mint and burn JUSD. Anyone can propose new such contracts and once they passed the governance process, they can start minting and burning JuiceDollar. The main contracts are the stablecoin bridges that peg JUSD 1:1 to other stablecoins, and the minting hub that serves as the central point to manage all debt positions. The JUICE token has built-in governance features and holds the equity capital of the system.
<figure style="text-align: center"><img src="/assets/arch.jpeg" alt=""><figcaption><p>Technical Architecture</p></figcaption></figure>
4 changes: 2 additions & 2 deletions src/positions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

**Documentation on minting JuiceDollars against a collateral.**

When someone mints fresh JuiceDollars against a collateral, we call the result a [position](https://github.com/JuiceDollar/smartContracts/blob/main/contracts/MintingHubV2/Position.sol). At the time of writing, the only smart contract that is approved to create new positions is the [minting hub](https://github.com/JuiceDollar/smartContracts/blob/main/contracts/MintingHubV2/MintingHub.sol). The notation is inspired by portfolio theory, where a position denotes an exposure to a specific asset. In the JuiceDollar system, a position always belongs to exactly one owner. Initially, this is the user that created the position, but ownership is transferrable through the standard functions of Ownable contracts. The owner can deposit collateral into the position and mint JuiceDollars up to a certain limit defined by the liquidation price. Anyone can challenge a position if they believe that the liquidation price is below the true value of the collateral, triggering an auction that serves the purpose of determining the market price of the collateral. Thanks to this mechanism, JuiceDollar does not depend on oracles and is very flexible with regards to the provided collateral.
When someone mints fresh JuiceDollars against a collateral, we call the result a [position](https://github.com/JuiceDollar/smartContracts/blob/main/contracts/MintingHubV3/Position.sol). At the time of writing, the only smart contract that is approved to create new positions is the [minting hub](https://github.com/JuiceDollar/smartContracts/blob/main/contracts/MintingHubV3/MintingHub.sol). The notation is inspired by portfolio theory, where a position denotes an exposure to a specific asset. In the JuiceDollar system, a position always belongs to exactly one owner. Initially, this is the user that created the position, but ownership is transferrable through the standard functions of Ownable contracts. The owner can deposit collateral into the position and mint JuiceDollars up to a certain limit defined by the liquidation price. Anyone can challenge a position if they believe that the liquidation price is below the true value of the collateral, triggering an auction that serves the purpose of determining the market price of the collateral. Thanks to this mechanism, JuiceDollar does not depend on oracles and is very flexible with regards to the provided collateral.

There are two ways to initiate a position: one can either create a completely new one with arbitrary parameters or one can clone an existing position. The former is for advanced users and not exposed in the default frontend. The latter is the faster way of obtaining JuiceDollar against a collateral and supported in the default frontend.
To get started, open [Lending](https://bapp.juicedollar.com/mint) and clone an existing cloneable type (including the app's default collateral), or pick a parent from [Monitoring](https://bapp.juicedollar.com/monitoring). If you need a new collateral type that is not yet listed, use [Propose position](https://bapp.juicedollar.com/mint/create). See [Opening New Positions](positions/open.md) for the full walkthrough.
2 changes: 1 addition & 1 deletion src/positions/adjust.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**How to adjust a position**

Once you are the proud owner of a position whose cooldown period has passed, you can start to adjust it. You can adjust the outstanding amount, the amount of the deposited collateral, and the liquidation price. Every input field has a magic wand button that automatically sets the value to whatever makes most sense given the other two values.
Once you are the proud owner of a position, you can start to adjust it. You can adjust the outstanding amount, the amount of the deposited collateral, and the liquidation price. Where the app offers it, a Max button fills the field to the largest allowed value for the current constraints. The liquidation price is tuned with a slider rather than the same Max pattern used for loan or collateral amounts.

The following rules apply:

Expand Down
2 changes: 1 addition & 1 deletion src/positions/clone.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This is the standard way to obtain JuiceDollars against a collateral. Unlike cre
<figure style="text-align: center"><img src="/assets/clone-list.png" alt=""><figcaption><p>Existing positions</p></figcaption></figure>


When selecting a position on the position overview, you get to see its detail view which shows all the relevant parameters. If you are interested in borrowing JuiceDollars and you think the terms are reasonable, you can proceed by clicking "borrow", which leads you to the borrow page.
When selecting a position on the position overview (Monitoring), you get to see its detail view with all the relevant parameters. If you want to mint against that position type and you are not the owner, click Clone — that opens the Borrow page with that parent position pre-selected. If you are the owner, use Manage to open your position’s adjustment hub instead of cloning.

<figure style="text-align: center"><img src="/assets/clone-position.png" alt=""><figcaption><p>Position details</p></figcaption></figure>

Expand Down
26 changes: 20 additions & 6 deletions src/positions/open.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,26 @@
# Opening New Positions

You want to mint JuiceDollar, but your preferred type of collateral is not available yet? In that case, you can propose a new collateral type.
## Start on Lending

To do so, head over to the [Mint page](https://app.juicedollar.com/mint) and scroll to the bottom until you find the "Propose New Position or Collateral" button.
To open a new position as a borrower, start on [Lending](https://bapp.juicedollar.com/mint) in the app.

<figure style="text-align: center"><img src="/assets/new-position-button.png" alt="" width="350"><figcaption><p>Click this button to propose a new position type</p></figcaption></figure>
There you mint JUSD by cloning an existing cloneable position type. On [Lending](https://bapp.juicedollar.com/mint) the app pre-selects the best cloneable parent from the API.

On the next page are four boxes. Let's take a look at the box in the top left.
<figure style="text-align: center"><img src="/assets/clone-position.png" alt=""><figcaption><p>Lending: cloneable positions and API-selected clone parent</p></figcaption></figure>

If you open Position from Monitoring with Clone, that parent overrides the pre-selection. That lets you start without a custom proposal when a suitable cloneable type already exists. You select how much collateral to post, set liquidation price and expiration, and confirm when the amounts look right—one transaction creates your position and moves collateral.

For choosing a different listed parent from the ecosystem, open [Monitoring](https://bapp.juicedollar.com/monitoring) and Clone, as described in [Cloning existing positions](clone.md).

<figure style="text-align: center"><img src="/assets/clone-list.png" alt=""><figcaption><p>Open positions available for cloning</p></figcaption></figure>

## Proposing a new position type

Open [Propose position](https://bapp.juicedollar.com/mint/create) This URL is not linked from the main Lending screen; When you submit the form, use the Propose Position button at the bottom of the page.

<figure style="text-align: center"><img src="/assets/new-position-button.png" alt="" width="350"><figcaption><p>Propose position page</p></figcaption></figure>

On that page the form is grouped into four areas. Let's take a look at the box in the top left.

<figure style="text-align: center"><img src="/assets/proposal-process.png" alt=""><figcaption><p>Proposal process</p></figcaption></figure>

Expand Down Expand Up @@ -38,6 +52,6 @@ The "Retained Reserve" should be set to ensure a very high confidence that chall

The last field, the "Auction Duration", describes how long an auction should be. For highly liquid collaterals such as cBTC, the challenge duration can be quite short, possibly ranging from hours to even minutes, especially with automated bidders in the market. For less liquid collaterals that are harder to evaluate, challenges might last up to two weeks to allow bidders to organize. The longer the challenge duration, the higher the required reserve should be to ensure the position remains economically sound.

Once all parameters are set, you can hit the "Propose Position" at the bottom of the page.
Once all parameters are set, confirm with Propose Position at the bottom of the page.

If there's no veto within the initialization process, you will have successfully opened a new position! After that, you can head over to the [My Positions page](https://app.juicedollar.com/mypositions) and mint your new JuiceDollar.
If there's no veto within the initialization process, you will have successfully opened a new position! After that, you can head over to the [My Positions page](https://bapp.juicedollar.com/mypositions) and mint your new JuiceDollar.
2 changes: 1 addition & 1 deletion src/reserve.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ If the JuiceDollar system was a company, its balance sheet would roughly look as

To provide you with an intuitive understanding of the balance sheet, let us look at what happens in three example scenarios:

1. If a user sends 100 JUSD to the stablecoin bridge to swap them into StartUSD, the balance sheet items **x** and **z** are both reduced by 100 units of that currency. The other balance positions are unaffected.
1. If a user sends 100 JUSD to a stablecoin bridge to swap them into another stablecoin (e.g., USDC), the balance sheet items **x** and **z** are both reduced by 100 units of that currency. The other balance positions are unaffected.
2. If a user mints 500 JUSD against a collateral with a reserve ratio of 20% and a fee of 5%, the following will happen on the active side: **m** will increase by 500 (because that is how much they need to repay) and **r** will increase by 125 (because that is how much they put into the borrowers reserves and paid in fees). On the passive side, **z** will increase by 500 (because that is how much is being minted), **b** will increase by 100 (because that is how much the system needs to return to the user when the position is repaid), and equity **e** will increase by 25, as the fee is never returned and now belongs to the JuiceDollar system. So in this case, minting 500 JUSD counter-intuitively expands the balance sheet by more than that, namely 625 JUSD. The collateral provided by the user is outside the balance sheet and does not appear here. Even though it is locked, it still belongs to the user.
3. A position that was used to mint 5,000 JUSD is successfully challenged, with the highest bid being 4,500 JUSD. To be able to repay everything, the system will take 600 JUSD out of the reserve, decreasing **r** by 600. Out of the 5,100 JUSD we get as a result, 5,000 JUSD are used to repay the loan, reducing both **m** and **z** by 5,000 each. The remaining 100 JUSD are sent to the challenger as a reward. Assuming that the borrower's reserve attributable to that position was 1,000 JUSD, there are 400 JUSD remaining that can be reassigned from **b** to equity **e** on the passive side. These 400 JUSD are the liquidation profits the system made in this example.

Expand Down
2 changes: 1 addition & 1 deletion src/savings.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The Leadrate uses a "ticks" system for precise interest calculation:

To start earning interest:

1. Navigate to the Savings page on the [JuiceDollar app](https://app.juicedollar.com)
1. Navigate to the Savings page on the [JuiceDollar app](https://bapp.juicedollar.com)
2. Enter the amount of JUSD you want to deposit
3. Approve the transaction
4. Your JUSD immediately starts earning interest
Expand Down
Loading
Loading