Plain English (Detailed)

Key Protocol Activities

User Staking DAI

  • User stakes DAI (or other token) in the {UserManager contract}

  • Dai Staked is further deposited into the {assetmanager} which can hold tokens as vanilla DAI or drop it into a 3rd party lending pool(such as Compound) in a way that the principal and interest are both accounted for. Principal is owned by staker & Interest is owned by the protocol ‘dao’.

  • Staked funds exist in 3 states:

    • “Free Stake” = Withdrawable & Earning: These are staked funds that aren’t backing an active borrow

    • “Utilized Stake” = Earning & Non-withdrawable: These are staked funds that are backing an active borrow

    • “Defaulted Stake” = Not-earning & Not-withdrawable: These are staked funds that are backing a delinquent borrow.

Stakers earning Union from Comptroller

  • The Treasury contract drips UNION to the comptroller at a specified amount per block

  • The comptroller lets UNION Token be claimed by stakers based on a combination of their individual activity and global staking behavior.

  • The algorithm that determines how much UNION each user can claim each block is a half decay curve with total dai staked as the input.

    • That equation currently is a table approximation of a half decay function re: the more dai staked the less union is claimable, until the amount staked = midpoint at which the rate drops off precipitously. The midpoint is meant to be the available credit, so we aren’t over-incentivizing staking when there is no available credit, but we’ll likely set this high in the beginning to speed up decentralization.

  • The output of that curve is then used to get a “UNIONperDAIperBlock” rate which is multiplied by your current stake.

  • If you’re not a member that rate is multiplied by 0.75 if you’re not a member yet. If you are a member it is multiplied by you utilization rate (utilized stake / total non frozen stake) effectively giving a 2x bonus for each DAI backing an active non defaulted borrow.

  • Stake utilization is meant to give control of the protocol to those who vouch for people who borrow and dont default. And the 0.75 is to allow non-members a non financial means but still sybil resistant way to acquire the UNION. The curve is upgradeable without requiring a fork or a withdrawal of the dai staked. All of this is handled by the {Comptroller.sol Contract}

Members Borrow Dai

  • A Member can borrow dai up to [available credit limit] from a separate lending pool(uToken).

  • Available credit limit = Credit Limit - Outstanding Balance

  • [Credit limit] is based on the credit limit algorithm.

  • The Credit Limit Algorithm determines both how much can be borrowed and how much stake should be frozen when a borrow takes place. Currently this is SumOfTrust: Credit Limit = Sum(Available Vouch) and the locked amount locks the borrowed amount starting from the highest vouch.

  • Origination Fee: To account for the front loaded risk Borrowed amount on withdrawal = Amount withdrawn multiplied by 1 + the {origination fee}.

  • Balance increases at {apr_rate} vouched principle is not withdraw-able up to the amount of vouchees balance

  • A loan is considered in default if a minimum payment (the interest accrued) hasn’t been paid in X # of blocks This is currently set to [30 days]

  • Borrow amount safety limit factors:

    • Min/Max loan size

    • Global debt ceiling for each asset

    • Current balance of the lending pool, including bootstrap deposit and interest earned from staking funds

    Borrower repays loan

  • After a member withdraws a credit line they have a balance owed

  • They can repay as much or as little at any time, including a pay off all setting.

  • The different payment UX between duration and/or loan type(e.g. revolving-line, installment) can be handled through differing UI’s or aided by helper contracts.

  • If a borrower is late, they can’t withdraw more and their vouchers stop earning UnionTokens on the stake that’s underwriting that borrow.

  • If they make a payment to get back in good standing their voucher starts earning again. Any address can repay the debt of any address.

  • The interest of all loans is split between the reserve and utoken holders based on the reserve factor. If it’s set to 1.0 all interest is directed to the reserve.

Members vouch for other members

  • Any member can set an amount they trust any other address.

  • If trust>stake: vouch = stake.

  • If trust<stake: vouch = trust

  • Update Trust: can increase or decrease by calling updateTrust. Can’t lower below what is currently being utilized.

  • A member can't vouch for themselves.

  • A vouch can be removed by either the vouchee or the voucher.

  • A vouch can only be removed if unused

  • A voucher can voluntarily writeoff() an active loan at any time by giving up locked stake. This is irreversible.

  • As of v2 if the borrower is overdue for a max period(60 days) then anyone can call the writeoff() function.

Applying/Becoming a member

  • To be added to the member list you must register your address.

  • A member can add Trust to any address. So non-member could have a membership & credit limit waiting for them.

  • Calling that function requires a burn of UNION. This is to prevent spam attacks and account for the marginal increase in system wide costs of adding another member.

uToken Liquidity Providers

  • Anyone can deposit DAI to the uToken contract and mint uDAI

  • uDAI is a claim on the DAI deposited into the contract by uDAI minters.

  • This DAI is borrowed by members with Credit Limits

  • When DAI is repaid any interest is sent to uDAI holders or the Reserve based on the reserve factor. uDAI can be burned to claim DAI at the internal exchange rate

AssetManager

All tokens are held in the assetmanager contract

The asset manager is capable of depositing assets into other markets(Adaptors) at a specified ratio.

Currently there are adaptors for Compound.v2 and AAVE.v2. If any interest is earned that interest goes to grow the available credit but is not distributed to UNION holders, stakers, or uDAI minters.

Governance

The primary purpose of the UNION Token is to govern the protocol.

All parameters, as well as upgradeable proxy logic are changeable via majority vote of the UNION Token holders.

Can add new markets with any erc20 asset and parameterizations.

Initial UNION supply is 1 Billion and governance can mint 2% a year after 4yrs.

Last updated