Skip to content

Two Vault Peg Stabletoken System

Graham Jenkins edited this page Sep 4, 2019 · 2 revisions


This document describes the functionality and structure of the Two Vault Peg Stabletoken system. This system allows users to utilize any participating ERC20 token as collateral for minting stable tokens associated with that particular ERC20 token.


The Two Vault Peg Stabletoken System operates under the premise that a stable asset may be issued when a sufficient quantity of a potentially volatile asset is locked up, or over-collateralized according to a regularly updated oracle value. This over-collateralization model utilizes a safety margin, or liquidation threshold, which allows the collateral to be claimed by other users in the case that the liquidation threshold is passed. These mechanisms allow the system to ensure that every stable token, or debt token is backed by more value in collateral than they are valued at, while allowing any actor to profit by enforcing the safety margins.


The Two Vault Peg Stabletoken System consists of a series of contracts which are associated with a single Token/Stabletoken pair. The remainder of this section describes each of the main features in regards to a single Token/Stabletoken pair.


A contract which authorized signers are able to call a function, setting the relative value of the base ERC20 token in relation to its stable form. The other contracts will refer to the oracle value when determining available credit, borrowing limits, liquidation thresholds and auction values.

Token Associated Stabletokens

Created by depositing a specified ERC20 token into a vault and borrowing against its value. Example: For token XYZ, a series of contracts may be deployed, allowing for deposit of XYZ tokens and minting of XYZ:USD stable tokens. Note: For our examples we will assume USD to be the base stable currency, however all the features in this model will function with other currencies as long as the Oracle ratio is maintained.


  • Each Token/Stabletoken pair uses two vaults, one for depositing ERC20 tokens as collateral for minting stabletokens, and a second for depositing stabletokens to borrow the underlying ERC20 token from.
  • Borrowers pay interest on their debt by a mechanism that allows both debt and balances to be scaled up or down.

Vault A

  • Used to deposit underlying token and mint a corresponding stabletoken
  • Interest on debt is charged in the form of a stability fee, scaling the debt up, and minting a corresponding amount, depositing it into the relay token connector balance
  • Balances in Vault A are scaled up (paid interest) based on interest charged in Vault B

Vault B

  • Used to deposit a stabletoken and borrow its corresponding token from Vault A
  • Dept scaling rate based upon the ratio of Vault A’s balance versus how much Vault B has borrowed. As more of Vault A’s balance is borrowed the debt scaling rate for Vault B increases.
    • Eg: Vault A has 1000 tokens deposited as collateral. Users may deposit the stabletoken into Vault B and use it as collateral to secure a loan against a portion of Vault A’s balance. Users are charged interest for their loan, and the total balance of all deposits in Vault A are scaled up a corresponding amount.

Collateral Protection

  • Maximum LTV Borrow: Set at 50%. The maximum amount of value a vault will allow a borrower to borrow against their collateral
  • Liquidation Threshold: Set at 85%. When the value of the debt vs collateral exceeds this number, the debt is be subject to liquidation.


If a user’s debt becomes insolvent any user may initiate a liquidation auction which provides a three hour period of time during which users may bid for the collateral or relay tokens.


Users place bids, choosing how much (if any) of the collateral they will allow the initial borrower to receive back at the end of the auction. The highest bidder is the one who allows for the greatest amount of collateral to be returned to the initial borrower. The amount of collateral may not exceed 100% of the collateral in the auction.

Relay Tokens

In the case the value of the collateral does not provide sufficient incentive to repay the debt, users may elect to place a bid for zero collateral returned, plus a certain number of relay tokens, referred to as Collateral of Last Resort. The highest bidder is the one who is willing to receive the least amount of Relay Tokens for their bid.

Collateral of Last Resort

Typically the auction will occur revolving around the amount of Collateral being returned to the borrower. In the case that the value of the collateral is less than the value of the debt, and/or there is insufficient motivation to bid for an auction with slim margins, it is possible for bidders to specify zero collateral returned to the initial borrower, plus a certain number of relay tokens which will be minted and paid to the highest bidder. In this case, the highest bidder is the one willing to receive the least number of relay tokens, including zero, or is willing to return collateral to the initial borrower. If the winning bidder has specified a number of relay tokens, the contract will dilute existing relay token holders by minting the tokens, socializing the losses for that particular debt.

Auction Process: Initial Bid

The first bidder pays off the entire debt, optionally specifying a number of relay tokens they desire in addition to the collateral. If any bid includes a number of relay tokens the auction is extended for a total of 48 hours.

Auction Process: Bidding

  • Bids are ranked on a scale of lowest to highest.
    • On the lower end are bidders requesting the largest number of relay tokens
    • On the higher end are the bidders willing to return the most collateral to the initial borrower
Lowest Bids    ⇒    ⇒    ⇒    ⇒ Highest Bids
Bids requesting relay tokens            Bids returning collateral
  • Every bid must be “higher” than the previous bid.
  • Every bid costs the bidder the initial debt amount, and repays the previous highest bidder. (In the case of the initial bid, the cost repays the actual debt)
  • Every bid involves the bidders passing the debt around, buying each other’s place in exchange for a decreasing amount of value to be received when winning the auction

Auction Process: Completion

  • The initial debt has been paid off by the first bidder
  • Intermediate bidders have paid and been reimbursed the debt amount
  • The highest bidder has paid the debt amount
  • The highest bidder receives:
    • Any/all collateral they specify
    • Potentially relay tokens if part of highest bid
  • The initial borrower receives:
    • A portion of the collateral based on highest bid
    • Note: No collateral is returned if relay tokens are involved
    • Retained possession of any debt / tokens they borrowed
    • Their debt has been repaid

Stabletoken Relay

  • Connects two stabletokens, user can deposit either/both stabletokens in order to receive the underlying relay token which represents a portion of the value of both connector balances.
  • As users convert between the two stabletokens, a fee is withheld, retaining the value in the connector token balances. This results in direct appreciation in the value of relay tokens.
  • Interest in Vault A is minted as stable tokens and deposited into the relay’s connector balance, producing a second form of appreciation.

Future Features

  • Smart contract mechanism whereby a single stable token has bancor relays to multiple other stabletokens. (one stabletoken per collateral token.)
  • Cross-blockchain support using BancorX
Clone this wiki locally
You can’t perform that action at this time.