Giter Site home page Giter Site logo

nightmnare / arkadiko Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arkadiko-dao/arkadiko

0.0 0.0 0.0 15.63 MB

Arkadiko implements a stablecoin (USDA) and governance token (DIKO) on Stacks

License: GNU General Public License v3.0

Shell 0.02% JavaScript 8.40% Ruby 2.57% TypeScript 55.31% CSS 0.13% HTML 0.04% Clarity 33.53%

arkadiko's Introduction

Arkadiko

https://www.arkadiko.finance/

Arkadiko implements a stablecoin soft-pegged to 1 USD called USDA and a Governance Token DIKO that create the foundational primitives for a lending/borrowing platform.

The Arkadiko protocol trustlessly provides stable loans backed by Stacks Tokens (STX), known as USDA. In order to mint USDA, you need to over-collateralise Stacks (STX) tokens into an Arkadiko Stacks Vault. In other words, USDA is a stablecoin, existing to maintain relative price stability in volatile markets. People repay their loans by returning USDA plus a little more to cover the fixed interest on the loan (called the stability fee). The loan can be paid back anytime, as there is no repayment schedule. The protocol enforces the price by selling off a person's STX if its total value falls below 150 percent (liquidation ratio) of however much STX the user borrowed. All STX will be sold through auctions to stackers who are registered with the protocol.

No more and no less USDA exist in the world than loans made in it at that time. Every single USDA is some piece of someone’s STX, locked up on the Arkadiko protocol until the person who put in their STX pays the USDA back. When USDA goes into the system to repay a loan, it just gets burnt and disappears forever. Only the interest (i.e. stability fee) remains for Arkadiko to use to reward DIKO holders or cover expenses for the protocol.

When STX are posted as collateral to mint stablecoins, the STX tokens will automatically be used to stack natively on the Stacks protocol (either autonomously or through a delegation pool).

For more information, please read our documentation.

Architecture

A high-level architecture would look as follows:

Architecture

USDA: Arkadiko Stablecoin

Whenever new USDA is minted, debt (as collateral) is created in the network. With every type of collateral (in principle only $STX will be accepted as collateral), a set of Risk parameters will be decided on by the community. These parameters can be voted on through the DIKO governance token. Each token has 1 vote.

Stablecoin Risk Parameters

  • Debt​ ​Ceiling:​ A Debt Ceiling is the maximum amount of debt that can be created by a single collateral type. Arkadiko Governance assigns every collateral type a Debt Ceiling, which is used to ensure sufficient diversification of the Arkadiko Protocol collateral portfolio. Once a collateral type has reached its Debt Ceiling, it becomes impossible to create more debt unless some existing users pay back all or a portion of their Reserve debt.

  • Stability​ ​Fee:​ The Stability Fee is an annual percentage yield calculated on top of how much USDA has been generated against a Reserve's collateral. The fee is paid in $STX, and then sent into the Arkadiko Buffer.

  • Liquidation​ ​Ratio:​ ​A low Liquidation Ratio means Arkadiko Governance expects low price volatility of the collateral; a high Liquidation Ratio means high volatility is expected.

  • Liquidation Penalty:​ The Liquidation Penalty is a fee added to a Reserve's total outstanding generated USDA when a Liquidation occurs. The Liquidation Penalty is used to encourage USDA owners to keep appropriate collateral levels.

Arkadiko Governance Token

The DIKO governance token is used to manage and vote on proposals put forward by the community.

  • Add a​ ​new​ ​collateral asset ​type with a unique set of Risk Parameters.
  • Change the Risk Parameters of one or more existing collateral asset types
  • Set the percentage threshold to distribute BTC earnings
  • Trigger Emergency Shutdown
  • Regulate Stacks stacking & payouts

Roadmap

See https://trello.com/b/Qem9bJZK/public-roadmap

Tests and Mocking

All tests are written using Clarinet, in the tests folder.

Some of the smart contracts (such as PoX and fungible token trait) are mocked contracts/traits. These should not be deployed to mainnet when a production-ready version is ready to be deployed.

Error Handling

All errors thrown by the smart contracts are unsigned integers. The format used is the following <SMART_CONTRACT_PREFIX><ERROR_CODE>, where the smart contract prefix is denoted as follows:

1 - arkadiko-token
2 - auction-engine
3 - dao
4 - freddie
5 - liquidator
6 - 
7 - 
8 - oracle
9 - sip10-reserve
11 - stx-reserve
12 - 
13 - xstx-token
14 - usda-token
16 - diko-staker
17 - collateral-types
18 - 
19 - stacker
20 - swap
21 - swap-token-diko-usda

arkadiko's People

Contributors

philiphacks avatar macxim avatar nieldeckx avatar lgalabru avatar moodmosaic avatar bitnym avatar namelessperson0 avatar dmitriyshx avatar friedger avatar hstove avatar bosstweed11 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.