# Kresko 101

{% hint style="warning" %}
The overall documentation is in process of being updated to match the latest protocol architecture.
{% endhint %}

## Introduction

Kresko is a non-custodial, capital-efficient synthetic asset protocol that runs on the EVM. It facilitates the creation and management of securely collateralized synthetic assets using smart contracts written in Solidity.&#x20;

The protocol allows [depositing](/kresko-docs/fundamentals/cdps/icdp/deposit) whitelisted [Collateral Assets](/kresko-docs/fundamentals/collateral-assets), the collateral is used to [mint](/kresko-docs/fundamentals/cdps/icdp/minting-borrowing) new [Kresko Assets](/kresko-docs/fundamentals/kresko-assets), incurring debt that locks partial or full value of the collateral. The debt is repaid by [burning](/kresko-docs/fundamentals/cdps/icdp/burn-repay) the minted Kresko Assets out of circulation, unlocking the collateral backing it.

This general model is a [collateralized debt position](/kresko-docs/fundamentals/cdps) (CDP). Kresko has two distinct CDP models complemented by the ability to acquire Kresko Assets outside borrowing, allowing anyone to engage in strategic action using a common ruleset and amplified liquidity.

### ICDP

An [individual collateralized debt position](/kresko-docs/fundamentals/cdps/icdp) (ICDP) allows an account to create new Kresko Assets. Each account has control over the management and risk of the position, meaning it can be isolated with a single collateral and debt asset, or a diverse strategy with multiple assets.

The same [minimum collateralization ratio](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio) and [liquidation threshold](/kresko-docs/fundamentals/liquidations#liquidation-threshold) applies to all positions. [Collateralization ratio](/kresko-docs/fundamentals/cdps#collateralization-ratio) of a position must be above the MCR to mint Kresko Assets, this ratio is directly increased by repaying debt or depositing more collateral.&#x20;

### SCDP

The [shared collateralized debt position ](/kresko-docs/fundamentals/cdps/scdp)(SCDP) allows different accounts to deposit into a single position. These pooled deposits are utilized as liquidity for zero-slippage swaps where Kresko Assets can be exchanged to an equal value of another Kresko Asset.

The position concentrates the liquidity of Kresko Assets while liquidity providers and traders avoid the downsides of a regular AMM, such as slippage, impermanent loss and fragmented liquidity. Accounts can participate in the SCDP as a depositor, trader and/or a liquidator.

### Synth Wraps

Kresko Assets can be directly created outside of a CDP if a reputable representation of the underlying asset exists on-chain. In this case, the underlying is "[synth wrapped](/kresko-docs/fundamentals/synth-wrap)" to an equal amount of the Kresko Asset, which can then be unwrapped by burning the Kresko Assets.

### KISS

Finally, the protocol includes a special stable asset, [KISS](/kresko-docs/fundamentals/kiss), to onboard stablecoins like USDC into the system without [overcollateralization](/kresko-docs/fundamentals/cdps#overcollateralization) or [liquidation](/kresko-docs/fundamentals/liquidations#liquidations) risk.

## What to do with these things?

For example, Kresko Assets borrowed using the ICDP can be exchanged to another Kresko Asset which translates to a short position on the borrowed asset.&#x20;

Conversely, using KISS or synth wraps to obtain Kresko Assets which are further swapped using the SCDP allows any Kresko Asset to be acquired without borrowing that can be used to eg. open a long position on an asset.

You can also provide liquidity into the SCDP which is incentivized from the fees paid by traders. Another option is to perform [liquidations](/kresko-docs/fundamentals/liquidations) in the protocol.

Further, a bit advanced use-cases are things like price arbitrage, hedging strategies and extending or using the protocol with your own smart contracts.

### Where can I do all this?

Interaction with the [protocol](/kresko-docs/contracts/deployment-addresses) happens using an user-interface, an API or just by directly by sending transactions into the blockchain network. The [core protocol](/kresko-docs/developers/contracts-overview) is open source allowing anyone to build public user-interfaces or other integrations that use the protocol.&#x20;

## Getting Started

Here is a list of topics to help understand how Kresko works.

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><strong>What is a CDP?</strong></td><td></td><td><a href="/pages/LdnTudI8KBb5swizNMbf">/pages/LdnTudI8KBb5swizNMbf</a></td></tr><tr><td></td><td><strong>What are Kresko Assets?</strong></td><td></td><td><a href="/pages/BgGN4blJBJTgtZCZwY8A">/pages/BgGN4blJBJTgtZCZwY8A</a></td></tr><tr><td></td><td><strong>What are Collateral Assets?</strong></td><td></td><td><a href="/pages/fKEDoocyHUr5rgKdnL0w">/pages/fKEDoocyHUr5rgKdnL0w</a></td></tr><tr><td><strong>Depositing Collateral</strong></td><td></td><td></td><td><a href="/pages/3Nx9SqOs6CX2Ljs4XSnz">/pages/3Nx9SqOs6CX2Ljs4XSnz</a></td></tr><tr><td><strong>Minting Kresko Assets</strong></td><td></td><td></td><td><a href="/pages/KWF5RReUHmY3YMujNIjS">/pages/KWF5RReUHmY3YMujNIjS</a></td></tr><tr><td><strong>Liquidations</strong></td><td></td><td></td><td><a href="/pages/guV8YvsEpsx8AwwdbL39">/pages/guV8YvsEpsx8AwwdbL39</a></td></tr><tr><td><strong>Withdrawing Collateral</strong></td><td></td><td></td><td><a href="/pages/RsurVIKWDrgvVGM70s9X">/pages/RsurVIKWDrgvVGM70s9X</a></td></tr><tr><td><strong>Repaying Kresko Assets</strong></td><td></td><td></td><td><a href="/pages/RAOVipqA2WWwQijCusCl">/pages/RAOVipqA2WWwQijCusCl</a></td></tr><tr><td><strong>KISS</strong></td><td></td><td></td><td><a href="/pages/sPhitHya8fovG7LkkaEk">/pages/sPhitHya8fovG7LkkaEk</a></td></tr></tbody></table>


# CDPs

Collateralized Debt Position

{% hint style="info" %}
**This documentation is a work in progress!**
{% endhint %}

A collateralized debt position (CDP) is a system introduced by MakerDAO team with their decentralized stablecoin DAI.&#x20;

Generally speaking it is a overcollateralized lending contract where borrowers [deposit](/kresko-docs/fundamentals/cdps/icdp/deposit) collateral and [borrow](/kresko-docs/fundamentals/cdps/icdp/minting-borrowing) assets against the deposited collateral. The contract itself acts as a counterparty when borrowers open a debt position.

Borrowers using these CDP's cannot [withdraw](/kresko-docs/fundamentals/cdps/icdp/withdraw) their collateral if it takes the CDP below the [minimum collateralization ratio](#minimum-collateralization-ratio) set in the contract.

### CDPs Act As Cross Positions In Kresko

One or more collaterals back each CDP and borrowers can take multiple debt positions on a single CDP. They effectively act as *cross-margined* positions with many-to-many collateralization as opposed to 1-to-1 positions also known as isolated margin.

### CDP Example&#x20;

{% hint style="success" %}
**Example**

* Collateral **DAI** has a cFactor of **1**. Oracle price **$1**
* Collateral **wBTC** has a cFactor of **0.8**. Oracle price **$15000**
* krAsset **krETH** has a krFactor of **1.1**. Oracle price **$1000**
* krAsset **krQQQ** has a krFactor of **1**. Oracle price **$200**
* Protocol MCR is **140%**

Bob deposits **1500 DAI** and **0.1 wBTC** as collateral

Calculating the [deposit values](/kresko-docs/fundamentals/collateral-assets#collateral-deposit-value)

1. **DAI:** $1500 \* 1 = **$1500**
2. **wBTC:** $150 \* 0.8 = **$120**

Bob's total collateral value is **$1620**

Bob sends a transaction to mint **1 krETH**&#x20;

Calculating the [debt value](/kresko-docs/fundamentals/kresko-assets#calculating-debt)

1. **krETH:** $1000 \* 1.1 = **$1100**

Total collateral Bob needs to cover this mint:&#x20;

$1100 \* 140% = **$1540**

As $1540 is less than $1620. Bob is a able to mint **1 krETH**

Bob wants to mint **1 krQQQ**

Calculating the debt value

1. **krQQQ:** $200 \* 1 = **$200**

Total collateral value Bob needs to cover this mint:&#x20;

($1100 + $200) \* 140% = **$1820**

We can see that Bob has insufficient collateral ($1620) to cover the mint so the transaction would **fail.**

{% endhint %}

## Overcollateralization

In simple terms this means that for any amount of [Kresko Asset](/kresko-docs/fundamentals/kresko-assets) to exist it must be backed by a [Collateral Asset](/kresko-docs/fundamentals/collateral-assets) deposit of equal or greater value.

The protocol needs to stay solvent, avoiding scenario where any CDP has a [Deposit Value](#collateral-deposit-value) less than its [Debt Value](#debt-value). Protocol ensures this by only allows borrows up to a portion of the collateral provided, enforced by [MCR](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio), [kFactor](/kresko-docs/fundamentals/kresko-assets#krfactor) and [cFactor](/kresko-docs/fundamentals/collateral-assets#collateral-factor). As asset valuations change over time, the final backstop for solvency is [liquidations](/kresko-docs/fundamentals/liquidations).

## Collateral/Deposit Value

The quantity, price, and the asset's collateral factor are used to determine the *deposit value* (v) of an individual collateral deposit. Deposit value enables the protocol to properly weight different collaterals and calculate the total deposit value of the assets in real-time.

Given a user’s collateral *a*, oracle price $$P\_a$$, quantity $$Q\_a$$, and collateral factor $$CF\_a$$, the deposit value $$v\_a$$ can be represented as follows:

$$
v\_a = Q\_a*P\_a*CF\_a
$$

{% hint style="success" %}
**Example**

If Alice has deposited 1,000 USDC, oracle price of 1 USDC = $1.01, CF for USDC = 0.99, then the deposit value can be calculated as follows:

$$
v\_{USDC} = 1,000 \* $1.01 \* 0.99 = $990
$$
{% endhint %}

### Total Deposit Value

For multiple collaterals, the *total deposit value* (V) is calculated by adding the deposit values of all the individual assets deposited.

Given *n* collaterals, a user’s total deposit value *V* is calculated as follows:

$$
V = \sum\_{i=i}^n v\_i = \sum\_{i=1}^n Q\_i \* P\_i \* CF\_i
$$

{% hint style="success" %}
**Example**

If Alice has deposited 1,000 USDC (v = $990), 1 ETH (v = $2,734.01), and 600 OP (v = $1,072.55), then the total deposit value is:

$$
V = $990 + $2,734.01 + $1,072.55 = $4,796.56
$$
{% endhint %}

## Debt Value

The quantity, price, and kFactor are used to determine the *debt value* (d) incurred by borrowing a Kresko Asset.

Given a borrower’s krAsset *b*, oracle price $$P\_b$$, quantity $$Q\_b$$, and krFactor $$krFactor\_b$$, the debt value $$d\_b$$ is calculated as follows:

$$
d\_b = Q\_b \* P\_b \* kFactor\_b
$$

{% hint style="success" %}
**Example**

Alice wants to borrow 1 krTSLA, Oracle price of 1 TSLA = $1,000, kFactor for TSLA = 1.05, then the debt is:

$$
d\_{krTSLA} = 1 \* $1,000 \* 1.05 = $1,050
$$
{% endhint %}

### Total Debt Value

For multiple Kresko Assets borrowed, the *total debt value* (D) is calculated by combining the debt values of each asset.

Given *n* krAssets, total debt *D* is:

$$
D = \sum\_{i=i}^n d\_i = Q\_i \* P\_i \* kFactor\_i
$$

{% hint style="success" %}
**Example**

if Alice has borrowed 1 krTSLA (d = $1,050), 1 krAAPL (d = $180), and 1.2 krIAU (d = $48), then the total debt is:

$$
D = $1,050 + $180 + $48 = $1,278
$$
{% endhint %}

{% hint style="success" %}
**Example**

If Alice has borrowed 1 krTSLA (d = $1,050), 1 krAAPL (d = $180), and 1.2 krIAU (d = $48), then the total debt is:

$$
D = $1,050 + $180 + $48 = $1,278
$$
{% endhint %}

## Collateralization Ratio

Collateralization Ratio (CR) for an account is obtained by dividing the combined collateral value *V* with outstanding combined debt value *D*.

$$
CR = \frac{V}{D}
$$

If Alice’s total deposit value is $4,806.46 and her total debt is $1,278, then her collateral ratio is

$$
CR = \frac{$4,806.46} {$1,278} = 3.7609 = 376.09%
$$

### **Minimum Collateralization Ratio**

Core risk mitigation of a CDP is the minimum collateralization ratio *(*&#x4D;CR). It is the minimum collateralization ratio that allows taking on new debt.&#x20;

{% hint style="info" %}
If a CDP's collateralization ratio is under the MCR It does **not** mean it can be liquidated.&#x20;

This is decided by the [Liquidation Threshold](/kresko-docs/fundamentals/liquidations#liquidation-threshold) instead.
{% endhint %}

The MCR is used to calculate a minimum [collateral value](/kresko-docs/fundamentals/collateral-assets#collateral-deposit-value) for that a CDP needs to back up it's total debt value.

{% hint style="success" %}
Minimum collateral value required

$$(cValue\_0 + ...+ cValue\_n) \* MCR$$
{% endhint %}

### Liquidation Threshold

Liquidation Threshold (LT) is a protocol parameter which holds the value for absolute minimum collateralization ratio. If the [Collateralization Ratio](/kresko-docs/fundamentals/cdps#collateralization-ratio) of an account is lower than the Liquidation Threshold, it can be liquidated by the liquidation functions in the protocol.&#x20;

The liquidation threshold is always lower or equal to the [MCR](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio). These two values are separate to allow creation of a safety window before accounts are in danger of being liquidated.

### **Health Factor**

[Collateralization Ratio](#collateralization-ratio) converted to a percentage.

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><strong>How borrowing works in Kresko</strong></td><td></td><td><a href="/pages/KWF5RReUHmY3YMujNIjS">/pages/KWF5RReUHmY3YMujNIjS</a></td></tr><tr><td></td><td><strong>How repayments work in Kresko</strong></td><td></td><td><a href="/pages/RAOVipqA2WWwQijCusCl">/pages/RAOVipqA2WWwQijCusCl</a></td></tr><tr><td></td><td><strong>How Withdrawals work in Kresko</strong></td><td></td><td><a href="/pages/RsurVIKWDrgvVGM70s9X">/pages/RsurVIKWDrgvVGM70s9X</a></td></tr></tbody></table>


# ICDP

Individual Collateralized Debt Position

{% hint style="warning" %}
This documentation is a work in progress!
{% endhint %}

An individual [collateralized debt position](/kresko-docs/fundamentals/cdps) allows an account to create new [Kresko Assets](/kresko-docs/fundamentals/kresko-assets). Each account has control over the management and risk of the position, meaning it can be isolated with a single collateral and debt asset, or a diverse strategy with multiple assets.&#x20;

<figure><img src="https://lh7-us.googleusercontent.com/Btg_yjHF-CTUqlSGMGsPz5iOIWwOku1gs-LzFZ4YTnk1nEjfmRgKkehXAAboPImtYyCxQr_I-xbVd2Mcfx3XygVDQ0z9aWLnHi_-WKbdcFrsHZgNybmfBoisCqRgu_yZ-xRbPxdrecON6ZsT8tzjIT4" alt="" width="563"><figcaption><p>Individual Collateralized Debt Position(s)</p></figcaption></figure>

The same [minimum collateralization ratio](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio) and liquidation threshold applies to all positions. Collateralization ratio of a position must be above the MCR to mint Kresko Assets, this ratio is directly increased by repaying debt or depositing more collateral.&#x20;

A [collateralization ratio](/kresko-docs/fundamentals/cdps#collateralization-ratio) below the MCR does not make a position liquidatable. This happens when the ratio is below the liquidation threshold, which is lower than the MCR.<br>


# Deposit

Adding collateral to an ICDP

{% hint style="warning" %}
**This documentation is a work in progress!**
{% endhint %}

{% hint style="success" %}
Depositing collateral will increase your [health factor](/kresko-docs/fundamentals/glossary).
{% endhint %}

In order to [mint](/kresko-docs/fundamentals/cdps/icdp/minting-borrowing) any [Kresko Asset](/kresko-docs/fundamentals/kresko-assets), account must have collateral value to back them. The value is gained by depositing any of the whitelisted [Collateral Assets](/kresko-docs/fundamentals/collateral-assets) into the protocol.&#x20;

This requires the user to give [Approval](/kresko-docs/fundamentals/glossary) for the protocol to transfer the tokens from the users wallet into the main protocol contract where they reside until the user [withdraws](/kresko-docs/fundamentals/cdps/icdp/withdraw) them or gets [liquidated](/kresko-docs/fundamentals/cdps/icdp/liquidations).

Unlike in minting, [burning](/kresko-docs/fundamentals/cdps/icdp/burn-repay) or withdrawals - *anyone* can deposit collateral for another account. Note that this is equal to **donation** if you are **not** controlling the account receiving the collateral.

{% hint style="info" %}
Each deposit will emit an event with relevant information

```solidity
/**
 * @notice Emitted when an account deposits collateral.
 * @param account The address of the account depositing collateral.
 * @param collateralAsset The address of the collateral asset.
 * @param amount The amount of the collateral asset that was deposited.
 */
event CollateralDeposited(address indexed account, address indexed collateralAsset, uint256 indexed amount);
```

{% endhint %}

## Conditions Preventing Depositing

### Safety State: Pause

In an emergency situation the [Safety Council](/kresko-docs/fundamentals/glossary) multisig can pause the depositing of a Collateral Asset to prevent possible negative impact it would have.&#x20;

### Kresko Asset Minimum Collateral Amount

For [Kresko Asset](/kresko-docs/fundamentals/kresko-assets#overview) [collaterals](/kresko-docs/fundamentals/collateral-assets#overview) the minimum deposit amount is 1e12 or 0.000001. Accounts must have collateral deposits greater than this amount if the collateral asset is a Kresko Asset.


# Withdraw

Getting collateral assets back to your wallet

{% hint style="warning" %}
**This documentation is a work in progress!**
{% endhint %}

{% hint style="info" %}
Withdrawing collateral will decrease your [health factor](/kresko-docs/fundamentals/glossary).
{% endhint %}

At some point you might want the deposited collateral back to your wallet. This is done by performing a withdraw from the protocol.

On withdrawals, the protocol performs checks on the user debt. This prevents withdrawals that would cause the [CDP](/kresko-docs/fundamentals/cdps)'s collateral ratio to get under the [MCR](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio). If the checks pass, protocol reduces the recorded collateral deposit amount for the user and transfer the amount of tokens requested to the user.

{% hint style="info" %}
Each withdrawal will emit an event with relevant information.

```solidity
/**
* @notice Emitted when an account withdraws collateral.
* @param account The address of the account withdrawing collateral.
* @param collateralAsset The address of the collateral asset.
* @param amount The amount of the collateral asset that was withdrawn.
*/
event CollateralWithdrawn(address indexed account, address indexed collateralAsset, uint256 indexed amount);
```

{% endhint %}

## Conditions Preventing Withdrawals

### Insufficient Collateral

If an account has existing debt, there is a [minimum collateral value](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio) required to back it up.&#x20;

If accounts collateral value is *smaller* than the minimum collateral value, the withdrawal is not permitted.

### Safety State: Pause

In an emergency situation the [Safety Council](/kresko-docs/fundamentals/glossary) multisig can pause the withdrawals of a Collateral Asset to prevent possible negative impact it would have.&#x20;

### Kresko Asset Minimum Collateral Amount

For [Kresko Asset](/kresko-docs/fundamentals/kresko-assets#overview) [collaterals](/kresko-docs/fundamentals/collateral-assets#overview) the minimum amount of collateral is 1e12 or 0.000001. So if you withdrawal ends up leaving dust lower than this amount, the transaction will revert.


# Burn / Repay

Repaying borrowed Kresko Assets of an ICDP

{% hint style="warning" %}
**This documentation is a work in progress!**
{% endhint %}

{% hint style="success" %}
Repaying debt is the most effective way to increase your [health factor](/kresko-docs/fundamentals/glossary).
{% endhint %}

As with [minting](/kresko-docs/fundamentals/cdps/icdp/minting-borrowing), the term burn comes from the ERC-20 standard and it refers to the process of decreasing the supply of a token.&#x20;

Repayment of debt in the [protocol](/kresko-docs/developers/contracts-overview) is done by a function which burns the amount repaid from the repaying accounts balance. This decreases the total supply of the Kresko Asset and decreases the protocol debt amount for the repaying account.&#x20;

Because the debt value for the asset within the protocol is reduced, the account is now able to [withdraw](/kresko-docs/fundamentals/cdps/icdp/withdraw) any collateral that was backing it.

{% hint style="info" %}
Each burn will emit an event with relevant information

<pre class="language-solidity"><code class="lang-solidity">/**
 * @notice Emitted when an account burns a Kresko asset.
<strong> * @param account The address of the account burning the Kresko asset.
</strong> * @param kreskoAsset The address of the Kresko asset.
 * @param amount The amount of the Kresko asset that was burned.
 */
event KreskoAssetBurned(address indexed account, address indexed kreskoAsset, uint256 indexed amount);
</code></pre>

{% endhint %}

## Conditions Preventing Repayments

Unlike minting, repayment of debt is not limited by the market status of the underlying asset but two situations exist where users wont be able to do so.

### Minimum Debt Value

Protocol has a USD-denominated lower limit that forbids tiny debt positions. This prevents spamming and ensures no dust positions form which could get annoying for the users themselves and troublesome for liquidators to process.

This means if the Minimum Debt Value is $10 and debt owed is valued $300, repaying $290.01 will not work. Repaying any amount less or equal to $290 or the full $300 will work.

### Safety State: Pause

In an emergency situation the [Safety Council](/kresko-docs/fundamentals/glossary) multisig can pause repayments for a Kresko Asset to prevent possible negative impact it would have.&#x20;


# Minting / Borrowing

Borrowing Kresko Assets using an ICDP

{% hint style="warning" %}
**This documentation is a work in progress!**
{% endhint %}

{% hint style="info" %}
Minting will decrease your [health factor](/kresko-docs/fundamentals/glossary).&#x20;
{% endhint %}

The term minting comes from the ERC-20 standard referring to the process of increasing the overall supply of the token. [Kresko Assets](/kresko-docs/fundamentals/kresko-assets) are minted when borrowed.&#x20;

The tokens are minted to the account requesting the debt as balance in the Kresko Asset contract. It is separately recorded for the user on the protocol as debt.

After minting, users are free to transact as they wish. In order to [withdraw](/kresko-docs/fundamentals/cdps/icdp/withdraw) the collateral backing the minted assets the user must [repay](/kresko-docs/fundamentals/cdps/icdp/burn-repay) the tokens by burning, removing them from circulation.

If the value of the Kresko Asset increases or decreases, so does the [debt value](/kresko-docs/fundamentals/cdps#debt-value) and the [collateral value](/kresko-docs/fundamentals/cdps#collateral-deposit-value) required to back it. When a borrowed asset is sold on eg. the [SCDP](/kresko-docs/fundamentals/cdps/scdp) it translates to a [**short position**](/kresko-docs/fundamentals/glossary)**.**

{% hint style="info" %}
Each mint will emit an event with relevant information

```solidity
/**
* @notice Emitted when an account mints a Kresko asset.
* @param account The address of the account minting the Kresko asset.
* @param kreskoAsset The address of the Kresko asset.
* @param amount The amount of the KreskoAsset that was minted.
* @param receiver Receiver of the minted assets.
*/
event KreskoAssetMinted(address indexed account, address indexed kreskoAsset, uint256 amount, address receiver);
```

{% endhint %}

## Conditions Preventing Minting

### Supply Limit

Each Kresko Asset has a configurable limit on it's total supply to allow controlled growth and to prevent malicious acts on existing liquidity.

### **Market Status**

If the liquidity for a [underlying asset](/kresko-docs/fundamentals/glossary) is primarily on a market that is closed the protocol will not allow minting of new assets.  This is automatic and the minting will open up when the market is open again.

### Minimum Debt Value

Protocol has a USD-denominated lower limit that forbids tiny debt positions. This prevents spamming and ensures no dust positions form which could get annoying for the users themselves and troublesome for liquidators to process.

### Safety State: Pause

In an emergency situation the [Safety Council](/kresko-docs/fundamentals/glossary) multisig can pause the minting of a Kresko Asset to prevent possible negative impact it would have.&#x20;


# Liquidations

{% hint style="warning" %}
**This documentation is a work in progress!**
{% endhint %}

Anyone can liquidate a [ICDP](/kresko-docs/fundamentals/cdps/icdp) under the [liquidation threshold](/kresko-docs/fundamentals/cdps#liquidation-threshold) by repaying [debt](/kresko-docs/fundamentals/cdps#debt-value) of the position, increasing its [Collateralization Ratio](/kresko-docs/fundamentals/cdps#collateralization-ratio). The repaid value, plus a liquidation incentive, is seized from the [collateral](/kresko-docs/fundamentals/cdps#collateral-deposit-value) and sent to the liquidator.&#x20;

The liquidator decides which [Kresko Asset](/kresko-docs/fundamentals/kresko-assets) to repay and the [Collateral Asset](/kresko-docs/fundamentals/collateral-assets) to seize in return.

## Liquidation Process

While a CDP’s collateral and debt can be composed of several assets, liquidations operate exclusively on **one debt asset and one collateral asset** at a time.

If the CR remains below the LT after a liquidation call, it is subject to additional liquidations up to the [Maximum Liquidation Ratio](/kresko-docs/fundamentals/liquidations#maximum-liquidation-ratio).&#x20;

## Example

{% hint style="success" %}

#### **Example**&#x20;

* The liquidation incentive is set at 5%&#x20;
* Close fee of the Kresko Asset is set at 0.5%.&#x20;

Liquidator repays $100 worth of debt.&#x20;

The seized collateral will be 105% of the repay value so the liquidator seizes $105 worth of collateral.&#x20;

The protocol receive the close fee of 0.5% which equals $0.5.
{% endhint %}


# SCDP

Shared Collateralized Debt Position

{% hint style="info" %}
This documentation is a work in progress!
{% endhint %}

The shared collateralized debt position (SCDP) allows different accounts to deposit [Collateral Assets ](/kresko-docs/fundamentals/collateral-assets)into a single position. These pooled [deposits](/kresko-docs/fundamentals/cdps/scdp/deposits) are utilized as liquidity for zero-slippage [swaps](/kresko-docs/fundamentals/cdps/scdp/swaps) where [Kresko Assets ](/kresko-docs/fundamentals/kresko-assets)can be exchanged to an equal value of another Kresko Asset.

## Use Cases

For example, Kresko Assets borrowed from an [ICDP](/kresko-docs/fundamentals/cdps/icdp) can be swapped to another Kresko Asset, translating to a short position on the borrowed asset. Conversely, using [KISS](/kresko-docs/fundamentals/kiss) or [synth wraps](/kresko-docs/fundamentals/synth-wrap) to obtain Kresko Assets for a swap allows any Kresko Asset to be acquired without borrowing.

## Reasoning

The shared position concentrates the liquidity of Kresko Assets while liquidity providers and traders avoid the downsides of a regular AMM, such as slippage, impermanent loss and fragmented liquidity.&#x20;

## Participants

Accounts can participate in the SCDP as a depositor, trader and/or a [liquidator](/kresko-docs/fundamentals/cdps/scdp/liquidations).

<figure><img src="https://lh7-us.googleusercontent.com/jV7CHiTTUL1H3N8FSbR-t8vWIXbVa19dd00GuXi4MUJR-quSSh0YADT8BHRY74L9HUfXr9VsCxNBOleJlMxNqyhzhm38sDFHWpzYbfUljd19WaQIuulL4pPSDD7MzwAU_skAFWejkLWoZIkoY-kqxbI" alt="" width="563"><figcaption><p>Shared Collateralized Debt Position </p></figcaption></figure>

## Risk

Most notable risk to the SCDP is depositors being unable to fully manage their risk, leaving them to rely on the protocols risk mitigation parameters. Since **depositors** **are the counterparty for each swap**, they bear the risk of adverse selection and rapid changes to the [debt composition](/kresko-docs/fundamentals/cdps#total-debt-value) which might lead into liquidations. Because of this, the protocol is committed to align the incentives as such.

To mitigate risk of the depositors, the [MCR](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio) used for the SCDP has a large difference to the [liquidation threshold](/kresko-docs/fundamentals/cdps#liquidation-threshold). As collateral is utilized by arbitrary trading and [depositors](/kresko-docs/fundamentals/cdps/scdp/deposits) can [withdraw](/kresko-docs/fundamentals/cdps/scdp/deposits#withdrawals) any non-utilized collateral, it shouldn’t be a concern to hit the MCR. \ <br>


# Deposits

Providing liquidity in the SCDP

{% hint style="warning" %}
**This documentation is a work in progress!**
{% endhint %}

Shared deposits of the SCDP back debt accrued from [swaps](/kresko-docs/fundamentals/cdps/scdp/swaps), meaning they can be fully or partially locked at any given time. When the collateral is not used as backing anymore, it can be fully [withdrawn](#withdrawals).

Deposits increase the overall [collateralization](/kresko-docs/fundamentals/cdps#overcollateralization) of the global position. Each whitelisted [Collateral Asset ](/kresko-docs/fundamentals/collateral-assets)is configured with a deposit limit. All collaterals use the same [cFactor](/kresko-docs/fundamentals/collateral-assets#collateral-factor) configuration as the [ICDP](/kresko-docs/fundamentals/cdps/icdp).

{% hint style="info" %}
SCDP has very limited collateral assets compared to the ICDP.
{% endhint %}

## Depositing Collateral

Deposits work the same way as in the ICDP for the participators. Under the hood assets are transferred from depositors wallet balance and marked as principal deposits for the depositor, after which the global deposit are incremented.&#x20;

## Yield

The main reason depositors would want to participate in this system is because all asset [swaps incur a fee](/kresko-docs/fundamentals/cdps/scdp/swaps#fees) paid by the account performing the swap. A configurable portion of this fee is distributed instantly to the depositors within the swap transaction itself. Fees are distributed as the same asset they have deposited.&#x20;

{% hint style="success" %}
Fees can be claimed separately, they are also claimed with any deposit or withdraw.
{% endhint %}

Fee distribution in the deposit asset is achieved through an additional conversion step where the fee amount is converted into the configured fee asset. At the time of writing, the system only supports **one fee asset** at a time.

<figure><img src="https://lh7-us.googleusercontent.com/m2nLVBj4q1RKM3kOb01MA_7S9n02m-F6IUT_uMuD39DL3RM1nZ_0b8CojNH2X6strSKvvmjgSxjRTMG74h6Ag_v_KyiOhrItXjruxnlWYmRe8Xj4Edu71Q-prXJRn55-WrYAjnFCYVbi7fG3CglyiGk" alt="" width="563"><figcaption><p>Distribution of the swap fee</p></figcaption></figure>

### Liquidations and Yield

A conscious choice was made that fees distributed to depositors are not used as collateral which means they are not subject to liquidations and can be withdrawn regardless of the withdrawal capacity.&#x20;

This has one drawback which is that compounding does not happen automatically. Accounts must re-deposit these fees themselves. Automatic compounding can be achieved by using external automation like a keeper service or custom scripts.

## Withdrawals

When an account deposits into the [SCDP](/kresko-docs/fundamentals/cdps/scdp), they allow traders to utilize it. This means that when debt exists deposits can only be withdrawn up to the [MCR](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio). Further withdrawals have to wait for more collateral deposits or debt to be repaid by swaps.

<figure><img src="https://lh7-us.googleusercontent.com/vAGcTJQ3U5mJ5_MVSRv96B2P3NOVOG5G7jFCzLIQ3zZWD3ORkhOcFfYxMIfVR2j8ixULVrSb0osMK6YvUOGrsy0bVaWT0HDR_vGd1tICoGCspct_QqrOb-uzBldlWpCyhgN8uSAz4Lw9Mvhey-3uCZ0" alt="" width="563"><figcaption><p>Depositors cannot withdraw all deposits when debt exists</p></figcaption></figure>

<br>

<br>


# Swaps

Native exchange of Kresko Assets

{% hint style="info" %}
**This documentation is a work in progress!**
{% endhint %}

[Collateral value](/kresko-docs/fundamentals/cdps#collateral-deposit-value) available in the [SCDP](/kresko-docs/fundamentals/cdps/scdp) is utilized by accounts swapping their [Kresko Assets](/kresko-docs/fundamentals/kresko-assets) for an equivalent value of another Kresko Asset, minus a [fee](#fees).&#x20;

The account receives the desired Kresko Assets either as newly minted ones – incurring debt to the SCDP – or from available protocol owned collateral resulting from prior exchanges.&#x20;

The assets provided by the trader in a swap contribute to repaying any outstanding debt tied to the specific asset.&#x20;

<figure><img src="https://lh7-us.googleusercontent.com/c7-s7P0EIK18IIXjLSLmLBtBJXKrTEJFZ5MGUN2XeRHAvt-yHjDcvV8_RczAahVWQrLHCxC-LVrAzj5ovk3ivTazxhcjCh5HwLPuq02tBgQhrgMDgh9_esPFEugqDF6vEhZBOBE6lOY6QNtmkbYrBH8" alt="" width="563"><figcaption><p>Swap creating protocol owned collateral and new debt</p></figcaption></figure>

### Protocol Owned Collateral

In the scenario where the asset has no existing debt, the provided assets become temporary deposits within the SCDP, marked as protocol owned collateral.&#x20;

<figure><img src="https://lh7-us.googleusercontent.com/gB9JYnTymSm2kh0JQ1BNR4mXY9davyS-k-uGAESxAkzCaTddI1ZSNIJkmffVPdyo-hWOHh_D_81DwPvWBYKfBE5dpyMON6_4QVtBxg_O62PbGNDk3eX6_Q7o1mQbiGfR27eh6kGiEfSM86d-untuH2U" alt="" width="563"><figcaption><p>Subsequent swap uses the protocol owned collateral and repays the debt</p></figcaption></figure>

This temporary deposit serves as valid collateral subject to liquidation and a reservoir for subsequent swaps, offering an alternative to minting new assets and enhancing the efficiency of the protocol's capital utilization.

## Fees

Swap fees are configured **per asset and direction**, thus the final fee percentage depends on the asset pair and direction taken.

{% hint style="success" %}
Fees are not used as collateral and can be claimed at any time. They cannot be seized in a liquidation.&#x20;
{% endhint %}

<figure><img src="https://lh7-us.googleusercontent.com/d2EVCl9DXYtr9mZ3bCCzgw69Lof0LikIGfxh-wBarF84lPknSKj040-hAUgRDONXuqp5akzHBOLyfWJlOy2X29mK_6QfvyFmHhftT6ddBAtFi89n9vkkJBvl0TOrzoYar9ZN6U99GUJIzPio7plQ5Ro" alt="" width="563"><figcaption><p>Configuration of two Kresko Assets and the resulting fee distribution</p></figcaption></figure>

<br>

<br>


# Liquidations

{% hint style="info" %}
**This documentation is a work in progress!**
{% endhint %}

If the[ collateralization ratio](/kresko-docs/fundamentals/cdps#collateralization-ratio) of the SCDP falls below the [liquidation threshold](/kresko-docs/fundamentals/cdps#liquidation-threshold), anyone can repay [debt owed](/kresko-docs/fundamentals/cdps#debt-value), seizing an equal value plus incentive from the [deposits](/kresko-docs/fundamentals/cdps#collateral-deposit-value). Any [protocol owned collateral](#protocol-owned-collateral) is seized before [depositor](/kresko-docs/fundamentals/cdps/scdp/deposits) assets.&#x20;

The liquidation is incentivized by a configured liquidation incentive percentage for each debt asset. It increases the seized value when the asset is repaid in a liquidation. This compensates the liquidator for the effort while enabling control on the assets likely to be repaid.

The seized value is equally reduced from each depositors, eg. if a liquidation seizes **10%** of all collateral, each depositor loses **10%** of their principal deposit.

<figure><img src="https://lh7-us.googleusercontent.com/V6wkxc6Rcl3md3Sxc5zmmmWYNqqbPVoWbaF0WEtkgQqvrhinHq0U29McpWm4DZctUQjfshtWZSDJmUGPrHDHLw_wxDJ5e3uMjX1A0ghAgFtxOGf3fTalWlrUyRu6z--WGnYnvPGf25K9ycW89n7Cn9I" alt="" width="563"><figcaption><p>Example maximum liquidation with protocol owner collateral and 160% MLR.</p></figcaption></figure>

Similar to [ICDP liquidations](/kresko-docs/fundamentals/cdps/icdp/liquidations), the liquidator can arbitrarily decide which [Kresko Asset](/kresko-docs/fundamentals/kresko-assets) to liquidate and which [Collateral Asset](/kresko-docs/fundamentals/collateral-assets) to seize.

## Cover

In addition to liquidations the SCDP has another mechanism of increasing collateralization. Cover is the act of providing any whitelisted assets to balance out the Debt Index value by reducing the overall debt value.&#x20;

### Cover Threshold&#x20;

Threshold after which Cover is incentivized, up to Cover Threshold itself, it is above the [LT](/kresko-docs/fundamentals/cdps#liquidation-threshold) but below the [MCR](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio).

### Cover Incentive&#x20;

Incentive percentage for providing Cover

#### Non-Incentivized / Incentivized

This action can be performed non-incentivized at any time. Cover Incentive is only active when the global position is under the configured Cover Threshold.

### Reasoning

Purpose of this mechanism is to add an additional layer of depositor safety before actual liquidations are needed. Depending on the whitelisted assets it can also be used to almost completely hedge out the debt composition which is an area for further investigation.

<br>


# Collateral Assets

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><strong>Depositing Collateral</strong></td><td></td><td><a href="/pages/3Nx9SqOs6CX2Ljs4XSnz">/pages/3Nx9SqOs6CX2Ljs4XSnz</a></td></tr><tr><td></td><td><strong>Withdrawing Collateral</strong></td><td></td><td><a href="/pages/RsurVIKWDrgvVGM70s9X">/pages/RsurVIKWDrgvVGM70s9X</a></td></tr></tbody></table>

## Overview

Collateral Assets can be deposited into the protocol to enable borrowing Kresko Assets against the value of the deposit. Each Collateral Asset has two [oracle providers](/kresko-docs/fundamentals/oracles) keeping the protocol updated with the most recent market information about it.

## Collateral Asset Types

The following is an example list of possible collateral assets:

* `Native Cryptocurrencies` Existing digital assets available within the relevant blockchain ecosystem such as ETH.
* `Stablecoins` Assets pegged to a stable fiat currency, such as USDC, DAI, or USDT.
* `Wrapped Cryptocurrencies` Wrapped tokens representing another cryptocurrency eg. wBTC WETH.
* `Synthetic Assets` Some Kresko Assets can also be supplied as collateral.
* `Liquid Staking Derivatives`  Popular liquid staking tokens eg. stETH, rETH

## Criteria

Initially the protocol founding team has decided a list of assets to include but later on new collaterals can be added using a governance module.&#x20;

Collateral Assets in the protocol can basically be any ERC-20 token with following properties

* Has value.&#x20;
* Sufficient on-chain liquidity.
* Good reputation.
* Price feeds available from supported oracle networks.
* Does **NOT** have a fee-on-transfer mechanism. This is subject to change later on.

{% hint style="info" %}
Kresko Asset can also be whitelisted as a Collateral Asset.
{% endhint %}

## **Collateral Factor**

Collateral Factor (CF) is a value for each collateral based on its risk profile. Generally, the higher the volatility of an asset, the higher the risk.&#x20;

It is a fraction between 0 and 1 that is used to calculate the risk-adjusted valuation of deposited collateral.  Given an asset *a*, CF can be represented as follows:

$$
CF\_a = \[0,1]
$$

{% hint style="info" %}
A *Collateral Factor* of **1** means the protocol values the Collateral Asset in full when calculating a [CDP](/kresko-docs/fundamentals/cdps)'s total collateral value.
{% endhint %}

### Collateral Factor Example

{% hint style="success" %}
**Example**

* Collateral DAI has a cFactor of **1**. Oracle price **$1**
* Collateral wBTC has a cFactor of **0.8.** Oracle price **$15000**

Bob deposits 100 DAI as collateral currently worth $100&#x20;

Bob does another deposit with 0.1 wBTC currently worth $1500

Calculating the individual deposit values:

1. **DAI** = $100 \* 1 = **$100**
2. **wBTC** = $1500 \* 0.8 = **$1200**

Protocol will consider Bobs total collateral value as:

$1200 + $100 = **$1300**
{% endhint %}


# Kresko Assets

The synthetic asset in Kresko

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><strong>Minting Kresko Assets</strong></td><td></td><td><a href="/pages/KWF5RReUHmY3YMujNIjS">/pages/KWF5RReUHmY3YMujNIjS</a></td></tr><tr><td></td><td><strong>Burning Kresko Assets</strong></td><td></td><td><a href="/pages/RAOVipqA2WWwQijCusCl">/pages/RAOVipqA2WWwQijCusCl</a></td></tr></tbody></table>

## Overview

A synthetic asset or Kresko Asset in the protocol is a derivative tracking the price of another asset or group of assets. This exposes the holder to an external asset without owning it. New Kresko Assets are [minted](/kresko-docs/fundamentals/cdps/icdp/minting-borrowing) as regular ERC-20 tokens and can be freely used outside of the protocol.

Each Kresko Asset is evaluated, deployed and configured separately. One asset could be swappable in the [SCDP](/kresko-docs/fundamentals/cdps/scdp) but not mintable from the [ICDP](/kresko-docs/fundamentals/cdps/icdp), or one is [depositable](/kresko-docs/fundamentals/cdps/icdp/deposit) as [collateral](/kresko-docs/fundamentals/collateral-assets) into an ICDP while another is not.

{% hint style="warning" %}
Kresko Assets reflect the value of the underlying only within the core synthetic asset protocol.&#x20;

There are no guarantees for Kresko Assets to have any value elsewhere.
{% endhint %}

## **Types of Kresko Assets**

* **Stocks, ETFs:** Assets traded on traditional exchanges. eg. AAPL, TSLA, QQQ.
* **Commodities:** Commodities such as gold, silver, and oil. eg. IAU, USO.
* **Synthetic Assets:** Synthetic representation of other cryptoassets eg. ETH, BTC.
* **Indices, Rates**: eg. Combining multiple assets with different weights, ETH volativity, BTC borrow rate.

## Stock Splits and Stock Merges

Kresko Assets handle stock splits and merges gracefully. Asset balances can be rebased using a positive or a negative rebase index. This adjustment instantly reflects in the account balances and protocol valuations and no user action is required.

## Dividends&#x20;

The synthetic assets created through the protocol do not pay any dividends.

## What can I do with them?

Fundamentally they offer a permissionless way to invest or speculate in the value of the underlying asset with minimal counterparty-risk. This makes financial markets accessible for users with  otherwise restricted and/or untrustworthy access.

Here are a few common use-cases:

### Speculative

For example, Kresko Assets borrowed using the ICDP can be exchanged to another Kresko Asset which translates to a short position on the borrowed asset.&#x20;

Conversely, using KISS or synth wraps to obtain Kresko Assets which are further swapped using the SCDP allows any Kresko Asset to be acquired without borrowing that can be used to eg. open a long position on an asset.

### Hedge

Using Kresko Assets you can easily hedge a position elsewhere. Simply having a short position in the synthetic asset and a long position for the underlying at the same time can be used to manage risk according to the ratio of positions.

### Liquidity

You can also provide liquidity into the SCDP which is incentivized from the fees paid by traders. Alternatively, anyone can bootstrap liquidity for the Kresko Asset in an external AMM like Uniswap.

### Other

Another option is to perform the [liquidations](/kresko-docs/fundamentals/liquidations) in the protocol. Further, a bit advanced use-cases are things like price arbitrage, extending or using the protocol with your own smart contracts.

{% hint style="success" %}
Kresko Assets can also be whitelisted as a [Collateral Asset](/kresko-docs/fundamentals/collateral-assets).&#x20;

Liquidity Providers can use this to create a [delta neutral CDP](/kresko-docs/fundamentals/glossary) in the protocol to greatly mitigate price-risk when providing external liquidity.
{% endhint %}

## **kFactor**

Protocol values each Kresko Asset separately based on its risk profile. The higher the volatility of an asset, the higher the risk.&#x20;

The *kFactor* is a number between 1 and infinity that is used to calculate the risk-adjusted valuation of a Kresko Asset. It shows the debt taken to borrow $1 worth of a Kresko Asset.

{% hint style="info" %}
kFactor is a premium applied to the collateral required for borrowing, it is higher for riskier Kresko Assets.
{% endhint %}

Given a Kresko Asset *a*, kFactor can be represented as:

$$
kFactor\_a = \[1, ∞]
$$

Additionally, kFactor can be used to encourage (i.e., by setting low kFactor) or discourage (i.e., by setting high kFactor) borrowing of certain Kresko Assets based on the needs of the protocol.

## Open Fee

A configurable parameter for each Kresko Asset which is used to deduct a fee when borrowing Kresko Assets. This fee is taken from the collateral deposits in **Last In-First Out** order and is transferred to the fee recipient address set in the protocol.

It must be within 0-10%.&#x20;

## Close Fee

A configurable parameter for each Kresko Asset which is used to deduct a fee when repaying Kresko Assets. This fee is taken from the collateral deposits in **Last In-First Out** order and is transferred to the Fee Recipient address set in the protocol.

It must be within 0-10%.

For example, if a borrower repays $100 worth of krAsset and the repayment fee is 1.5%, then the protocol collects $1.50 worth of repayment fee from the collateral.


# KISS

Stable Valued Kresko Asset

{% hint style="warning" %}
**This documentation is a work in progress!**
{% endhint %}

KISS exists to allow a capital efficient entrypoint for stablecoins like USDC without the drawbacks of a CDP system such as [overcollateralization](/kresko-docs/fundamentals/cdps#overcollateralization) and [liquidations](/kresko-docs/fundamentals/liquidations#liquidations). This is similar to [synth wraps](/kresko-docs/fundamentals/synth-wrap) of [Kresko Assets](/kresko-docs/fundamentals/kresko-assets), but it supports multiple assets instead of one.

## Vault

It is created through a vault mechanism where one or more external assets are deposited to receive an equal value of vault shares, represented as token balance. The shares can be burned out of circulation to receive an equal value of the deposits in return.

The deposits are pooled together, which means that there is no account level bookkeeping of deposits. Instead, withdrawal and redeem interactions can arbitrarily pick the deposited assets received in return of burning vault shares.&#x20;

The vault keeps track of the total value of all deposited assets and outputs an exchange rate for a single share. The rate is calculated from the total deposit value divided by total supply of vault shares. This means that deposit or withdrawal interactions do not directly affect the exchange rate since the inflow and outflow of value is always matched by equal value of shares.

The exchange rate $$\text{R}$$ of one vault share $$\text{V}$$ is calculated by dividing the total deposit value with the total supply of shares $$\text{T}^{s}$$:

$$
\text{R} = \frac{V}{T^{s}}
$$

### Target Price

The vault uses a constant target price per share when no shares yet exist. This price is defined with 18 decimal places and the same decimal precision is used for the exchange rate after the initial shares are minted. In the case of KISS this target price would be **$1**.

### Multiple Deposit Assets

If DAI and USDC were the deposit assets in a vault, a share would represent them both:

<figure><img src="https://lh7-us.googleusercontent.com/siR8Np5fXeK58W7315VrO21ykapRxHclUzk2pt5clCAl1HnupW6tVacaFL9oISMeqqa88wbTewiBGJv3Wv14xJNPFDkLUv4ZhPYKT2H1c-uewbf0e_8kD647JTDAGpPHuUuPWuIzggIYrcl1QIgSGpw" alt="" width="563"><figcaption><p>Initial deposits to a vault with DAI and USDC.</p></figcaption></figure>

This would expose the vault to two different assets eg. users depositing DAI would lose value if USDC fell in price:

<figure><img src="https://lh7-us.googleusercontent.com/otcQg_6NyooKUedLtueS36zodKHunrO4ck50uBZBALm8BA1e-eZlUIt06SkBvGcyAv_sb3azvSrvSkslNscmYuKTJs5LRY2AoslQRpDr3M-NVHchlVjC2HTyzYjQaHv-V25v-74t2gQRFa5jBzzzNRY" alt="" width="563"><figcaption><p>Subsequent withdrawal of shares after USDC price fell.</p></figcaption></figure>

## KISS Vault

KISS has its own vault contract, the KISS vault. It only accepts stablecoin deposits, which could be eg. bridged USDC and native USDC, this would mean KISS mirrors USDC.&#x20;

<figure><img src="https://lh7-us.googleusercontent.com/RHBqRX11bZo8A-o0lkSeYcW7lZT-1An2bwoKc5ZhnAEF0Lb_pNTuCFvARK6ZSvCMUKtoLSFfYfAMfsjZJehOQQdFcKt5mS2__bbnznP7aN2PW2WUIyrvI3WSHOuiMKP1N6BAtHHuhK5J3sg5PscNyjc" alt="" width="563"><figcaption><p>Initial deposit scenario using $1 target price per share.</p></figcaption></figure>

<figure><img src="https://lh7-us.googleusercontent.com/lcKGy38n-EIvMEb9qOYDFi1BVBkD3hwsaHQLqymuaWtTM-Q0Kc8vigr2oYOoOe8j5hm_EE4Ups19y3E5BsKMo45teszx7WmKAE8UrDtwp5sJbyDsR9IGrhzLZnw6ewkC5dYa7sZnhayVONFPUYtJvog" alt="" width="563"><figcaption><p> USDC price falling to $0.5 has no effect on withdrawal amounts since the vault only consists of USDC deposits.</p></figcaption></figure>

The vault share itself is a regular ERC-20 token. In the case of KISS it is wrapped into a Kresko Asset compatible smart contract which also integrates with the vault for interoperability purposes.&#x20;

## KISS Price Oracle

Side effect of this design is that the price oracle for KISS is simply the exchange rate of one vault share,  meaning 1 KISS vault share = 1 KISS. This is different to similar systems like GHO (Aave, 2022) or DAI where a static $1 is used.&#x20;

<br>


# Synth Wrap

Direct wraps between the underlying and a Kresko Asset

{% hint style="warning" %}
This documentation is a work in progress!
{% endhint %}

Whenever an underlying asset has an reputable representation on-chain it can be enabled for direct wraps between the [Kresko Asset](/kresko-docs/fundamentals/kresko-assets), which is called a Synth Wrap.

Similar to how the [vault](/kresko-docs/fundamentals/kiss#vault) enables capital efficient entry point for stablecoins through [KISS](/kresko-docs/fundamentals/kiss), the synth wrap enables a capital efficient entry point for underlying assets with on-chain representations.&#x20;

## Use Cases

This enables accounts to directly trade with them using the [SCDP](/kresko-docs/fundamentals/cdps/scdp) and liquidators can perform [liquidations](/kresko-docs/fundamentals/liquidations) without opening a separate [ICDP](/kresko-docs/fundamentals/cdps/icdp) position.

## Examples

Simplest examples of this would be allowing Ether or Wrapped Ether to be directly converted into a Kresko Asset representing Ether.

<figure><img src="https://lh7-us.googleusercontent.com/valYAAK3gIExL_NtR57jVwDZ1M_Sff9Jkwc4UNr6al9ySl2l7Uy1hGylni1GE7m3Oy4zHZJa56aoNB5__V8B7YM2vea7pohg1_9DCtsgdL1xB0s_OKQvGZlYng3vH-gHH1K7WE4nKD4ANkKDUTH68sA" alt="" width="563"><figcaption><p>Creating 1 krETH with 1 Wrapped Ether.</p></figcaption></figure>

<figure><img src="https://lh7-us.googleusercontent.com/I9HfGTa_GHX3NqT8Vx0Jyy66rJW3t2gwF4v9jiGZZXt7PIbDkDuoUHNlDqvo5rnMfWyIZ9KooDd_xq_me_ficz_gVX3JQlK5p_dq7ac9P-KPPA6kNRc1t64KsSezteXuTstMwIEeuSM9lVpa0BCjDNQ" alt="" width="563"><figcaption><p>Burning 1 krETH to receive the previously wrapped 1 Wrapped Ether.</p></figcaption></figure>

## Fees

The wrapping is configurable with a separate fee percentage for both directions which is similar to the open and close fee in the ICDP.


# Liquidations

Protocol solvency protection

{% hint style="warning" %}
**This documentation is a work in progress!**
{% endhint %}

## **Liquidations**

Anyone can liquidate a position under the [Liquidation Threshold](#liquidation-threshold) by repaying debt of a position, increasing its [Collateralization Ratio](/kresko-docs/fundamentals/cdps#collateralization-ratio). The repayment value, plus a liquidation incentive, is seized from the collateral deposits and sent to the liquidator. The liquidator decides which asset to repay and the collateral asset to seize in return.

It is the final backstop for protocol **solvency,** ensuring all [CDPs](/kresko-docs/fundamentals/cdps) are [overcollateralized](/kresko-docs/fundamentals/cdps#overcollateralization). A CDP with collateral ratio below the liquidation threshold is considered *underwater* and subject to liquidation. The protocol incentivizes anyone to perform these liquidations, as it does not do so itself.

Liquidation incentives are added into the seized value during a liquidation, this value is taken from any of the deposited collateral assets in the position. &#x20;

{% hint style="info" %}
Anyone can perform liquidations in the protocol. [Learn more](/kresko-docs/developers/liquidations)
{% endhint %}

## ICDP & SCDP&#x20;

Both CDP models have their own liquidation process, the difference being that [ICDP liquidations](/kresko-docs/fundamentals/cdps/icdp/liquidations) are targeting the assets of an account while the [SCDP liquidation](/kresko-docs/fundamentals/cdps/scdp/liquidations) targets the pooled assets.&#x20;

### Maximum Liquidation Ratio

The maximum collateralization ratio (MLR) defineds the maximum collateralization ratio the position ends up in after a liquidation. This is equal or higher than the LT. It limits the seizable value to the minimum required to prevent unnecessary large liquidations.

### Maximum Liquidatable Value

The protocol limits liquidations by calculating a maximum liquidatable value (MLV) for a CDP. The value is derived from the [MLR](#maximum-liquidation-ratio), resulting in the liquidated CDP's [collateralization ratio](/kresko-docs/fundamentals/cdps#collateralization-ratio) being equal to the MLR after the liquidation.

###


# Oracles

{% hint style="info" %}
**This documentation is a work in progress!**
{% endhint %}

## **Price Feeds**

The protocol needs the live USD denominated price for all [Kresko Assets](/kresko-docs/fundamentals/kresko-assets#overview) and [Collateral Assets](/kresko-docs/fundamentals/collateral-assets). This task is performed by an oracle network. These oracle networks are the off-chain information source for price data to the protocol.&#x20;

Kresko protocol uses a combination of **push** and **on-demand** oracles to consume price data.&#x20;

## Asset Valuations

The protocol denominates all values in USD. The prices are obtained from one or more oracle providers which determine the price from multiple sources.

Each asset has a primary and a reference price source which correspond to different oracle networks. Deviation is measured before **using the primary price**.&#x20;

If the deviation is higher than the configurable percentage threshold, any action is rejected, which is also the case for a stale or missing price and when a L2 sequencer is down.&#x20;

## Supported Oracle Networks

Currently the protocol uses two oracle networks: **Pyth** and **Chainlink.** Additionally it supports **Redstone** and **API3** as alternatives.

## Push Oracles

Traditional price feeds provided by eg. [Chainlink](https://chain.link) (except their new [Data Streams](https://docs.chain.link/data-streams)) work by having their network validate and transmit the aggregated price information from multiple reputable data sources to an on-chain contract where it can be consumed by the protocol.

## On-Demand Oracles

Oracles like [Redstone](https://redstone.finance/), [Pyth](https://pyth.network/) and Chainlink Data Streams use a different mechanic to allow consuming of validated data. Instead of on-chain contract having its storage continously updated with transactions containing the fresh data, the data (eg. price) is signed by the oracle networks validator set and appended into each user transaction that needs it. The appended data and its signers are validated on-chain.

{% hint style="info" %}
Kresko expects a valid price from atleast one push and one on-demand oracle provider.

**Price Deviation**&#x20;

* The protocol contains a **deviation percentage** which serves as a comparison point between the oracle providers.
* If the two prices differ from each other more than this percentage, the transaction taking place will be **reverted**.

**Unexpected scenarios**

* In the case of a sequencer being down on Optimistic Rollups like Arbitrum or Optimism, the protocol will accept on-demand oracle prices exclusively.&#x20;
* In the case of either oracle posting a 0 price, the other oracle price is used.
  {% endhint %}

## Market Status

The protocol also needs a boolean value indicating whether the underlying assets market is open for a Kresko Asset. When the market of the underlying asset for a Kresko Asset is closed, [borrowing](/kresko-docs/fundamentals/cdps/icdp/minting-borrowing) will be disabled. When the market re-opens, borrowing is automatically enabled.&#x20;

### Traditional Finance Assets

Assets such as **stocks**, **commodities**, and **ETFs** typically trade on exchanges whose markets trade only during normal market hours. For instance, TSLA listed on NASDAQ trades between 9:30 am and 4 pm (Eastern Time) on weekdays only. It doesn’t trade on weekends or on market holidays.

### **Crypto assets**&#x20;

For crypto assets, price feeds are generally available 24/7 throughout the year.


# Glossary

{% hint style="danger" %}
**This documentation is a work in progress!**
{% endhint %}

**Automated Market Maker** —  Smart contract that allows accounts to provide liquidity which enables anyone to swap between these tokens using a constant function formula. &#x20;

**AMM** — Shorthand for Automated Market Maker.

**AMM Oracle** — On-chain oracle that gets the price information from an AMM liquidity pool, almost always returning a TWAP instead of the exact price.

**Arbitrage** — Act of making a simultaneously buying and selling an asset on different markets with different prices.

**Approval** — Giving another address the permission to transfer tokens on your behalf.

**Borrower** —  Account that creates a collateralized debt position (CDP) by depositing collateral and borrowing synthetic assets from the protocol.&#x20;

**Borrow Capacity** —  Collateral value available (for user) to borrow kresko assets before reaching the MCR.&#x20;

**Burn** —   Destruction of existing tokens, decreases the circulating supply.

**Close Fee** —   Primary percentage fee taken by the protocol on repayment of debt. Must be within 0-10%. Assigned separately for each Kresko Asset.

**cFactor** —  Shorthand for Collateral Factor

**cValue** —  Collateral value adjusted by the cFactor.

**Collateral** —   Something of value provided as a guarantee of debt repayment.

**Collateral Asset** —  Assets that can be deposited into the protocol as collateral for minting Kresko Assets.

**Collateral Deposits** —  All Collateral Assets of an account deposited into the Kresko protocol.

**Collateral Factor** —   Multiplier used for risk adjusted valuation of collateral assets.

**Collateralized Debt Position** —  Position where user locks collateral to be able to generate debt against it.

**Collateral Ratio** —   Ratio of collateral value to debt.

**Deposit**  —   The act of transferring ERC-20 tokens into the Kresko protocol to gain collateral value.

**Delta Neutral Position**  —   Multiple positions with balancing positive and negative deltas so the overall delta is zero, resulting in unchanged combined value by regular price movement.

**Diamond**  —   Smart contract proxy pattern that uses multiple scoped implementation contracts.

**Diamond Cut**  —    Core function in a diamond proxy pattern that performs addition, replacement and removal of facets inside a diamond proxy.

**Diamond Storage**  —    Smart contract storage pattern that uses a randomized position for storage to live inside a contract to avoid clashing while allowing scoping and upgradeability.&#x20;

**Facet** —    Smart contract used by a diamond proxy that exposes the actual functions for end-user consumption.

**Fee Recipient** —    Address where all protocol fees are sent.

**Health Factor** — Collateralization Ratio converted into percentage.

**Helper Contract** — Smart contract that usually performs multi-transaction flows in a single transaction on behalf of the user.&#x20;

**krFactor** — Multiplier used for risk adjusted valuation of Kresko Assets.

**kValue** —  Debt value adjusted by the krFactor.

**Kresko Asset** —  Synthetic asset that can be minted from the Kresko protocol.

**krAsset** —  Shorthand for Kresko Asset

**KISS** —  Primary stable value asset that can be minted and deposited within the Kresko Protocol.&#x20;

**Leverage** — Act of borrowing to make more investments.

**Long Position** —   Buying an asset with the expectation it will appreciate in value.

**Liquidaton** —   Forced repayment of a unhealthy debt position to increase it's collateral ratio.&#x20;

**Liquidity Pool** —  Smart contract within an AMM that holds tokens in equal value to facilitate exchange (swaps) while rewarding the liquidity providers from these swaps.

**Liquidity Provider** —   Account that provides assets into a liquidity pool in an AMM enabling other accounts to swap between them.

**Liquidator** —  Any account that liquidates CDPs which are considered unhealthy since their collateral ratio is under the liquidation threshold in the protocol.&#x20;

**Liquidatee** —  An account that is liquidated.

**Liquidaton Incentive Multiplier** —    A percentage multiplier that allows liquidators seize additional collateral to make performing liquidations worthwhile. Must be within 0-25%.

**Liquidaton Threshold** —    A percentage CR threshold after which a CDP is subject to liquidation.

**Market** —  Place where buyers and sellers can meet to facilitate the exchange or transaction of goods and services. Also a market can mean a one-to-one relationship of any Collateral Asset to Kresko Asset.

**Maximum Liquidatable Value** —  Maximum value for a single liquidation call.&#x20;

**Minter** —  Equal to Borrower.

**Minting** —   Creation of new tokens, increases the circulating supply. In the context of the Kresko protocol this is also refers to borrowing Kresko Assets.

**Minimum Collateralization Ratio** —  Minimum ratio of collateral to debt. If the ratio is equal to Minimum Collateralization Ratio, user cannot take more debt before depositing more collateral or repaying existing debt. Expressed as a percentage.

**Minimum Collateral Value** —  The minimum value of collateral required to back debt taken.

**Minimum Debt Value** —  Minimum value that can be borrowed from the Kresko protocol.

**MCR** —  Shorthand for Minimum Collateralization Ratio.

**Overcollateralization** —   Collateral value is greater than the debt taken.

**Oracle** —  Entity that queries market data from trusted data sources, sends it to an oracle network which  forwards the data into the blockchain for consumption by Kresko protocol.

**Oracle Feed** — A smart contract where valid data is posted by the oracle network for consumption by other smart contracts.

**Oracle Price** — Price reported by an oracle to an oracle feed.

**Open Fee** —    Possible percentage fee configuration, taken by the protocol when taking on debt. Must be within 0-10%.

**Protocol** — Kresko synthetic asset protocol, most often refers to the smart contracts infrastructure.

**Proxy** — Smart contract that can be upgraded while retaining the same address.&#x20;

**Ray** — A number with 27 decimals of precision.

**Rebase** — When a stock split, reverse stock-split or similar event happens for a underlying asset the corresponding Kresko Asset will rebase all wallet balances and the total supply to matching values.

**Safety Parameter** —   A risk-mitigation variable that is set globally or on a per-asset basis.&#x20;

**Safety Council** —   A multisig consisting of at least 5 signers that can enable and disable protocol functionality with a quorum.

**Synthetic Asset** —  Asset that derives its value from another asset.

**Short Position** —  Selling an asset with the intention of repurchasing it back later, expecting the value will decrease.

**Supply Limit** —  Maximum circulating supply of tokens that can be minted of a Kresko Asset.

**Trader** —  Accounts that only use the AMM to buy and sell Kresko Assets.

**TWAP** —  Time weighted average price.

**Underlying Asset** —  Asset that synthetic assets derive their value from.

**Wad** — A number with 18 decimals of precision.


# Litepaper

A high-level explanation of the core concepts and mechanisms that power Kresko.

View and download the Kresko Litepaper below.

{% file src="/files/CWbOhYXKtiF99rieCYxp" %}
**Last Updated:** January 6, 2024
{% endfile %}

{% hint style="warning" %}
This resource is a work in progress and may be updated in the future.
{% endhint %}


# Contracts Overview

{% hint style="danger" %}
**This documentation is a work in progress!**
{% endhint %}

## Introduction

Contracts that Kresko has developed mainly fall into four categories:

* **Diamond:** Contracts related to EIP-2535 diamond proxy pattern.
* **Core**: ICDP/SCDP Borrow/Mint/Liquidation state, logic and configuration.
* **Vault**: ERC-4626 derivative.
* **Tokenization**: Kresko Asset, Kresko Asset Anchor (Non-rebasing wrapper token), KISS.

Repository: <https://github.com/kreskohq/kresko-protocol>


# Liquidations

Learn how to participate in the liquidations market

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td></td><td><strong>Contracts</strong></td><td></td><td><a href="/pages/gRDBHqhlK0uIx3ru1GGf">/pages/gRDBHqhlK0uIx3ru1GGf</a></td></tr><tr><td></td><td><strong>Addresses</strong></td><td></td><td><a href="/pages/QvQcNU2mCNxYGFfq2MUI">/pages/QvQcNU2mCNxYGFfq2MUI</a></td></tr><tr><td></td><td><strong>Protocol Repository</strong></td><td></td><td><a href="https://github.com/kreskohq/kresko-protocol">https://github.com/kreskohq/kresko-protocol</a></td></tr></tbody></table>

{% hint style="danger" %}
**This documentation is a work in progress!**
{% endhint %}

## Overview&#x20;

[Liquidations](/kresko-docs/fundamentals/liquidations) of unhealthy [CDP](/kresko-docs/fundamentals/cdps)'s within the protocol can be done by anyone and the protocol incentivizes i&#x74;*.*

Liquidators must obtain equal amount of the Kresko Asset repaid on behalf of the liquidatee. These [Kresko Assets](/kresko-docs/fundamentals/kresko-assets) are burned and the debt balance of the liquidatee is reduced accordingly. Protocol then calculates the amount of collateral to seize, removes it from the liquidatees [collateral deposits](/kresko-docs/fundamentals/collateral-assets#collateral-deposit-value) and transfers it to the liquidators address.

When a liquidator repays debt on the unhealthy CDP, in return they receive the liquidatees collateral at a discount according to the [*Liquidation Incentive*](/kresko-docs/fundamentals/glossary). This rewards the liquidators in exchange for the repayment cost and effort.

{% hint style="info" %}
[Example Liquidation ](/kresko-docs/fundamentals/liquidations#liquidation-example-2)
{% endhint %}

### Liquidation Threshold

Thing to understand in liquidations is the difference between [Liquidation Threshold](#liquidation-threshold) (LT) and the [Minimum Collateralization Ratio](/kresko-docs/fundamentals/cdps#minimum-collateralization-ratio) (MCR).

An account in the protocol is considered *liquidatable* when the ratio of collateral to debt is less than the LT. MCR is used to decide whether the CDP is allowed to take on more debt. While MCR is similar to the LT, it won't make an account liquidatable. The possible gap between these ratios is a safety buffer and it prevents users from creating extremely risky positions which would get liquidated in the slightest market movement.&#x20;

{% hint style="info" %}
**TL;DR**

* Accounts can be liquidated below LT.
* Accounts can only be liquidated up to the [MLR](/kresko-docs/fundamentals/liquidations#maximum-liquidation-ratio).
  {% endhint %}

## Acquiring Kresko Assets

Three main options exist to natively acquire Kresko Assets.

1. [Borrowing](/kresko-docs/fundamentals/cdps/icdp/minting-borrowing) the assets from the protocol against collateral.
2. Provide underlying assets for a 1-1 [synth wrap](/kresko-docs/fundamentals/synth-wrap).
3. Acquire [KISS](/kresko-docs/fundamentals/kiss) with USDC, optionally exchange acquired KISS using the [SCDP](/kresko-docs/fundamentals/cdps/scdp) to any Kresko Asset.&#x20;
4. Buy the assets from some 3rd party AMM liquidity.

{% hint style="info" %}
Liquidation call *does not* touch liquidators debt, as it would be a double spend.&#x20;

This means using the protocol to acquire Kresko Assets will leave the liquidator with a regular CDP after the liquidation call.&#x20;
{% endhint %}

{% hint style="success" %}
All protocol code is public on GitHub

<https://github.com/kreskohq/kresko-protocol>
{% endhint %}


# Errors

Find the cause for a failing transaction.

Transactions in the protocol that fail will most of the time output a custom error describing the reason.  This page contains the list of all known error scenarios in the protocol.

{% hint style="danger" %}
**This documentation is a work in progress!**
{% endhint %}


# Deployment Addresses

{% tabs %}
{% tab title="Arbitrum One" %}

<table><thead><tr><th width="229">Contract</th><th>Deployment</th></tr></thead><tbody><tr><td>OfficiallyKreskian (Proxy)</td><td><a href="https://arbiscan.io/address/0xAbDb949a18d27367118573A217E5353EDe5A0f1E">0xAbDb949a18d27367118573A217E5353EDe5A0f1E</a></td></tr><tr><td>OfficiallyKreskian (Impl)</td><td><a href="https://arbiscan.io/address/0xF4fA02fEC78f3d08F6Ce2fa190c139471e85b3E4">0xF4fA02fEC78f3d08F6Ce2fa190c139471e85b3E4</a></td></tr><tr><td>QuestForKresk (Proxy)</td><td><a href="https://arbiscan.io/address/0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6">0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6</a></td></tr><tr><td>QuestForKresk (Impl)</td><td><a href="https://arbiscan.io/address/0xdd8E57e09b7e4A05677c2FB08f759D2148bE588D">0xdd8E57e09b7e4A05677c2FB08f759D2148bE588D</a></td></tr><tr><td>Multisig</td><td><a href="https://arbiscan.io/address/0x266489Bde85ff0dfe1ebF9f0a7e6Fed3a973cEc3">0x266489Bde85ff0dfe1ebF9f0a7e6Fed3a973cEc3</a></td></tr><tr><td>DeploymentFactory</td><td><a href="https://arbiscan.io/address/0x000000000070AB95211e32fdA3B706589D3482D5">0x000000000070AB95211e32fdA3B706589D3482D5</a></td></tr><tr><td>Diamond</td><td><a href="https://arbiscan.io/address/0x0000000000177abD99485DCaea3eFaa91db3fe72">0x0000000000177abD99485DCaea3eFaa91db3fe72</a></td></tr><tr><td>KrMulticall</td><td><a href="https://arbiscan.io/address/0x0000000084C577a3563a531C00c7257FF44C3052">0x0000000084C577a3563a531C00c7257FF44C3052</a> <br> <a href="https://arbiscan.io/address/0xC35A7648B434f0A161c12BD144866bdf93c4a4FC">0xC35A7648B434f0A161c12BD144866bdf93c4a4FC</a></td></tr><tr><td>Vault (KISS)</td><td><a href="https://arbiscan.io/address/0x2dF01c1e472eaF880e3520C456b9078A5658b04c">0x2dF01c1e472eaF880e3520C456b9078A5658b04c</a></td></tr><tr><td>KISS (Proxy)</td><td><a href="https://arbiscan.io/address/0x6A1D6D2f4aF6915e6bBa8F2db46F442d18dB5C9b">0x6A1D6D2f4aF6915e6bBa8F2db46F442d18dB5C9b</a></td></tr><tr><td>KISS (Impl)</td><td><a href="https://arbiscan.io/address/0x000000000070AB95211e32fdA3B706589D3482D5">0xC449faf49e3cDE2BdBd1D8B3803C7616fc712B75</a></td></tr><tr><td>krETH (Proxy)</td><td><a href="https://arbiscan.io/address/0x24dDC92AA342e92f26b4A676568D04d2E3Ea0abc">0x24dDC92AA342e92f26b4A676568D04d2E3Ea0abc</a></td></tr><tr><td>krETH (Impl)</td><td><a href="https://arbiscan.io/address/0xcf0f78e1dcd261cfdddeec05657d7d9109ce48f8">0xCf0f78e1DCD261CfddDeec05657D7D9109cE48f8</a></td></tr><tr><td>akrETH (Proxy)</td><td><a href="https://arbiscan.io/address/0x3103570A28ca026e818c79608F1FF804F4Bde284">0x3103570A28ca026e818c79608F1FF804F4Bde284</a></td></tr><tr><td>akrETH (Impl)</td><td><a href="https://arbiscan.io/address/0x09820E222205aD91C311099278677C9F5cF08355">0x09820E222205aD91C311099278677C9F5cF08355</a></td></tr><tr><td>GatingManager</td><td><a href="https://arbiscan.io/address/0xDfd3252C5D875a43A93b9ec882F209a0CC2E17a7">0xDfd3252C5D875a43A93b9ec882F209a0CC2E17a7</a></td></tr><tr><td>DataV1</td><td><a href="https://arbiscan.io/address/0x988B48C20e9DE1Dac1DABF27facAC97f0eee87Ae">0x988B48C20e9DE1Dac1DABF27facAC97f0eee87Ae</a><br><br><a href="https://arbiscan.io/address/0x60F9C3ff2186f849BCF9273eB3A441aa8888D412">0x60F9C3ff2186f849BCF9273eB3A441aa8888D412</a><br><br></td></tr><tr><td>krBTC (Proxy)</td><td><a href="https://arbiscan.io/address/0x11EF4EcF3ff1c8dB291bc3259f3A4aAC6e4d2325">0x11EF4EcF3ff1c8dB291bc3259f3A4aAC6e4d2325</a></td></tr><tr><td>akrBTC (Proxy)</td><td><a href="https://arbiscan.io/address/0xc67a33599f73928D24D32fC0015e187157233410">0xc67a33599f73928D24D32fC0015e187157233410</a></td></tr><tr><td>krSOL (Proxy)</td><td><a href="https://arbiscan.io/address/0x96084d2E3389B85f2Dc89E321Aaa3692Aed05eD2">0x96084d2E3389B85f2Dc89E321Aaa3692Aed05eD2</a></td></tr><tr><td>akrSOL (Proxy)</td><td><a href="https://arbiscan.io/address/0x362cB60d235Cf8258042DAfB2a3Cdb14302D9D0f">0x362cB60d235Cf8258042DAfB2a3Cdb14302D9D0f</a></td></tr><tr><td>krEUR (Proxy)</td><td><a href="https://arbiscan.io/address/0x83BB68a7437b02ebBe1ab2A0E8B464CC5510Aafe">0x83BB68a7437b02ebBe1ab2A0E8B464CC5510Aafe</a></td></tr><tr><td>akrEUR (Proxy)</td><td><a href="https://arbiscan.io/address/0xBb6053898C5f6e536405fA324839141aA102b6D9">0xBb6053898C5f6e536405fA324839141aA102b6D9</a></td></tr><tr><td>krJPY (Proxy)</td><td><a href="https://arbiscan.io/address/0xc4fEE1b0483eF73352447b1357adD351Bfddae77">0xc4fEE1b0483eF73352447b1357adD351Bfddae77</a></td></tr><tr><td>akrJPY (Proxy)</td><td><a href="https://arbiscan.io/address/0x3438Eb57e5b0f1CbEca257Aea9644B26b1B61EaC">0x3438Eb57e5b0f1CbEca257Aea9644B26b1B61EaC</a></td></tr><tr><td>MarketStatusProvider</td><td><a href="https://arbiscan.io/address/0xf6188e085ebEB716a730F8ecd342513e72C8AD04">0xf6188e085ebEB716a730F8ecd342513e72C8AD04</a></td></tr><tr><td>krGBP (Proxy)</td><td><a href="https://arbiscan.io/address/0xdb274afDfA7f395ef73ab98C18cDf3D9C03b538C">0xdb274afDfA7f395ef73ab98C18cDf3D9C03b538C</a></td></tr><tr><td>akrGBP (Proxy)</td><td><a href="https://arbiscan.io/address/0x37BddA32281c15716D35f901b8141f7F382220C1">0x37BddA32281c15716D35f901b8141f7F382220C1</a></td></tr><tr><td>krXAU (Proxy)</td><td><a href="https://arbiscan.io/address/0xe0A49C9215206f9cfb79981901bDF1f2716d3215">0xe0A49C9215206f9cfb79981901bDF1f2716d3215</a></td></tr><tr><td>akrXAU (Proxy)</td><td><a href="https://arbiscan.io/address/0x3A1ffd3426916B16878AAa072B74DdaEC3e31007">0x3A1ffd3426916B16878AAa072B74DdaEC3e31007</a></td></tr></tbody></table>
{% endtab %}

{% tab title="Optimism" %}

<table><thead><tr><th width="286">Contract</th><th>Deployment</th></tr></thead><tbody><tr><td>Multisig</td><td><a href="https://optimistic.etherscan.io/address/0x22426D3995a56646b5cbA56283159CEC883E68dB">0x22426D3995a56646b5cbA56283159CEC883E68dB</a></td></tr><tr><td>OfficiallyKreskian</td><td><a href="https://optimistic.etherscan.io/address/0xAbDb949a18d27367118573A217E5353EDe5A0f1E">0xAbDb949a18d27367118573A217E5353EDe5A0f1E</a></td></tr><tr><td>OfficiallyKreskian_Proxy</td><td><a href="https://optimistic.etherscan.io/address/0xAbDb949a18d27367118573A217E5353EDe5A0f1E">0xAbDb949a18d27367118573A217E5353EDe5A0f1E</a></td></tr><tr><td>OfficiallyKreskian_Implementation</td><td><a href="https://optimistic.etherscan.io/address/0xF4fA02fEC78f3d08F6Ce2fa190c139471e85b3E4">0xF4fA02fEC78f3d08F6Ce2fa190c139471e85b3E4</a></td></tr><tr><td>QuestForKresk</td><td><a href="https://optimistic.etherscan.io/address/0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6">0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6</a></td></tr><tr><td>QuestForKresk_Proxy</td><td><a href="https://optimistic.etherscan.io/address/0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6">0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6</a></td></tr><tr><td>QuestForKresk_Implementation</td><td><a href="https://optimistic.etherscan.io/address/0xdd8E57e09b7e4A05677c2FB08f759D2148bE588D">0xdd8E57e09b7e4A05677c2FB08f759D2148bE588D</a></td></tr></tbody></table>
{% endtab %}

{% tab title="Ethereum" %}

<table><thead><tr><th width="284">Contract</th><th>Deployment</th></tr></thead><tbody><tr><td>Multisig</td><td><a href="https://etherscan.io/address/0x31d866AAf9D8588B1295e3A34B6B714a62fE2989">0x31d866AAf9D8588B1295e3A34B6B714a62fE2989</a></td></tr><tr><td>OfficiallyKreskian</td><td><a href="https://etherscan.io/address/0xAbDb949a18d27367118573A217E5353EDe5A0f1E">0xAbDb949a18d27367118573A217E5353EDe5A0f1E</a></td></tr><tr><td>OfficiallyKreskian_Proxy</td><td><a href="https://etherscan.io/address/0xAbDb949a18d27367118573A217E5353EDe5A0f1E">0xAbDb949a18d27367118573A217E5353EDe5A0f1E</a></td></tr><tr><td>OfficiallyKreskian_Implementation</td><td><a href="https://etherscan.io/address/0xF4fA02fEC78f3d08F6Ce2fa190c139471e85b3E4">0xF4fA02fEC78f3d08F6Ce2fa190c139471e85b3E4</a></td></tr><tr><td>QuestForKresk</td><td><a href="https://etherscan.io/address/0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6">0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6</a></td></tr><tr><td>QuestForKresk_Proxy</td><td><a href="https://etherscan.io/address/0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6">0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6</a></td></tr><tr><td>QuestForKresk_Implementation</td><td><a href="https://etherscan.io/address/0xdd8E57e09b7e4A05677c2FB08f759D2148bE588D">0xdd8E57e09b7e4A05677c2FB08f759D2148bE588D</a></td></tr></tbody></table>
{% endtab %}

{% tab title="Polygon" %}

<table><thead><tr><th width="281">Contract</th><th>Deployment</th></tr></thead><tbody><tr><td>Multisig</td><td><a href="https://polygonscan.com/address/0x389297F0d8C489954D65e04ff0690FC54E57Dad6">0x389297F0d8C489954D65e04ff0690FC54E57Dad6</a></td></tr><tr><td>OfficiallyKreskian</td><td><a href="https://polygonscan.com/address/0xAbDb949a18d27367118573A217E5353EDe5A0f1E">0xAbDb949a18d27367118573A217E5353EDe5A0f1E</a></td></tr><tr><td>OfficiallyKreskian_Proxy</td><td><a href="https://polygonscan.com/address/0xAbDb949a18d27367118573A217E5353EDe5A0f1E">0xAbDb949a18d27367118573A217E5353EDe5A0f1E</a></td></tr><tr><td>OfficiallyKreskian_Implementation</td><td><a href="https://polygonscan.com/address/0xF4fA02fEC78f3d08F6Ce2fa190c139471e85b3E4">0xF4fA02fEC78f3d08F6Ce2fa190c139471e85b3E4</a></td></tr><tr><td>QuestForKresk</td><td><a href="https://polygonscan.com/address/0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6">0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6</a></td></tr><tr><td>QuestForKresk_Proxy</td><td><a href="https://polygonscan.com/address/0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6">0x1C04925779805f2dF7BbD0433ABE92Ea74829bF6</a></td></tr><tr><td>QuestForKresk_Implementation</td><td><a href="https://polygonscan.com/address/0xdd8E57e09b7e4A05677c2FB08f759D2148bE588D">0xdd8E57e09b7e4A05677c2FB08f759D2148bE588D</a></td></tr></tbody></table>
{% endtab %}
{% endtabs %}


# Audits

The Kresko protocol has undergone multiple audits over the course of its development.&#x20;

You can find the full detail for each audit below.

<table><thead><tr><th width="168">Auditor</th><th width="181">Date</th><th>Public Report</th></tr></thead><tbody><tr><td>Solidified</td><td>March 5, 2024</td><td><a href="https://github.com/solidified-platform/audits/blob/master/Audit%20Report%20-%20Kresko%20Update.pdf">https://github.com/solidified-platform/audits/blob/master/Audit%20Report%20-%20Kresko%20Update.pdf</a></td></tr><tr><td>Solidified</td><td>January 12, 2024</td><td><a href="https://github.com/solidified-platform/audits/blob/master/Audit%20Report%20-%20Kresko%20%5B2024-01-12%5D.pdf">https://github.com/solidified-platform/audits/blob/master/Audit%20Report%20-%20Kresko%20%5B2024-01-12%5D.pdf</a></td></tr><tr><td>Solidified</td><td>July 14, 2023</td><td><a href="https://github.com/solidified-platform/audits/blob/master/Audit%20Report%20-%20Kresko.pdf">https://github.com/solidified-platform/audits/blob/master/Audit%20Report%20-%20Kresko.pdf</a></td></tr><tr><td>Quantstamp</td><td>January 28, 2022</td><td>Report not available yet.</td></tr></tbody></table>


# Bug Bounty

There will be a bug bounty for the Kresko Protocol after launch.

Check back for updated information in the coming months.


# Design Resources

These resources are provided to allow consistent design across all use cases in the Kresko ecosystem.

More updates coming soon.

**Media Kit**

{% file src="/files/Sf2uzkGFsWXItj5JGTou" %}


# Closed Beta

This page contains information about Kresko's Closed Beta. Information will be updated periodically as we progress through the Beta.

## Overview

Kresko's Closed Beta facilitates the validation of our novel global collateralized debt position (CDP) architecture and also gives participants an opportunity to:

* Trade without slippage
* Earn yield on liquidity provisioning using stablecoins, thereby avoiding market volatility
* Take short positions on synthetic assets
* Become a Kresko OG

## Timeline

The Closed Beta is launching on Arbitrum mainnet on March 11, 2024.

### Access

Possession of Kresko NFTs will be required to access the Beta. Prepare for the Beta by bridging your NFTs from Optimism to Arbitrum.

NFT requirements will ease as the Closed Beta progresses.

For the 1st Phase access users need three NFTs to access the Beta:

1. Freshly Minted - "Officially a Kreskian" collection
2. Analyze This - "Quest for Kresk" collection
3. Any other NFT from "Quest for Kresk" collection (Can't be "Analyze this")

### **Acquisition of Kresko NFTs**

* Testnet participants were awarded different tiers of Kresko NFTs depending on their testnet performance and contribution to the protocol and community.
* Kresko NFTs can now be acquired from OpenSea (subject to availability).
  * [Officially a Kreskian](https://opensea.io/collection/officially-a-kreskian)
  * [Quest for Kresk](https://opensea.io/collection/the-quest-for-kresk?search\[stringTraits]\[0]\[name]=Location\&search\[stringTraits]\[0]\[values]\[0]=Foundry)

## Join the Community

* [Twitter](https://twitter.com/kreskoxyz)
* [Discord](https://discord.gg/kresko)
* [Blog](https://mirror.xyz/kreskohq.eth)


# Quest for Kresk: Season 0

A Kreskian Prophecies Adventure

<figure><img src="/files/PMH78Qu79iJvLijRBI87" alt="The Quest for Kresk"><figcaption></figcaption></figure>

## Greetings Kreskians!

Welcome to Quest for Kresk.&#x20;

Season 0, Kresko's testnet competition, has concluded. Quest for Kresk: Season 1 details coming soon.

If you haven’t already, make sure to check out our [**Testnet Announcement**](https://medium.com/kreskofi/announcement-the-quest-for-kresk-kresko-testnet-competition-cf255261bc02) and [**Missions & Prizes**](https://medium.com/kreskofi/the-quest-for-kresk-missions-prizes-72987cc62b75) blog posts to learn more about the past competition.

### Testnet Results

Check out our [**Winners Announcement**](https://medium.com/kreskofi/announcing-the-winners-of-the-quest-for-kresk-48541ca2e5c7) blog post to read about all the winners of the competition.

{% content-ref url="/pages/2mw5KkKC1ieAbrmEcLW0" %}
[Scoring Methodology](/kresko-docs/events/quest-for-kresk-season-0/scoring-methodology)
{% endcontent-ref %}

### Mainnet Beta Waitlist

The Quest for Kresk: Season 0 has concluded. Thanks to everyone who participated!

{% hint style="info" %}
Anyone can sign up for the **Mainnet Beta waitlist** [here](https://app.kresko.link/signup).
{% endhint %}

All Quest for Kresk competitors are automatically placed on the Mainnet Beta waitlist.

#### Schedule

The competition ran **February 10, 2023 at 00:00 GMT** to **March 24, 2023 at 23:59 GMT.**

## Roles

Each competitor chooses a single role that they will keep throughout the testnet.

* **Investor:** As an Investor, you will focus on making smart investments in the Kresko protocol and maximizing your portfolio's returns.
* **Trader:** As a Trader, you will be tasked with buying and selling synthetic assets on the Kresko market, constantly seeking the best opportunities to profit.
* **Operator:** As an Operator, you will be providing liquidity to the Kresko market, helping to maintain its stability and enabling other participants to trade efficiently. You will also be tasked with liquidating underwater positions.

## Missions

Every week, we'll reveal new missions specifically tailored to the role you take on in the competition. Build your portfolio as an Investor, extract profit as a Trader, or make the market as an Operator. Every mission you complete will earn you points, with a different point value for \
each mission.

### Point Multiplier

To increase your chances of success, aim to complete every mission each week. This will increase your multiplier, which will be applied to any points you earn the following week. At the end of each week, your multiplier will either increase by 0.1x or reset, depending on whether you complete all the missions or not.

## Global Objectives&#x20;

Along with the weekly missions, there are a couple of global objectives that will provide additional opportunities to earn points at the end of the competition:

* **Maximize Profit:** The player with the most profits will receive the most points, with everyone else receiving points based on their profit compared to the leader's.
* **Farm Rewards:** Farming rewards collected during the competition will be worth points at the end.

## Prizes

In The *Quest for Kresk*, you will earn many prizes in the form of NFTs. Your standing in the world of Kresk is showcased by your NFT achievements.

### Championship Prizes — 25 NFTs <a href="#a278" id="a278"></a>

**Competition Leader | Level-3 NFT:** The competitor with the most points overall is the winner of the competition. You will receive a one-of-a-kind, limited edition NFT.

### Role-based Winners <a href="#e25b" id="e25b"></a>

**1st place**\
One Level-3 NFT and Three Level-2 NFTs

**2nd place**\
Three Level-2 NFTs

**3rd place**\
One Level-2 NFT

{% hint style="info" %}
Investors, Traders, Operators will have separate winners with 1st, 2nd, and 3rd places
{% endhint %}

### Participation Prizes <a href="#id-639f" id="id-639f"></a>

**Officially a Kreskian | Level-1 NFT:** For progressing through missions, you will become an official Kreskian. Every Kreskian will receive one Kresko NFT.

**Competitor NFT | Level-1 NFT:** For reaching the end of the quest, you will establish yourself as a true competitor. To reflect your competitive spirit, you’ll receive one limited edition Level 1 NFT.

**Founders NFT:** You’ve been a true supporter of Kresko from the early days and signed up before Feb 8, 2023 23:59 GMT. You are eligible for this NFT. After you reach the end of the quest, you will receive this much awaited limited edition Founders NFT.

### Community & Bug Bounty Prizes — up to 30 NFTs <a href="#id-9b38" id="id-9b38"></a>

In addition to the competition prizes, Kreskians that go above and beyond by contributing to the community will receive special NFTs.

### Additional Prizes <a href="#baf9" id="baf9"></a>

There might be additional surprise non-NFT prizes. More to be announced soon.

{% hint style="info" %}
The rules are subject to change and under the advisement of the Kresko community to keep the game fair and balanced.
{% endhint %}

## Rules of Engagement <a href="#id-79f1" id="id-79f1"></a>

1. **Registration Window:** You can only join the game each week starting Friday. The window to join is open for 72hrs only.
2. **Sign-up Window:** Sign-up (i.e., add your email [here](https://app.kresko.link/signup)) before Friday 00:00 GMT to get the access code.
3. **Prohibited Token Transfer:** Transferring tokens from one account to another is not allowed and will result in disqualification.
4. **Unrequested Tokens:** Do not use tokens received without request. Dispose of them by sending to address 0x000000000000000000000000000000000000dEaD.
5. **Multiplier Increase:** Completing weekly missions will increase your multiplier by 0.1x each week. The multiplier will reset to 1.0x if missions are not completed within the week.
6. **Base Protocol Missions:** Points can be earned through Deposit, Withdraw, Borrow, Repay, and Swap missions. These missions do not affect the multiplier.
7. **No Token USD Value:** All testnet tokens and farming rewards during the competition are mock tokens and have no USD value.
8. **Competition Secondary Goal:** The competition aims to test the platform. Testnet may be reset and protocol deployments may occur to test adverse scenarios.
9. **Core Team Eligibility:** The Kresko core team members are not eligible to win in the competition.

<br>


# Scoring Methodology

This document presents an overview of the methodology used to determine the final scores for The Quest for Kresk.

The competition encouraged participants to earn points in the following categories:

1. **Mission XP:** Earn mission XP by completing missions.
2. **Profits:** Compete by generating profits.
3. **Farming Rewards:** Stake LP tokens to accrue krRewards.

Three roles participated in The Quest for Kresk: Investor, Operator, and Trader. To ensure a fair selection of the competition winner, it was necessary to normalize the results for the three roles, as each role had distinct objectives and missions.

The methodology was designed to transform the three components—Missions, Profits, and Farming Rewards—into normalized scores to calculate the final score. Scores were divided into three categories:

1. Mission Score
2. Profit Score
3. Farming Reward Score

The final score was capped at 250,000.

## **Overview of Steps**

1. Calculate percentile ranks for each component (Missions, Profits, and Farming Rewards) within each role.
2. Scale scores based on the maximum values for each role.
3. Calculate Global Score as the sum of the scaled Profit Score and Farming Reward Score.
4. Combine scaled Mission Score and Global Score to compute the Final Score.

## **Calculate Percentile Ranks**

Percentile rank is used to compare each user’s performance in the three component areas against users with the same role. This helps improve the balance between the three roles in each area of scoring.

For each component (Missions, Profits, and Farming Rewards), calculate the percentile rank for each user within their role:

**`percentile_rank = (user_rank / total_users_in_role) * 100`**

## **Scale Scores**

All roles have the same maximum score from completing missions.

All roles have the same maximum Global Score from Profit and Farming Rewards. Maximum scores for Profits and Farming Rewards are weighted by role to align with the objectives and activities of the role.&#x20;

{% hint style="info" %}
**Example**\
Operators receive 30% of their Global Score from Farming Rewards, but Traders only 10%.
{% endhint %}

The percentile ranks for each component are scaled according to the maximum values for each role:

| Role     | Max Mission Score | Max Profit Score | Max Farming Reward Score |
| -------- | ----------------- | ---------------- | ------------------------ |
| Trader   | 125,000           | 112,500          | 12,500                   |
| Investor | 125,000           | 100,000          | 25,000                   |
| Operator | 125,000           | 87,500           | 37,500                   |

**`Scaled Component Score = Percentile Rank * Maximum Component Score`**

{% hint style="info" %}
**Example**\
An Investor who had higher profit than 98% of Investors will receive:

\
$$scaledProfitScore = 0.98 \* 100,000$$

$$scaledProfitScore = 98,000$$
{% endhint %}

## **Calculate Global Score**

Compute each user's Global Score by summing the scaled Profit Score and Farming Reward Score:

**`Global Score = Scaled Profit Score + Scaled Farming Reward Score`**

## **Combine Scores**

Calculate the Final Score for each user by adding the scaled Mission Score and the Global Score:

**`Final Score = Scaled Mission Score + Global Score`**

The maximum possible Final Score is 250,000.


# FAQs

<details>

<summary>When will I receive my access code?</summary>

Access codes are sent every Friday at 00:00GMT. Access codes are sent to everyone who has signed up for the waitlist.

</details>

<details>

<summary>When can I access the competition?</summary>

You will have 72 hours from Friday 00:00GMT to register with an access code each week. Once registered, you will be able to access the competition any time until the end of testnet.

</details>

<details>

<summary>How do I get testnet funds for the competition?</summary>

You will receive testnet funds during your onboarding within the app. Simply follow the missions in Mission Control until you complete the Get Funded mission.\
\
If you run out of gas during the testnet, you can use a public testnet faucet to get more:

* <https://goerlifaucet.com/>

</details>


