# Welcome to UWU Protocol

{% hint style="danger" %}
UWU Protocol is currently in development and the information provided in this documentation is subject to change. For the latest updates, please join our [Discord community](http://chat.uwu.cash)
{% endhint %}

<figure><img src="https://3713349138-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FroOrn6zYiOQTjjSXYv0c%2Fuploads%2F1L6TnrNdETNjMPwOhDT8%2Fuwu-banner-one.png?alt=media&amp;token=6d81d3aa-8354-428f-aad9-38edb8b1f468" alt=""><figcaption><p>Welcome to UWUTopia, anon. • Image credit: @NickoleNFT</p></figcaption></figure>

UWU Protocol is a stablecoin protocol built on [Stacks](https://stacks.co) that offers zero-interest loans with no repayment date. Users can deposit STX as collateral and borrow up to 66% of the dollar value of their deposit in the form of UWU Cash (UWU), the fully-backed and unstoppable stablecoin of UWU Protocol.

## Sections

* [**Introduction:**](/) An overview of the documentation and the problems that stablecoins face
* [**UWU Protocol:**](/uwu-protocol/overview) An in-depth look at UWU Protocol, including its features and benefits
* [**Protocol Tokens:**](/protocol-tokens/uwu-cash-uwu) An overview of the tokens issued by UWU Protocol
* [**Optional Services:**](/optional-services/stability-module) An overview of non-fundamental services that enhance UWU Protocol
* [**Developers:**](/developers/contracts-api) Documentation for developers interested in building on UWU Protocol
* [**Resources:**](/resources/faq) A collection of helpful resources pertaining to UWU Protocol

## Useful Links

* **Homepage:** <https://uwu.cash>
* **Web App:** [https://app.uwu.cash](https://app.uwu.cash/)
* **Real-time Analytics:** [https://analytics.uwu.cash](https://analytics.uwu.cash/)
* **Historical Analytics:** <http://grafana.uwu.cash>
* **X:** <https://x.com/uwuprotocol>
* **Discord:** <http://chat.uwu.cash>
* **GitHub:** <https://github.com/uwuprotocol>


# Stablecoins are Broken

This section only pertains to decentralized stablecoins that are backed by a collateralized basket of crypto assets, rather than those that are centrally issued or algorithmic.

## Complexity in Protocol Design

<div align="center"><figure><img src="https://3475401041-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LtJ1VeNJVW-jiKH0xoL%2Fuploads%2Fuu2gnwI8XK0MXMGImPgD%2FMCD%20System%202.1.png?alt=media&#x26;token=a7898b0e-71a3-460b-a6e9-6b95b40d66f6" alt=""><figcaption><p>The Maker Protocol System Diagram • Image credit: <a href="https://docs.makerdao.com/">https://docs.makerdao.com/</a></p></figcaption></figure></div>

Decentralized stablecoins often employ overly complex designs in their systems like peg stability modules, governance structures, and upgradable proxy contracts. However, it's worth questioning whether all of these functions are truly necessary. With so many moving parts, the potential for vulnerabilities increases and the protocol becomes more difficult to maintain.

## Centralized Assets as Collateral

Decentralized stablecoins often fall short of the decentralization many believe them to have. Some of the most popular decentralized stablecoins are backed by centralized collateral.

* 30% of MakerDAO's DAI stablecoin is backed by USDC
* 63% of Hubble Protocol's USDH stablecoin is backed by USDC
* 70% of Angle's agEUR stablecoin is backed by USDC
* 93% of Hedge's USH stablecoin is backed by USDT and USDC

While using centralized stablecoins as collateral can help with peg stability, relying on them creates what is essentially a wrapped version of a centralized stablecoin, with added complexities and risks. The question arises: What happens if the centralized stablecoin issuer blacklists the address containing the collateral that backs a decentralized stablecoin?

{% hint style="info" %}
Data collected using DefiLlama on March 8th, 2023
{% endhint %}

## Centralization in DAO Governance

Most DAOs are predominantly controlled by a small group of token holders who possess a substantial amount of governance tokens. Take MakerDAO's [recent vote](https://thedefiant.io/makerdao-plan-christensen) on the proposed "Endgame Plan" as an example. The co-founder of the protocol was the biggest voter, and he was also the proposer of the proposal itself.

## Economic Challenges of Decentralized Stablecoins

Decentralized stablecoins often have high fees and minimums, low collateral ratio requirements, and misaligned incentives for users who aid in the protocol's operation.

### **High Fees and Minimums**

Many decentralized stablecoins, particularly those using collateral-debt positions, often enforce high fees and minimums, which may dissuade user participation.

### **Low Collateral Ratio Requirements**

Many decentralized stablecoins operate with lower collateral ratio requirements to encourage borrowing and capital efficiency. Although beneficial in the immediate term, this approach could cause instability if the value of the underlying collateral experiences a swift decline.

### **Misaligned Incentives**

In many stablecoin protocols that utilize collateral-debt positions, users participating in liquidations receive a small percentage of the collateral for their efforts. This may not provide enough incentive for users to take on the risk and responsibility of liquidation, especially amidst market volatility.


# Overview

## What is UWU Protocol?

UWU Protocol is a stablecoin protocol built on [Stacks](https://stacks.co) that offers zero-interest loans with no repayment date. Users can deposit STX as collateral and borrow up to 66% of the dollar value of their deposit in the form of UWU Cash (UWU), the fully-backed and unstoppable stablecoin of UWU Protocol.

## Why use UWU Protocol?

### Borrowing

With UWU Protocol, users can borrow up to 66% of the dollar value of their deposited STX in the form of UWU, with no interest charged. This enables users to access the present value of their STX without losing out on any potential future gains.

### Liquidations

UWU Protocol uses liquidations to ensure that UWU is backed by sufficient collateral. During a liquidation, liquidators are able to acquire collateral by repaying debt.

### UWU Cash (UWU)

UWU serves as a payment method, store of value, and can be transferred globally without the need for intermediaries. Moreover, developers have the opportunity to build upon UWU Protocol, creating use-cases for  UWU.

## How can I use UWU Protocol?

Most commonly, UWU Protocol is accessed via a web interface. Currently, the only available web interface is located at <https://app.uwu.cash>. Additionally, you'll need a [Stacks wallet](https://www.stacks.co/explore/find-a-wallet) containing some STX.

## Key Features

Here are some of the key features of UWU Protocol:

* Zero-interest loans with no repayment date
* Borrow up to 66% of the dollar value of your STX
* Participate in liquidations and buy discounted STX
* Governance-free and trust-minimized protocol

## Protocol Tokens

Currently, UWU Protocol issues one token:

* [**UWU Cash (UWU):**](/protocol-tokens/uwu-cash-uwu) The fully-backed and unstoppable stablecoin of UWU Protocol


# Borrowing

## What is a Vault?

A Vault is a digital container used to take out and manage a loan on UWU Protocol. A Vault is associated with a specific Stacks address, and each address can have up to 20 Vaults open at the same time.

Vaults hold two balances: collateral in the form of STX and debt in the form of UWU. Users can adjust these balances by depositing or withdrawing collateral and borrowing or repaying debt. As these balances change, the collateral ratio of the Vault will adjust.

The address linked to a Vault controls all actions for the Vault unless it is liquidated. Users can close their Vault at any time, as long as its debt has been repaid and the collateral has been withdrawn.

## What is collateral?

Collateral refers to the asset that a borrower provides as security for a loan. UWU Protocol only accepts STX as collateral.

## What is a collateral ratio?

A collateral ratio is the ratio between the dollar value of the collateral held in a Vault and the amount of debt borrowed in UWU. This ratio will change as the price of STX fluctuates. To influence a collateral ratio, users can adjust the collateral and/or debt in their Vault, such as by depositing more collateral or repaying some of the debt.

Vaults are required to maintain a minimum collateral ratio of 150%.

## What are the borrowing limits?

The minimum borrowing amount is 25 UWU when opening a Vault and 1 UWU when borrowing from an existing Vault. There is no maximum borrowing amount as long as you provide enough collateral to maintain a collateral ratio of at least 150%.

Vaults must maintain a minimum debt balance of 25 UWU at all times. When you repay your debt, your Vault's outstanding debt must be at least 25 UWU after payment; otherwise, you must repay the debt in full.

## What fees do I pay when borrowing?

Every time you borrow from a Vault, a one-time 100bps (1.00%) borrow fee is deducted from the borrowed debt. For example, if you borrow 100 UWU, you'll receive 99 UWU after the borrow fee is deducted. Your total debt will remain 100 UWU, and you will need to repay the full amount when you settle your debt.

## When do I have to repay my debt?

As long as your Vault maintains a minimum collateral ratio of 150%, you can keep your Vault open and repay your debt at any time.

## What happens if my Vault is liquidated?

If your Vault is liquidated, you will lose ownership of the Vault, and liquidators will be able to acquire the collateral held in the Vault. To avoid liquidation, your Vault must maintain a minimum collateral ratio of 150%. If your Vault is liquidated, you will no longer have to repay the UWU that was borrowed.

It's important to monitor your Vault and manage its collateral ratio to prevent liquidation.


# Liquidations

## What are liquidations?

Liquidations are a key mechanism in UWU Protocol that ensures that UWU is backed by sufficient collateral. In the event that a Vault fails to maintain a minimum collateral ratio of 150%, the Vault is liquidated (closed). During a liquidation, liquidators are able to acquire the collateral held in a Vault by repaying the Vault's debt.

## How do UWU Protocol liquidations differ from others?

UWU Protocol employs a unique multi-party liquidation mechanism that offers low barriers to entry, instant execution, and higher incentives.

Here are some of its key features:

* Collateral isn't sold via an auction
* Multiple users can liquidate a single Vault
* The entire collateral of a Vault is sold
* No grace periods or partial liquidations occur
* No fees are charged for liquidating a Vault

Those participating in the liquidation of a Vault can repay any amount of debt, as long as the Vault's debt balance is greater than 25 UWU. If a Vault's debt balance is 25 UWU, the liquidator must resolve the total debt.

## How can I avoid getting liquidated?

To avoid liquidation, ensure that the collateral ratio of your Vault stays above 150%. To minimize the potential loss of collateral, it's crucial to monitor your Vault and adjust its collateral ratio. To increase its collateral ratio, you can deposit collateral and/or repay debt.

## Who can liquidate Vaults?

Anyone can liquidate a Vault if its collateral ratio is below 150%.

## How do I benefit as a liquidator?

As liquidations happen just below a collateral ratio of 150%, you will most likely experience a net gain when liquidating a Vault.

For example, let's say a Vault has $1,500 worth of STX collateral and 1,000 UWU of debt. If the value of the collateral drops to $1,490, the collateral ratio falls below the 150% minimum, and the Vault is liquidated.

If you repay 500 UWU of debt, you will receive 50% of the Vault's collateral. Assuming the STX price remains constant and that UWU is valued at $1.00, the collateral you will receive would be worth $745. This would result in a profit of $245 in STX at the time of liquidation.

## What oracle does UWU Protocol rely on?

UWU Protocol relies on [Arkadiko's STX:USD](https://explorer.hiro.so/txid/SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR.arkadiko-oracle-v2-2?chain=mainnet) price feed, with plans to move to a more decentralized oracle in the future. For more information on oracle risks, please refer to the [Risk Disclosure](/resources/risk-disclosure) page.


# UWU Cash (UWU)

UWU Cash (UWU) is the fully-backed and unstoppable stablecoin of UWU Protocol. It's over-collateralized with STX, the native cryptocurrency of the Stacks layer, and is designed to be highly decentralized and resistant to censorship.

## Overview of UWU Cash

* **Over-collateralized:** Each UWU is backed by at least $1.50 worth of STX deposited in Vaults. Vaults that fail to maintain a collateral ratio of at least 150% are liquidated to prevent insolvency
* **Soft-pegged:** The protocol values UWU at $1.00, while letting the price float on the open market. Arbitrageurs stabilize the peg on the open market
* **Decentralized:** UWU is only backed by STX, the native cryptocurrency of the Stacks blockchain. This eliminates reliance on centralized assets like Wrapped Bitcoin or USD Coin

## Why UWU Cash?

* **Stable:** UWU Protocol uses a variety of mechanisms to help maintain a price that floats around the value of $1.00 at all times
* **Permissionless:** UWU is accessible to anyone with an internet connection, regardless of their location or financial status
* **Unstoppable:** UWU is decentralized and governance-free. No entity can stop or shut down the protocol, and nobody can freeze or confiscate UWU

## How is UWU generated?

When a user deposits STX as collateral into a Vault, they can borrow UWU against it. Vaults must maintain a minimum collateral ratio of 150%, which means the user must deposit a minimum of $1.50 worth of STX for every UWU that is borrowed. The collateral is locked in a smart contract until the borrowed UWU is repaid.

## How does UWU maintain peg?

UWU Protocol maintains stability of UWU through the use of liquidations and arbitrage.

### Vault Liquidations

In the event that a Vault fails to maintain a minimum collateral ratio of 150%, the Vault is liquidated (closed). During a liquidation, liquidators are able to acquire the collateral held in a Vault by repaying the Vault's debt.

### Arbitrage

An arbitrage opportunity arises when the price of UWU on the open market deviates from $1.00. As the protocol always values UWU at $1.00, arbitrageurs can profit by buying or selling UWU to stabilize the price on the open market.


# Stability Module

{% hint style="info" %}
The Stability Module is not a fundamental component of UWU Protocol. Instead, it is an additional component developed post-deployment of UWU Protocol
{% endhint %}

## What is the Stability Module?

The Stability Module is a tool designed to stabilize the price of UWU by enabling direct swaps between UWU and various assets, such as highly liquid stablecoins. Users can swap UWU and these stablecoins at predefined rates, typically subject to a swap fee.

## How does the Stability Module work?

The Stability Module holds reserves of UWU and various assets. Users can swap UWU for another asset, or vice versa, at predefined rates, typically subject to a swap fee. For example, if the rate between UWU and sUSDT is 1:1, users receive 1 sUSDT for every 1 UWU swapped, minus any swap fee.

This approach differs from conventional Peg Stability Modules (PSMs) because it does not mint or burn any UWU, meaning the assets held in the Stability Module's reserves do not back UWU.

## What fees do I pay when swapping?

The Stability Module features a flexible fee structure that can change depending on the specific assets involved in the swap. The current fee arrangements are as follows:

* **UWU -> Another Asset:** A fee may be applied for each swap. For instance, currently swapping from UWU to sUSDT incurs a fee of 50bps (0.50%)
* **Another Asset -> UWU:** While a fee may be charged for these swaps, typically it isn't. As an example, currently swapping from sUSDT to UWU has no fee

## Does the Stability Module centralize UWU Protocol?

No, it does not. The Stability Module does not centralize either UWU Protocol or UWU Cash (UWU). It lacks the authority to mint or burn tokens, and thus the assets in its reserves do not back UWU.

## What are the benefits of the Stability Module?

The Stability Module presents several benefits:

* It facilitates swaps between UWU and various assets at predefined rates
* It encourages peg stabilization through frictionless arbitrage
* It generates revenue from swap fees
* It enhances market liquidity for UWU

## What are the risks of the Stability Module?

The main risk associated with the Stability Module lies in smart contract vulnerabilities. If exploited, an attacker could potentially withdraw assets from the reserves.

However, since the Stability Module is an optional component that doesn't alter the core protocol, UWU Protocol would continue to be fully backed by STX and should remain unaffected in such a situation.


# Smart Vaults

{% hint style="info" %}
Smart Vaults are not a fundamental component of UWU Protocol. Instead, it is an additional component developed post-deployment of UWU Protocol
{% endhint %}

## What is a Smart Vault?

A Smart Vault is a Vault in UWU Protocol that is owned and managed by a smart contract. Smart Vaults enable a variety of use cases that can be built by anyone, as they're permissionless.

## How do Smart Vaults work?

Smart Vaults are made possible because UWU Protocol allows users to transfer their Vaults from one Stacks address to another. Essentially, a Smart Vault is a smart contract designated as the owner of a Vault. By transferring an existing Vault or opening a new Vault where the designated owner is a smart contract, you effectively create a Smart Vault.

## What capabilities do Smart Vaults offer?

Smart Vaults facilitate a diverse array of functionalities, including but not limited to:

* **Liquidation Prevention:** A Smart Vault can be configured to proactively manage its own collateral ratio to try and prevent liquidation. It does this by automatically executing actions such as repaying debt or depositing collateral to adjust the collateral ratio
* **Automatic Dollar-Cost Averaging:** A Smart Vault could be created that automatically borrows UWU and swaps it for another asset over a specified period of time
* **Multi-Signature Vaults:** A Smart Vault can be designed to require multiple signers to confirm critical actions. This ensures that decisions such as depositing more collateral or borrowing additional UWU are made collectively

## What risks are associated with Smart Vaults?

The primary concerns with Smart Vaults stem from potential vulnerabilities in their smart contract code. Should a Smart Vault contain flaws, the associated Vault may become compromised. While such exploits do not directly affect UWU Protocol, they can lead to temporary market disturbances. For instance, an attacker exploiting a Smart Vault with a high collateral ratio could mint and sell UWU, potentially impacting its market price. However, even in such scenarios, the minted UWU remains backed by the collateral in the Vault, thus not constituting bad debt.

Prior to utilizing a Smart Vault, it's crucial to conduct a thorough review and assess your comfort level with its security. A recommended feature for Smart Vaults is the ability for users to convert their Smart Vault back to a regular Vault whenever they choose.

## How can I use Smart Vaults?

Currently, no Smart Vaults are known to be active on either the Stacks mainnet or testnet. Additionally, the Web App does not yet offer support for Smart Vaults. However, the tools and resources are available for developers to start building and integrating Smart Vaults at their discretion.


# UWU Swap

{% hint style="info" %}
UWU Swap is not a fundamental component of UWU Protocol. Instead, it is an additional component developed post-deployment of UWU Protocol
{% endhint %}

## What is UWU Swap?

UWU Swap is the first swap aggregator on the Stacks layer. It aggregates multiple liquidity sources - such as decentralized exchanges (DEXes), the Stability Module, among others - to find the best exchange rate for your swap.

## How does UWU Swap work?

UWU Swap operates by first determining the optimal route for your swap off-chain. It achieves this by assessing various liquidity sources, including DEXes, the Stability Module, and others. Each potential route is evaluated based on several factors, such as the liquidity available, associated swap fees, the prevailing exchange rate, and the permissionless nature of the liquidity source. After considering these aspects, UWU Swap selects the route that offers the most favorable exchange rate for your swap.

## What routing options are available?

UWU Swap offers two types of routes for swaps:

* **Direct Route:** This method routes your swap through a single liquidity source. It utilizes the smart contracts deployed by the liquidity source directly, rather than UWU Swap's own contracts
* **Multi-hop Route:** This method uses UWU Swap's own smart contracts to route your swap through multiple liquidity sources in a single transaction

## What fees do I pay when swapping?

At present, UWU Swap does not charge any extra fees. Nonetheless, you may encounter fees from the liquidity sources involved in your swap. For example, if your swap is routed through the Stability Module, you may be required to pay the Stability Module's swap fee.

## How can I use UWU Swap?

To use UWU Swap, simply visit the Web App at [https://app.uwu.cash](https://app.uwu.cash/). Additionally, the smart contracts that UWU Swap utilizes are open-source and accessible by anyone.


# UWU Guardian

{% hint style="info" %}
This section is unfinished. Check back soon
{% endhint %}


# Contracts API

## Smart Contracts

{% hint style="info" %}
Documentation for the **sip-010-trait-ft-standard** contract is not provided, as it's a standard implementation of the well-documented [SIP-010 Fungible Token Standard](https://github.com/stacksgov/sips/blob/main/sips/sip-010/sip-010-fungible-token-standard.md)
{% endhint %}

* [**uwu-factory-v1-1-0:**](/developers/contracts-api/uwu-factory-v1-1-0) The core contract managing Vaults and the minting and burning of UWU
* [**uwu-oracle-proxy-v1-1-0:**](/developers/contracts-api/uwu-oracle-proxy-v1-1-0) The proxy contract for managing STX price data from an authorized oracle
* [**uwu-oracle-v1-1-3:**](/developers/contracts-api/uwu-oracle-v1-1-3) The contract responsible for providing STX price data
* [**xuwu-fee-claim-v1-1-0:**](/developers/contracts-api/xuwu-fee-claim-v1-1-0) The contract managing fees generated by the protocol
* [**uwu-token-v1-1-0:**](/developers/contracts-api/uwu-token-v1-1-0) The contract for the SIP-010 compliant UWU fungible token

## Units

All unit values passed or returned by methods use 6 decimal places. For example, 1 UWU is expressed as `u1000000`.

## Error Codes

<table data-header-hidden><thead><tr><th width="98">Code</th><th width="261">Error</th><th>Description</th></tr></thead><tbody><tr><td><strong>Code</strong></td><td><strong>Error</strong></td><td><strong>Description</strong></td></tr><tr><td>1001</td><td>ERR_NOT_AUTHORIZED</td><td>The specified principal is not authorized</td></tr><tr><td>1002</td><td>ERR_INVALID_AMOUNT</td><td>The amount parameter is invalid</td></tr><tr><td>2001</td><td>ERR_VAULT_NOT_FOUND</td><td>The specified Vault was not found</td></tr><tr><td>2002</td><td>ERR_VAULT_LIMIT</td><td>The specified principal has reached the maximum limit of 20 Vaults per principal at any given time</td></tr><tr><td>2003</td><td>ERR_VAULT_NOT_LIQUIDATED</td><td>The specified Vault is not liquidated</td></tr><tr><td>2004</td><td>ERR_VAULT_LIQUIDATED</td><td>The specified Vault is liquidated</td></tr><tr><td>3001</td><td>ERR_MINIMUM_DEBT</td><td>The specified Vault is below the minimum amount of debt</td></tr><tr><td>3002</td><td>ERR_MAXIMUM_DEBT</td><td>The specified Vault has the maximum amount of debt</td></tr><tr><td>3003</td><td>ERR_NONZERO_DEBT</td><td>The specified Vault has non-zero debt</td></tr><tr><td>3004</td><td>ERR_ZERO_DEBT</td><td>The specified Vault has zero debt</td></tr><tr><td>4001</td><td>ERR_PROXY_FROZEN</td><td>The oracle proxy is frozen</td></tr></tbody></table>

## Upgradability

UWU Protocol is designed with a strong emphasis on immutability and non-upgradability for the majority of its components. The `CONTRACT_OWNER` is a constant, representing the principal authorized to make specific parameter changes within the contracts it is defined in.

The `CONTRACT_OWNER` is specified in two contracts:

* [**uwu-oracle-proxy-v1-1-0**](/developers/contracts-api/uwu-oracle-proxy-v1-1-0)
* [**uwu-token-v1-1-0**](/developers/contracts-api/uwu-token-v1-1-0)

Its purpose is to allow for modifications to the oracle used and token metadata, with the latter not affecting the protocol itself as it pertains to off-chain information related to the protocol's tokens.

Due to the current lack of decentralized oracle providers on Stacks, UWU Protocol is temporarily relying on a trust-minimized oracle. This is the reason behind the upgradability of the oracle proxy. Once upgraded to a decentralized oracle provider, the oracle proxy will be permanently frozen.

The `CONTRACT_OWNER` cannot modify the core functionalities of other contracts, such as `uwu-factory-v1-1-0`. All other contracts are immutable and non-upgradable.

## Versioning

The versioning for UWU Protocol follows a three-digit structure (X.Y.Z), where:

* **First digit (X):** Represents a major change that requires redeployment of non-proxy contracts. Upgrading to a new major version implies a completely new system, operating separately from the previous one. Users can still interact with the previous release, even when a new major version is deployed
* **Second digit (Y):** Represents a minor change that also requires redeployment of non-proxy contracts. Similar to a major change, this update results in a new version of the system operating separately from the previous one
* **Third digit (Z):** Represents a minor change that does not require redeployment of core contracts. These updates may include changes such as a new oracle contract or the addition of new contracts that are optional and do not necessitate redeployment of core contracts

## License

The contracts used in UWU Protocol are licensed under the GNU General Public License v3.0 (GPLv3). For more information on the license terms and conditions, please refer to the [GNU General Public License v3.0](https://www.gnu.org/licenses/gpl-3.0.html).


# uwu-factory-v1-1-0

The `uwu-factory-v1-1-0` contract serves as the central management system for Vaults and is the sole authorized caller for minting and burning tokens in the `uwu-token-v1-1-0` contract. Users can deposit STX as collateral into the contract and mint UWU tokens in return. Furthermore, users can deposit UWU into the contract and burn it by repaying debt, allowing them to reclaim their STX collateral.

## Data Storage

These structures allow the contract to maintain its state, track information, and ensure data consistency throughout the contract's lifecycle.

### last-vault-id

```
(define-data-var last-vault-id uint u0)
```

A data variable that stores the ID of the most recently opened Vault.

### opened-vault-count

```
(define-data-var opened-vault-count uint u0)
```

A data variable that keeps track of the current number of opened Vaults.

### liquidated-vault-count

```
(define-data-var liquidated-vault-count uint u0)
```

A data variable that stores the total number of Vaults that have been liquidated.

### vaults

```
(define-map vaults uint 
    {
        id: uint,
        owner: principal,
        collateral: uint,
        debt: uint,
        height: uint,
        liquidated: bool
    }
)
```

A map that stores information related to each Vault, including its ID, the owning principal, the amount of deposited collateral, the current debt, the block-height at which the Vault was opened (in Stacks blocks), and the liquidation status of the Vault.

### vault-entries

```
(define-map vault-entries principal (list 20 uint))
```

A map that maintains a record of the IDs of each of the opened Vaults owned by each principal, with a maximum limit of 20 Vaults per principal at any given time.

### last-removed-entry

```
(define-map last-removed-entry principal uint)
```

A map that stores the most recent ID removed from the `vault-entries` map for each principal.

## Public Functions

These functions are accessible by external contracts or users, enabling interaction with the contract and state modification.

### open-vault

<pre><code><strong>(define-public (open-vault (collateral uint) (debt uint)))
</strong></code></pre>

A public function that creates a new Vault for the `tx-sender` using the provided collateral and debt amounts. The collateral ratio must be at least 150%. A minimum of 25 UWU (`u25000000`) must be borrowed and a 100bps (1.00%) one-time borrow fee is taken from the debt borrowed.

| **Parameter** | **Type** | **Description**                     |
| ------------- | -------- | ----------------------------------- |
| collateral    | uint     | The amount of collateral to deposit |
| debt          | uint     | The amount of debt to borrow        |

### borrow-vault

```
(define-public (borrow-vault (id uint) (amount uint)))
```

A public function that enables the owner of a specified Vault to take on additional debt in that Vault. The `tx-sender` must be the owner of the Vault. The Vault cannot be liquidated, and the collateral ratio must be at least 150%, taking into account the newly borrowed amount. A minimum of 1 UWU (`u1000000`) must be borrowed and a 100bps (1.00%) one-time borrow fee is taken from the debt borrowed. If the Vault has zero debt, a minimum of 25 UWU (`u25000000`) must be borrowed.

| **Parameter** | **Type** | **Description**                    |
| ------------- | -------- | ---------------------------------- |
| id            | uint     | The ID of the Vault to borrow from |
| amount        | uint     | The amount of debt to borrow       |

### collateralize-vault

```
(define-public (collateralize-vault (id uint) (amount uint)))
```

A public function that allows the owner of a specified Vault to deposit additional collateral into that Vault. The `tx-sender` must be the owner of the Vault, and the Vault cannot be liquidated.

| **Parameter** | **Type** | **Description**                      |
| ------------- | -------- | ------------------------------------ |
| id            | uint     | The ID of the Vault to collateralize |
| amount        | uint     | The amount of collateral to deposit  |

### repay-vault

```
(define-public (repay-vault (id uint) (amount uint)))
```

A public function that allows the owner of a specified Vault to repay the debt of that Vault. The `tx-sender` must be the owner of the Vault, and the Vault cannot be liquidated. The amount repaid must either equal the total debt of the Vault or leave a remaining debt of at least 25 UWU (`u25000000`) in the Vault to prevent dust amounts from being left behind.

| **Parameter** | **Type** | **Description**                      |
| ------------- | -------- | ------------------------------------ |
| id            | uint     | The ID of the Vault to repay debt in |
| amount        | uint     | The amount of debt to repay          |

### withdraw-vault

```
(define-public (withdraw-vault (id uint) (amount uint)))
```

A public function that enables the owner of a specified Vault to withdraw excess collateral from that Vault. The `tx-sender` must be the owner of the Vault, the Vault cannot be liquidated, and the collateral ratio must remain at least 150% after accounting for the withdrawn amount.

| **Parameter** | **Type** | **Description**                      |
| ------------- | -------- | ------------------------------------ |
| id            | uint     | The ID of the Vault to withdraw from |
| amount        | uint     | The amount of collateral to withdraw |

### transfer-vault

```
(define-public (transfer-vault (id uint) (account principal)))
```

A public function that permits the owner of a specified Vault to transfer ownership of that Vault to a new principal. The `tx-sender` must be the owner of the Vault, the Vault cannot be liquidated, and the receiver cannot currently own more than 20 Vaults. Once transferred, the receiver gains full control of the Vault, and the original owner loses access unless the Vault is transferred back. The ID of the Vault is removed from the original owner's `vault-entries` map and added to the new owner's map.

| **Parameter** | **Type**  | **Description**                                |
| ------------- | --------- | ---------------------------------------------- |
| id            | uint      | The ID of the Vault to transfer                |
| account       | principal | The principal receiving ownership of the Vault |

### close-vault

```
(define-public (close-vault (id uint)))
```

A public function that enables the owner of a specified Vault to close that Vault. The `tx-sender` must be the owner of the Vault, and both the collateral and debt amounts in the Vault must be zero. Once closed, the Vault ID is removed from the owner's `vault-entries` map, and the information associated with the Vault is deleted from the `vaults` map.

| **Parameter** | **Type** | **Description**              |
| ------------- | -------- | ---------------------------- |
| id            | uint     | The ID of the Vault to close |

### liquidate-vault

```
(define-public (liquidate-vault (id uint)))
```

A public function that allows anyone to liquidate a specified Vault if its collateral ratio falls below 150%. The `tx-sender` does not need to be the owner of the Vault. If liquidated, the Vault is then purchasable via the `purchase-vault` public function. Following liquidation, the owner can no longer deposit collateral, borrow UWU, or execute other actions on the vault, except for closing it once the collateral and debt amounts reach zero.<br>

| **Parameter** | **Type** | **Description**                  |
| ------------- | -------- | -------------------------------- |
| id            | uint     | The ID of the Vault to liquidate |

### purchase-vault

```
(define-public (purchase-vault (id uint) (amount uint)))
```

A public function that enables anyone to repay the debt in a specified liquidated Vault in exchange for the Vault's collateral. The `tx-sender` does not need to be the owner. Users can purchase any portion of the Vault, receiving a proportionate share of the collateral. For instance, if a user repays 10% of the debt in a liquidated Vault, they would receive 10% of the Vault's collateral. The amount purchased must either equal the total debt of the Vault or leave a remaining debt of at least 25 UWU (`u25000000`) in the Vault to prevent dust amounts from being left behind.

| **Parameter** | **Type** | **Description**                      |
| ------------- | -------- | ------------------------------------ |
| id            | uint     | The ID of the Vault to purchase from |
| amount        | uint     | The amount of debt to repay          |

## Private Functions

These functions are accessible only within the contract they are defined in, providing encapsulation and preventing external access to specific functionality.

### get-collateral-ratio

```
(define-private (get-collateral-ratio (collateral uint) (debt uint)))
```

A private function that calculates the collateral ratio based on the given collateral and debt amounts.

| **Parameter** | **Type** | **Description**          |
| ------------- | -------- | ------------------------ |
| collateral    | uint     | The amount of collateral |
| debt          | uint     | The amount of debt       |

### remove-vault-entry

```
(define-private (remove-vault-entry (id uint)))
```

A private function that removes a specified ID linked to an open Vault, owned by the `tx-sender`, from the `vault-entries` map. This function does not remove the Vault from the `vaults` map.

| **Parameter** | **Type** | **Description**  |
| ------------- | -------- | ---------------- |
| id            | uint     | The ID to remove |

## Read-only Functions

These functions do not modify the contract's state and are used for querying or retrieving data. They can be called by external contracts or users but will not change the underlying state.

### get-last-vault-id

```
(define-read-only (get-last-vault-id))
```

A read-only function that returns the ID of the last opened Vault.

### get-opened-vault-count

```
(define-read-only (get-opened-vault-count))
```

A read-only function that returns the number of Vaults that are currently opened.

### get-liquidated-vault-count

```
(define-read-only (get-liquidated-vault-count))
```

A read-only function that returns the number of Vaults that have been liquidated.

### get-vault

```
(define-read-only (get-vault (id uint)))
```

A read-only function that returns the information associated with a Vault, including its owner, deposited collateral, current debt, the block-height at which the Vault was opened (in Stacks blocks), and its liquidation status.

| **Parameter** | **Type** | **Description**              |
| ------------- | -------- | ---------------------------- |
| id            | uint     | The ID of the Vault to query |

### get-vault-entries

```
(define-read-only (get-vault-entries (account principal)))
```

A read-only function that retrieves the list of IDs associated with the Vaults currently opened and owned by a specified principal.

| **Parameter** | **Type**  | **Description**        |
| ------------- | --------- | ---------------------- |
| account       | principal | The principal to query |

### get-vaults

```
(define-read-only (get-vaults (account principal)))
```

A read-only function that fetches the detailed information for each opened Vault owned by a specified principal.

| **Parameter** | **Type**  | **Description**        |
| ------------- | --------- | ---------------------- |
| account       | principal | The principal to query |

### get-can-liquidate-vault

```
(define-read-only (get-can-liquidate-vault (id uint)))
```

A read-only function that returns whether a Vault can be liquidated, along with its current collateral ratio.

| **Parameter** | **Type** | **Description**              |
| ------------- | -------- | ---------------------------- |
| id            | uint     | The ID of the Vault to query |


# uwu-oracle-proxy-v1-1-0

The `uwu-oracle-proxy-v1-1-0` contract is responsible for storing and managing STX price data fetched from the oracle address. As a proxy, it allows the defined contract owner to update the oracle address and to freeze the ability to make further changes to the oracle address.

## Data Storage

These structures allow the contract to maintain its state, track information, and ensure data consistency throughout the contract's lifecycle.

### CONTRACT\_OWNER

```
(define-constant CONTRACT_OWNER tx-sender)
```

A constant representing the principal authorized to make parameter changes to the contract. The `CONTRACT_OWNER` can only issue changes to the oracle proxy (unless frozen) and update token metadata. The `CONTRACT_OWNER` is not authorized to perform any other actions.

### is-proxy-frozen

```
(define-data-var is-proxy-frozen bool false)
```

A data variable that holds the proxy's frozen status, indicating whether the oracle address can be changed.

### oracle-address

```
(define-data-var oracle-address principal tx-sender)
```

A data variable storing the oracle address responsible for updating the STX price in the oracle proxy.

### stx-price

```
(define-data-var stx-price uint u0)
```

A data variable containing the STX price provided by the oracle address.

## Public Functions

These functions are accessible by external contracts or users, enabling interaction with the contract and state modification.

### set-oracle-address

```
(define-public (set-oracle-address (address principal)))
```

A public function that allows the contract owner to update the oracle address responsible for providing STX price updates.

| **Parameter** | **Type**  | **Description**        |
| ------------- | --------- | ---------------------- |
| address       | principal | The new oracle address |

### freeze-proxy

```
(define-public (freeze-proxy))
```

A public function, callable by the contract owner, which permanently freezes the proxy. When frozen, the oracle address cannot be changed.

### update-stx-price

```
(define-public (update-stx-price (price uint)))
```

A public function that can be called by the oracle address to update the stored STX price in the oracle proxy.

| **Parameter** | **Type** | **Description**       |
| ------------- | -------- | --------------------- |
| price         | uint     | The updated STX price |

## Private Functions

These functions are accessible only within the contract they are defined in, providing encapsulation and preventing external access to specific functionality.

{% hint style="info" %}
This contract does not contain any private functions
{% endhint %}

## Read-only Functions

These functions do not modify the contract's state and are used for querying or retrieving data. They can be called by external contracts or users but will not change the underlying state.

### get-oracle-address

```
(define-read-only (get-oracle-address))
```

A read-only function that returns the current oracle address authorized to update the STX price in the oracle proxy.

### get-is-proxy-frozen

```
(define-read-only (get-is-proxy-frozen))
```

A read-only function that returns whether the proxy is frozen or not. When the proxy is frozen, the oracle address cannot be changed.

### get-stx-price

```
(define-read-only (get-stx-price))
```

A read-only function that returns the most recent STX price stored in the proxy, which was sent by the oracle address.


# uwu-oracle-v1-1-3

{% hint style="info" %}
UWU Protocol utilizes the **uwu-oracle-v1-1-3** contract as its current oracle. Previously, three other versions were deployed but have since been deprecated
{% endhint %}

The `uwu-oracle-v1-1-3` contract serves as an intermediary to gather STX price data from the Arkadiko Oracle and forwards it to the `uwu-oracle-proxy-v1-1-0` contract.

## Data Storage

These structures allow the contract to maintain its state, track information, and ensure data consistency throughout the contract's lifecycle.

{% hint style="info" %}
This contract does not contain any data storage structures
{% endhint %}

## Public Functions

These functions are accessible by external contracts or users, enabling interaction with the contract and state modification.

### send-to-proxy

```
(define-public (send-to-proxy))
```

A public function that forwards STX price data from the Arkadiko Oracle to the `uwu-oracle-proxy-v1-1-0` contract. Any user can call this function.

## Private Functions

These functions are accessible only within the contract they are defined in, providing encapsulation and preventing external access to specific functionality.

{% hint style="info" %}
This contract does not contain any private functions
{% endhint %}

## Read-only Functions

These functions do not modify the contract's state and are used for querying or retrieving data. They can be called by external contracts or users but will not change the underlying state.

{% hint style="info" %}
This contract does not contain any read-only functions
{% endhint %}


# xuwu-fee-claim-v1-1-0

{% hint style="info" %}
This section is unfinished. Check back soon
{% endhint %}


# uwu-token-v1-1-0

The `uwu-token-v1-1-0` contract is a fungible token implementation compatible with the SIP-010 standard. It functions as the primary token minted and burnt by the `uwu-factory-v1-1-0` contract. The token is minted when users deposit STX as collateral into the `uwu-factory-v1-1-0` contract and borrow UWU against it, and burnt when users deposit UWU.

## Data Storage

These structures allow the contract to maintain its state, track information, and ensure data consistency throughout the contract's lifecycle.

### CONTRACT\_OWNER

```
(define-constant CONTRACT_OWNER tx-sender)
```

A constant representing the principal authorized to make parameter changes to the contract. The `CONTRACT_OWNER` can only issue changes to the oracle proxy (unless frozen) and update token metadata. The `CONTRACT_OWNER` is not authorized to perform any other actions.

### token-uri

```clarity
(define-data-var token-uri (string-utf8 256) u"")
```

A data variable that stores a link to the metadata associated with the token, including the token's name, symbol, description, and image.

## Public Functions

These functions are accessible by external contracts or users, enabling interaction with the contract and state modification.

### set-token-uri

```
(define-public (set-token-uri (uri (string-utf8 256))))
```

A public function, callable by the contract owner, that updates the token URI associated with the token.

| **Parameter** | **Type**        | **Description**   |
| ------------- | --------------- | ----------------- |
| uri           | string-utf8 256 | The new token URI |

### transfer

```
(define-public (transfer (amount uint) (sender principal) (recipient principal) (memo (optional (buff 34)))))
```

A public function that enables the transfer of a specified amount of tokens from the sender to a recipient, with an optional memo parameter.

| **Parameter** | **Type**         | **Description**                              |
| ------------- | ---------------- | -------------------------------------------- |
| amount        | uint             | The amount to transfer                       |
| sender        | principal        | The principal sending the specified amount   |
| recipient     | principal        | The principal receiving the specified amount |
| memo          | optional buff 34 | The optional memo                            |

### mint

```clarity
(define-public (mint (amount uint) (account principal)))
```

A public function that mints a specified amount of tokens to a principal. This function can only be called by the `uwu-factory-v1-1-0` contract.

| **Parameter** | **Type**  | **Description**                                      |
| ------------- | --------- | ---------------------------------------------------- |
| amount        | uint      | The amount to mint                                   |
| account       | principal | The principal set to receive the newly minted tokens |

### burn

```clarity
(define-public (burn (amount uint) (account principal)))
```

A public function that burns a specified amount of tokens from a principal. This function can only be called by the `uwu-factory-v1-1-0` contract.

| **Parameter** | **Type**  | **Description**                               |
| ------------- | --------- | --------------------------------------------- |
| amount        | uint      | The amount to burn                            |
| account       | principal | The principal from which tokens will be burnt |

## Private Functions

These functions are accessible only within the contract they are defined in, providing encapsulation and preventing external access to specific functionality.

{% hint style="info" %}
This contract does not contain any private functions
{% endhint %}

## Read-only Functions

These functions do not modify the contract's state and are used for querying or retrieving data. They can be called by external contracts or users but will not change the underlying state.

### get-name

```
(define-read-only (get-name))
```

A read-only function that returns the token's name.

### get-symbol

```
(define-read-only (get-symbol))
```

A read-only function that returns the token's symbol.

### get-decimals

```
(define-read-only (get-decimals))
```

A read-only function that returns the token's number of decimals.

### get-total-supply

```
(define-read-only (get-total-supply))
```

A read-only function that returns the current total supply of tokens.

### get-balance

```
(define-read-only (get-balance (account principal)))
```

A read-only function that returns the token balance of a specified principal.

| **Parameter** | **Type**  | **Description**        |
| ------------- | --------- | ---------------------- |
| account       | principal | The principal to query |

### get-token-uri

```
(define-read-only (get-token-uri))
```

A read-only function that returns the token URI associated with the token.


# Deployed Contracts

{% hint style="danger" %}
The **xuwu-fee-claim-v1-1-0** contract has not yet been deployed on the Stacks mainnet or testnet. For the latest updates, please join our [Discord community](http://chat.uwu.cash)
{% endhint %}

Below is the complete registry of UWU Protocol smart contracts that have been deployed to both the Stacks mainnet and testnet. This registry does not include deprecated contracts, optional services, or third-party contracts that utilize UWU Protocol.

## Mainnet

Deployment Address: [SP2AKWJYC7BNY18W1XXKPGP0YVEK63QJG4793Z2D4](https://explorer.stacks.co/address/SP2AKWJYC7BNY18W1XXKPGP0YVEK63QJG4793Z2D4?chain=mainnet)

| **Contract**              | **Explorer Link**                                                                                                                         |
| ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| uwu-factory-v1-1-0        | [View on Hiro Explorer](https://explorer.stacks.co/txid/SP2AKWJYC7BNY18W1XXKPGP0YVEK63QJG4793Z2D4.uwu-factory-v1-1-0?chain=mainnet)       |
| uwu-oracle-proxy-v1-1-0   | [View on Hiro Explorer](https://explorer.stacks.co/txid/SP2AKWJYC7BNY18W1XXKPGP0YVEK63QJG4793Z2D4.uwu-oracle-proxy-v1-1-0?chain=mainnet)  |
| uwu-oracle-v1-1-3         | [View on Hiro Explorer](https://explorer.hiro.so/txid/SP2AKWJYC7BNY18W1XXKPGP0YVEK63QJG4793Z2D4.uwu-oracle-v1-1-3?chain=mainnet)          |
| xuwu-fee-claim-v1-1-0     | [View on Hiro Explorer](https://explorer.stacks.co/txid/SP2AKWJYC7BNY18W1XXKPGP0YVEK63QJG4793Z2D4.xuwu-fee-claim-v1-1-0?chain=mainnet)    |
| uwu-token-v1-1-0          | [View on Hiro Explorer](https://explorer.stacks.co/txid/SP2AKWJYC7BNY18W1XXKPGP0YVEK63QJG4793Z2D4.uwu-token-v1-1-0?chain=mainnet)         |
| sip-010-trait-ft-standard | [View on Hiro Explorer](https://explorer.stacks.co/txid/0x88205e6c4f0794c4ef273abb348bacc0800c2a9d483c4995bcd3396489cdcfcc?chain=mainnet) |

## Testnet

Deployment Address: [ST2AKWJYC7BNY18W1XXKPGP0YVEK63QJG44ADC0KC](https://explorer.stacks.co/address/ST2AKWJYC7BNY18W1XXKPGP0YVEK63QJG44ADC0KC?chain=testnet)

| **Contract**              | **Explorer Link**                                                                                                                        |
| ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| uwu-factory-v1-1-0        | [View on Hiro Explorer](https://explorer.hiro.so/txid/ST2AKWJYC7BNY18W1XXKPGP0YVEK63QJG44ADC0KC.uwu-factory-v1-1-0?chain=testnet)        |
| uwu-oracle-proxy-v1-1-0   | [View on Hiro Explorer](https://explorer.hiro.so/txid/ST2AKWJYC7BNY18W1XXKPGP0YVEK63QJG44ADC0KC.uwu-oracle-proxy-v1-1-0?chain=testnet)   |
| uwu-oracle-v1-1-3         | [View on Hiro Explorer](https://explorer.hiro.so/txid/ST2AKWJYC7BNY18W1XXKPGP0YVEK63QJG44ADC0KC.uwu-oracle-v1-1-3?chain=testnet)         |
| xuwu-fee-claim-v1-1-0     | [View on Hiro Explorer](https://explorer.hiro.so/txid/ST2AKWJYC7BNY18W1XXKPGP0YVEK63QJG44ADC0KC.uwu-fee-claim-v1-1-0?chain=testnet)      |
| uwu-token-v1-1-0          | [View on Hiro Explorer](https://explorer.hiro.so/txid/ST2AKWJYC7BNY18W1XXKPGP0YVEK63QJG44ADC0KC.uwu-token-v1-1-0?chain=testnet)          |
| sip-010-trait-ft-standard | [View on Hiro Explorer](https://explorer.hiro.so/txid/ST2AKWJYC7BNY18W1XXKPGP0YVEK63QJG44ADC0KC.sip-010-trait-ft-standard?chain=testnet) |


# Microservices

UWU Protocol incorporates microservices, also known as keepers, to support the functionality of both the core protocol and its various optional services. These microservices play a vital role in broadcasting transactions, storing data, and performing other essential operations. For detailed information on all the microservices utilized, refer to the complete registry provided below.

## Oracle Keeper

The Oracle Keeper is a microservice designed to ensure the accuracy of UWU Protocol's price data. It operates by broadcasting a transaction that relays price information from the protocol's oracle contract to its oracle proxy contract. Before broadcasting, the Oracle Keeper performs multiple efficiency checks. Anyone can run an instance of the Oracle Keeper.

You can view the source code for the Oracle Keeper by [clicking here](https://github.com/uwuprotocol/oracle-keeper). Additionally, you can view one of the primary Stacks account running an instance of the Oracle Keeper by [clicking here](https://explorer.hiro.so/address/SP32BWYT80264254QRAB4ZZSR1W14VTKSQ92Y1GZ3?chain=mainnet).

## Data Fetcher

The Data Fetcher is a microservice that collects and stores data relevant to UWU Protocol into a MongoDB database. It's primarily used for creating historical analytics by gathering a variety of information, including protocol statistics and market data. Anyone can run an instance of the Data Fetcher.

You can view the source code for the Data Fetcher by [clicking here](https://github.com/uwuprotocol/data-fetcher). Additionally, you can access an analytics dashboard, which utilizes data from the Data Fetcher, by [clicking here](http://grafana.uwu.cash).

## Liquidation Keeper

The Liquidation Keeper is a microservice designed to monitor all Vaults within UWU Protocol and, if enabled, participates in liquidations. If enabled, it attempts to purchase liquidated Vaults and initiates the liquidation process for those eligible. Additionally, it stores liquidation data and insights into a MongoDB database if configured to do so.

Currently, the Liquidation Keeper is still in development, and its source code is not yet available.

## Arbitrage Bot

The Arbitrage Bot is a microservice designed to monitor the price of UWU on the open market and execute swaps if a profitable arbitrage opportunity arises. It tracks multiple liquidity sources and can interact with UWU Swap's smart contracts, enabling the microservice to route its swaps through multiple liquidity sources in a single transaction.

Currently, the Arbitrage Bot is still in development, and its source code is not yet available.


# FAQ

## What is UWU Protocol?

UWU Protocol is a stablecoin protocol built on [Stacks](https://stacks.co) that offers zero-interest loans with no repayment date. Users can deposit STX as collateral and borrow up to 66% of the dollar value of their deposit in the form of UWU Cash (UWU), the fully-backed and unstoppable stablecoin of UWU Protocol.

## How can I use UWU Protocol?

Most commonly, UWU Protocol is accessed via a web interface. Currently, the only available web interface is located at <https://app.uwu.cash>. Additionally, you'll need a [Stacks wallet](https://www.stacks.co/explore/find-a-wallet) containing some STX.

## Is UWU Protocol audited?

At this time, UWU Protocol has not undergone a formal audit. A formal audit is planned in the future to improve the security and transparency of the protocol.

## What is Stacks?

Stacks is a smart contract layer anchored to the Bitcoin blockchain. Stacks allows developers to build decentralized applications with programmable smart contracts, while still leveraging the security and immutability of Bitcoin.

## Why Stacks?

As the most battle-tested blockchain to date, Bitcoin offers unparalleled security that is unmatched by any other blockchain. By building on top of Stacks, UWU Protocol benefits from the proven security of Bitcoin and the flexibility of smart contracts.

## What is STX?

Stacks (STX) is the native cryptocurrency of the Stacks layer. STX is used to pay for transaction fees and execute smart contracts.


# Scorecard

This scorecard section provides transparency into the current state of UWU Protocol and how it's evolving to become a fully decentralized, governance-free, and unstoppable stablecoin protocol.

## Current Achievements

* [x] UWU Protocol is governance-free and unstoppable
* [x] UWU is collateralized by decentralized assets
* [x] All core parameters (excl. oracle proxy) are frozen
* [x] Deposited funds are only accessible by depositors and liquidators
* [x] Nobody (incl. core contributors) can shutdown the protocol
* [x] All protocol modules operate autonomously
* [x] Nobody (incl. core contributors) can freeze assets
* [x] Keepers built by core contributors are open-source

## Areas for Improvement

* [ ] Oracle parameter is frozen and unchangeable
* [ ] UWU Protocol uses a decentralized oracle provider
* [ ] UWU Protocol has undergone a formal audit
* [ ] UWU Protocol is accessible from multiple independent frontends
* [ ] A system for capturing protocol fees is launched
* [ ] Frontends built by core contributors are open-source


# Risk Disclosure

Like all smart contract-based protocols, UWU Protocol carries a variety of risks that should be understood and carefully considered before use.

In the event of an unidentified exploit or hack, users may suffer a complete loss of funds. There are no refunds available for losses resulting from the use of UWU Protocol. Users participate in UWU Protocol at their own risk and should perform their own research before engaging with the protocol.

## **Smart Contracts**

UWU Protocol uses smart contracts to function. As with any code, there is always a possibility of undiscovered bugs or vulnerabilities.

## **Liquidations**

In the event that a Vault fails to maintain a minimum collateral ratio of 150%, the Vault is liquidated (closed). During a liquidation, liquidators are able to acquire the collateral held in a Vault by repaying the Vault's debt. This results in a loss of funds for the Vault owner.

## Peg Stability

The price of UWU Cash (UWU) should float around $1.00, but there is always the possibility of UWU de-pegging. UWU Protocol only relies on liquidations and arbitrage to maintain peg stability. Since the protocol lacks governance, redemption modules, and other mechanisms to stabilize UWU's peg, the price on the open market can deviate.

## **Oracle Provider**

UWU Protocol relies on a trust-minimized oracle until a decentralized option is available on Stacks. The oracle parameter is the only changeable parameter that affects protocol functionality. Currently, core contributors have access to change the parameter. Once updated, the parameter is permanently frozen and unchangeable.

## **Audits**

At this time, UWU Protocol has not undergone a formal audit. A formal audit is planned in the future to improve the security and transparency of the protocol.


# Terminology

## UWU Protocol

A stablecoin protocol built on Stacks that offers zero-interest loans with no repayment date. Users can deposit STX as collateral and borrow up to 66% of the dollar value of their deposit in the form of UWU Cash (UWU), the fully-backed and unstoppable stablecoin of UWU Protocol.

## UWU Cash (UWU)

A stablecoin over-collateralized with STX that is highly decentralized and censorship-resistant.

## Vault

A digital container used to take out and manage a loan on UWU Protocol. A Vault is associated with a specific Stacks address, and each address can have up to 20 Vaults open at the same time.

## Collateral

An asset that a borrower pledges to a lender as security for a loan. If the borrower fails to repay the loan, the lender can seize the collateral to recover their losses.

## Debt

Something, typically money, that is owed or due.

## Collateral Ratio

The ratio of the value of a Vault's collateral to the amount of debt they have outstanding.

## Loan-to-Value (LTV)

The ratio of the amount of a loan to the value of the collateral that is securing the loan.

## Liquidation

The process by which a Vault is closed and liquidators are able to acquire the collateral held in the Vault by repaying its debt.

## Arbitrage

The practice of taking advantage of differences in the price of an asset on different exchanges.

## Peg

The target value at which the price of a cryptocurrency or asset is supposed to be maintained.

## Stacks (STX)

Stacks is a smart contract layer anchored to the Bitcoin blockchain that enables programmable smart contracts that leverage the security and immutability of Bitcoin. Stacks (STX) is the native cryptocurrency of Stacks. STX is used to pay for transaction fees and execute smart contracts.


