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
70 changes: 70 additions & 0 deletions .github/workflows/auto-release-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Auto Release PR

on:
push:
branches: [develop]
workflow_dispatch:

permissions:
contents: read
pull-requests: write

concurrency:
group: auto-release-pr
cancel-in-progress: false

jobs:
create-release-pr:
name: Create Release PR
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch main branch
run: git fetch origin main

- name: Check for existing PR
id: check-pr
run: |
PR_COUNT=$(gh pr list --base main --head develop --state open --json number --jq 'length')
echo "pr_exists=$([[ $PR_COUNT -gt 0 ]] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
echo "::notice::Open PRs from develop to main: $PR_COUNT"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check for differences
id: check-diff
if: steps.check-pr.outputs.pr_exists == 'false'
run: |
DIFF_COUNT=$(git rev-list --count origin/main..origin/develop)
echo "has_changes=$([[ $DIFF_COUNT -gt 0 ]] && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
echo "commit_count=$DIFF_COUNT" >> $GITHUB_OUTPUT
echo "::notice::Commits ahead of main: $DIFF_COUNT"

- name: Create Release PR
if: steps.check-pr.outputs.pr_exists == 'false' && steps.check-diff.outputs.has_changes == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_COUNT: ${{ steps.check-diff.outputs.commit_count }}
run: |
printf '%s\n' \
"## Automatic Release PR" \
"" \
"This PR was automatically created after changes were pushed to develop." \
"" \
"**Commits:** ${COMMIT_COUNT} new commit(s)" \
"" \
"### Checklist" \
"- [ ] Review all changes" \
"- [ ] Verify CI passes" \
"- [ ] Approve and merge when ready for production" \
> /tmp/pr-body.md

gh pr create \
--base main \
--head develop \
--title "Release: develop -> main" \
--body-file /tmp/pr-body.md
1 change: 1 addition & 0 deletions src/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {

{ title: "Governance", path: "/governance" },

{ title: "Smart Contracts", path: "/smart-contracts" },

{ title: "Telegram API Bot", path: "/telegram-api-bot" },
{ title: "Disclaimer", path: "/disclaimer" },
Expand Down
1 change: 1 addition & 0 deletions src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* [Reserve](reserve.md)
* [Pool Shares](reserve/pool-shares.md)
* [Governance](governance.md)
* [Smart Contracts](smart-contracts.md)
* [Disclaimer](disclaimer.md)
* [Privacy](privacy.md)
* [Imprint](imprint.md)
Expand Down
4 changes: 3 additions & 1 deletion src/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ The purpose of this page is to provide potential users of the Decentralized Euro

## Decentralized Euro and Decentralized Euro Pool Shares (nDEPS)

The Decentralized Euro system comes with two ERC-20 tokens, a stablecoin called [Decentralized Euro](https://etherscan.io/address/0x37688530bEf38711d600Ee5773C21Cc27C49A2Aa) and a governance token called [Decentralized Euro Pool Shares (nDEPS)](https://etherscan.io/address/0x06ef81036432f64F622F635248903ADF59cc5497). Unlike other collateralized stablecoins, Decentralized Euro does not depend on external oracles, making it less susceptible to certain attacks and also more versatile with regards to the used collateral. The disadvantage of that approach is its speed, performing liquidations over the course of days whereas oracle-based systems might react within minutes.
The Decentralized Euro system comes with two ERC-20 tokens, a stablecoin called [Decentralized Euro (dEURO)](https://etherscan.io/address/0xbA3f535bbCcCcA2A154b573Ca6c5A49BAAE0a3ea) and a governance token called [Native Decentralized EURO Protocol Share (nDEPS)](https://etherscan.io/address/0xc71104001A3CCDA1BEf1177d765831Bd1bfE8eE6). Unlike other collateralized stablecoins, Decentralized Euro does not depend on external oracles, making it less susceptible to certain attacks and also more versatile with regards to the used collateral. The disadvantage of that approach is its speed, performing liquidations over the course of days whereas oracle-based systems might react within minutes.

For trading on DEXes, nDEPS can be wrapped into [DEPS](https://etherscan.io/address/0x103747924E74708139a9400e4Ab4BEA79FFFA380) via the `wrap()` / `unwrap()` functions of the DEPSWrapper contract. The wrapper exposes the same value but strips the time-weighted governance state, which keeps liquidity-pool holdings out of the voting calculation.

The Decentralized Euro is a collateralized stablecoin that tracks the value of the Euro. There is no hard peg to the Euro, but a set of economic constraints that incentivizes the market to softly push it towards parity from two sides. Most importantly, the system is [over-collateralized](positions/): for each Decentralized Euro in circulation, there must other tokens worth at least one Decentralized Euro backing it. Furthermore, nDEPS holders have a number of ways to influence the long term price of the Decentralized Euro by making it more or less expensive to mint Decentralized Euros, similarly to how a central bank keeps the exchange rate of its own currency in balance. The underlying assumption here is that the nDEPS holders recognize that the system (and therefore also their tokens) is the most valuable when the Decentralized Euro tracks the Euro as reliably a possible, and that they use their power to govern the system accordingly.

Expand Down
2 changes: 1 addition & 1 deletion src/positions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

**Documentation on minting Decentralized Euros against a collateral.**

When someone mints fresh Decentralized Euros against a collateral, we call the result a [position](https://github.com/d-EURO/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/d-EURO/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 Decentralized Euro 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 Decentralized Euros 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 to purpose of determining the market price of the collateral. Thanks to this mechanism, the Decentralized Euro does not depend on oracles and is very flexible with regards to the provided collateral.
When someone mints fresh Decentralized Euros against a collateral, we call the result a [position](https://github.com/d-EURO/smartContracts/blob/main/contracts/MintingHubV3/Position.sol). New positions are created through one of two governance-approved minting hubs ([V2](https://github.com/d-EURO/smartContracts/blob/main/contracts/MintingHubV2/MintingHubGateway.sol) or [V3](https://github.com/d-EURO/smartContracts/blob/main/contracts/MintingHubV3/MintingHub.sol)) - see [Smart Contracts](smart-contracts.md) for the full module overview. The notation is inspired by portfolio theory, where a position denotes an exposure to a specific asset. In the Decentralized Euro 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 Decentralized Euros 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 to purpose of determining the market price of the collateral. Thanks to this mechanism, the Decentralized Euro 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 Decentralized Euro against a collateral and supported in the default frontend.
2 changes: 1 addition & 1 deletion src/reserve.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ To provide you with an intuitive understanding of the balance sheet, let us look

When a position is liquidated, there are three layers of protection that kick in to protect the system from a loss: First, the borrower's reserve directly attributable to the liquidated position is used to cover the loss. If that does not suffice, the loss is taken out of equity, making the pool shares less valuable. Third, if not even that is enough, then the general borrower's reserve is tapped into. This last escalation step is a means of last resort. It implies that other users will have to pay back more than anticipated when closing their position. This gives not only the pool share holders an incentive to guard the system against losses, but also everyone who has an open position as they will suffer when a severe loss happens due to having accepted unsound collateral.

Lastly, it is worth mentioning that the system is designed such that given efficient markets, the, equity will in equilibrium be about one third of the Decentralized Euros not created through a bridge, i.e. **3e = z - x**.
Lastly, it is worth mentioning that the system is designed such that given efficient markets, the, equity will in equilibrium be about one fifth of the Decentralized Euros not created through a bridge, i.e. **5e = z - x**.



8 changes: 4 additions & 4 deletions src/reserve/pool-shares.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ In an approach inspired by the research paper "[The Continuous Capital Corporati

### Equilibrium

Consider again the example with 30 million Decentralized Euro in outstanding mints and an interest of 5%, leading to a reserve inflow of 1.5 million per year. Under these circumstances, rational market participants will value the entire pool at 30 million Decentralized Euro and therefore buy additional pool shares until the valuation hits 30 million Decentralized Euro. This valuation is reached at a reserve pool size of 10 million Decentralized Euro, leaving 20 million Decentralized Euro in circulation that can be used for other purposes.
Consider again the example with 30 million Decentralized Euro in outstanding mints and an interest of 5%, leading to a reserve inflow of 1.5 million per year. Under these circumstances, rational market participants will value the entire pool at 30 million Decentralized Euro and therefore buy additional pool shares until the valuation hits 30 million Decentralized Euro. This valuation is reached at a reserve pool size of 6 million Decentralized Euro, leaving 24 million Decentralized Euro in circulation that can be used for other purposes.

This is essentially fractional reserve banking with a reserve of one third. In contrast, the tier 1 equity capital of modern banks is usually much less than that, so the Decentralized Euro system has a considerably higher reserves. However, unlike in the traditional banking system, this reserve requirement is not strictly enforced by a regulator, but more like a carrot that attracts the equilibrium towards the reserve target.
This is essentially fractional reserve banking with a reserve of one fifth. In contrast, the tier 1 equity capital of modern banks is usually much less than that, so the Decentralized Euro system has a considerably higher reserves. However, unlike in the traditional banking system, this reserve requirement is not strictly enforced by a regulator, but more like a carrot that attracts the equilibrium towards the reserve target.

If the effective interest at which new positions can be opened is at 5% and the reserve is below the target of one third of the outstanding balance, then it is possible to do interest arbitrage by minting additional Decentralized Euro at an interest of 5% per year and using those to buy pool shares that yield maybe 6% per year. The opposite is the case if the reserve is higher than one third. In that case, minters should think about selling pool shares to repay their debt (if they are able to).
If the effective interest at which new positions can be opened is at 5% and the reserve is below the target of one fifth of the outstanding balance, then it is possible to do interest arbitrage by minting additional Decentralized Euro at an interest of 5% per year and using those to buy pool shares that yield maybe 6% per year. The opposite is the case if the reserve is higher than one fifth. In that case, minters should think about selling pool shares to repay their debt (if they are able to).

This leads to the following rule of thumb: if the nDEPS market cap is higher than the market cap of Decentralized Euro, then that means that the market participants are beeting on the system to grow. If the nDEPS market cap is lower than the Decentralized Euro market cap, then the market is signaling that it expects the Decentralized Euro system to shrink.

### Limits to Capital Efficiency

What if someone creates a clone of the Decentralized Euro system with a reserve target of 25%? Would they be able to offer a better deal thanks to a better capital efficiency? Here, one needs to be aware that there is a trade-off. It is certainly more attractive for those who mint some Decentralized Euro to buy pool shares and dump the rest of the coins onto the market. However, one needs to be aware that this implies that there is a buyer for the other 75% of the Decentralized Euro to keep the system in equilibrium. These buyers are typically users that hold Decentralized Euro for transactional purposes. And to them, stability is key. But stability suffers if one aims for an overly ambitious level of capital efficiency, making the clone less attractive for transactional purposes. It is hard to tell where exactly the right equilibrium is, but this is not a race to the bottom where the system with the lowest capital requirements automatically wins. We believe that aiming for a 20% reserve is a robust middle ground, that still allows for plenty of seignorage gains.
What if someone creates a clone of the Decentralized Euro system with a reserve target of 12.5%? Would they be able to offer a better deal thanks to a better capital efficiency? Here, one needs to be aware that there is a trade-off. It is certainly more attractive for those who mint some Decentralized Euro to buy pool shares and dump the rest of the coins onto the market. However, one needs to be aware that this implies that there is a buyer for the other 87.5% of the Decentralized Euro to keep the system in equilibrium. These buyers are typically users that hold Decentralized Euro for transactional purposes. And to them, stability is key. But stability suffers if one aims for an overly ambitious level of capital efficiency, making the clone less attractive for transactional purposes. It is hard to tell where exactly the right equilibrium is, but this is not a race to the bottom where the system with the lowest capital requirements automatically wins. We believe that aiming for a 20% reserve is a robust middle ground, that still allows for plenty of seignorage gains.
Loading
Loading