{"id":13632831,"url":"https://github.com/makerdao/dss","last_synced_at":"2025-05-16T06:05:25.579Z","repository":{"id":40244808,"uuid":"135169042","full_name":"makerdao/dss","owner":"makerdao","description":"Dai Stablecoin System","archived":false,"fork":false,"pushed_at":"2023-10-01T01:58:28.000Z","size":2266,"stargazers_count":764,"open_issues_count":24,"forks_count":430,"subscribers_count":49,"default_branch":"master","last_synced_at":"2025-04-08T16:01:51.460Z","etag":null,"topics":["defi","ethereum","makerdao","solidity"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/makerdao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-05-28T14:05:57.000Z","updated_at":"2025-04-08T13:24:08.000Z","dependencies_parsed_at":"2023-10-21T12:07:28.028Z","dependency_job_id":null,"html_url":"https://github.com/makerdao/dss","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/makerdao%2Fdss/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/makerdao","download_url":"https://codeload.github.com/makerdao/dss/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254478187,"owners_count":22077676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["defi","ethereum","makerdao","solidity"],"created_at":"2024-08-01T22:03:18.466Z","updated_at":"2025-05-16T06:05:25.561Z","avatar_url":"https://github.com/makerdao.png","language":"Solidity","funding_links":[],"categories":["Solidity","Projects","Projects Using Dapp"],"sub_categories":["DappTools"],"readme":"# Multi Collateral Dai\n![Build Status](https://github.com/makerdao/dss/actions/workflows/.github/workflows/tests.yaml/badge.svg?branch=master)\n\nThis repository contains the core smart contract code for Multi\nCollateral Dai. This is a high level description of the system, assuming\nfamiliarity with the basic economic mechanics as described in the\nwhitepaper.\n\n## Additional Documentation\n\n`dss` is also documented in the [wiki](https://github.com/makerdao/dss/wiki) and in [DEVELOPING.md](https://github.com/makerdao/dss/blob/master/DEVELOPING.md)\n\n## Design Considerations\n\n- Token agnostic\n  - system doesn't care about the implementation of external tokens\n  - can operate entirely independently of other systems, provided an authority assigns\n    initial collateral to users in the system and provides price data.\n\n- Verifiable\n  - designed from the bottom up to be amenable to formal verification\n  - the core cdp and balance database makes *no* external calls and\n    contains *no* precision loss (i.e. no division)\n\n- Modular\n  - multi contract core system is made to be very adaptable to changing\n    requirements.\n  - allows for implementations of e.g. auctions, liquidation, CDP risk\n    conditions, to be altered on a live system.\n  - allows for the addition of novel collateral types (e.g. whitelisting)\n\n\n## Collateral, Adapters and Wrappers\n\nCollateral is the foundation of Dai and Dai creation is not possible\nwithout it. There are many potential candidates for collateral, whether\nnative ether, ERC20 tokens, other fungible token standards like ERC777,\nnon-fungible tokens, or any number of other financial instruments.\n\nToken wrappers are one solution to the need to standardise collateral\nbehaviour in Dai. Inconsistent decimals and transfer semantics are\nreasons for wrapping. For example, the WETH token is an ERC20 wrapper\naround native ether.\n\nIn MCD, we abstract all of these different token behaviours away behind\n*Adapters*.\n\nAdapters manipulate a single core system function: `slip`, which\nmodifies user collateral balances.\n\nAdapters should be very small and well defined contracts. Adapters are\nvery powerful and should be carefully vetted by MKR holders. Some\nexamples are given in `join.sol`. Note that the adapter is the only\nconnection between a given collateral type and the concrete on-chain\ntoken that it represents.\n\nThere can be a multitude of adapters for each collateral type, for\ndifferent requirements. For example, ETH collateral could have an\nadapter for native ether and *also* for WETH.\n\n\n## The Dai Token\n\nThe fundamental state of a Dai balance is given by the balance in the\ncore (`vat.dai`, sometimes referred to as `D`).\n\nGiven this, there are a number of ways to implement the Dai that is used\noutside of the system, with different trade offs.\n\n*Fundamentally, \"Dai\" is any token that is directly fungible with the\ncore.*\n\nIn the Kovan deployment, \"Dai\" is represented by an ERC20 DSToken.\nAfter interacting with CDPs and auctions, users must `exit` from the\nsystem to gain a balance of this token, which can then be used in Oasis\netc.\n\nIt is possible to have multiple fungible Dai tokens, allowing for the\nadoption of new token standards. This needs careful consideration from a\nUX perspective, with the notion of a canonical token address becoming\nincreasingly restrictive. In the future, cross-chain communication and\nscalable sidechains will likely lead to a proliferation of multiple Dai\ntokens. Users of the core could `exit` into a Plasma sidechain, an\nEthereum shard, or a different blockchain entirely via e.g. the Cosmos\nHub.\n\n\n## Price Feeds\n\nPrice feeds are a crucial part of the Dai system. The code here assumes\nthat there are working price feeds and that their values are being\npushed to the contracts.\n\nSpecifically, the price that is required is the highest acceptable\nquantity of CDP Dai debt per unit of collateral.\n\n\n## Liquidation and Auctions\n\nAn important difference between SCD and MCD is the switch from fixed\nprice sell offs to auctions as the means of liquidating collateral.\n\nThe auctions implemented here are simple and expect liquidations to\noccur in *fixed size lots* (say 10,000 ETH).\n\n\n## Settlement\n\nAnother important difference between SCD and MCD is in the handling of\nSystem Debt. System Debt is debt that has been taken from risky CDPs.\nIn SCD this is covered by diluting the collateral pool via the PETH\nmechanism. In MCD this is covered by dilution of an external token,\nnamely MKR.\n\nAs in collateral liquidation, this dilution occurs by an auction\n(`flop`), using a fixed-size lot.\n\nIn order to reduce the collateral intensity of large CDP liquidations,\nMKR dilution is delayed by a configurable period (e.g 1 week).\n\nSimilarly, System Surplus is handled by an auction (`flap`), which sells\noff Dai surplus in return for the highest bidder in MKR.\n\n\n## Authentication\n\nThe contracts here use a very simple multi-owner authentication system,\nwhere a contract totally trusts multiple other contracts to call its\nfunctions and configure it.\n\nIt is expected that modification of this state will be via an interface\nthat is used by the Governance layer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fdss","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmakerdao%2Fdss","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmakerdao%2Fdss/lists"}