Anchor: principal protected staking on Terra

While there is no doubt that Luna offers staking returns that are significantly higher than what is offered by comparable proof of stake networks (10+% today vs 8% for Cosmos and 5.81% for Tezos), its price volatility leaves many investors wary of staking the asset. Despite Luna’s higher staking returns, the percentage of Luna supply currently staked lags significantly below the staking market average. This proves that the staking decisions for a significant proportion of investors is dominated by price volatility of the staking token rather than the expected yield. The solution is to create a principal protected staking product for Luna , such that investors may participate in staking without having to speculate on Luna’s price movement.

Algorithm overview

The system consists of three components:

  • Smart contract layer: WASM module added to Terra Core
  • bLuna: a derivative token representing bonded Luna minus bonding costs
    • Minting : A delegator may mint a bLuna token by “locking” a part or all of their bonded Luna position. The number of bonded bLuna created is # of Luna bonded * (1 - commission rate) .
    • Burning : A delegator may burn a bLuna token and regain control over their bonded Luna position. The number of bLuna tokens that must be burned is equal to the number of tokens originally minted from the position.
    • Bonding changes: There exists a number of changes that can impact the economics of the underlying bonded Luna position, such as changes in the validator’s commission or slashing. Such changes are simply absorbed by the global pool of bLuna - we may add a minting or burning tax later to compensate for this risk.
    • Staking rewards : Staking rewards for the underlying Luna position propagate to the bLuna token in cash flows.
  • liquid money market: replication of the compound protocol over bLuna. bLuna can be used as collateral to borrow Terra (inspired by compound)
    • Parameter : The protocol defines a borrow_capacity , which is the Loan to Value (LTV) ratio between 0 and 1 at the time of the issuance of the loan. The parameter can be changed by governance of Luna stakeholders. Given that liquidation does not need to happen in the open market, the borrow capacity can be high.
    • Borrower dynamics : The borrower can open a debt position by collateralizing bLuna and borrow up to oracle_value(collateral) * borrow_capacity in any Terra stablecoin. When the position falls below the borrow capacity, the position is margin called and the collateral bLuna is swapped to Terra to cover the loan.
    • Lender dynamics : The lender can deposit Terra into a global lending pool and earn an interest pro-rata to his contribution divided by the size of the lending pool. For example, for period t, his interest is R_t * C_u / P_t where C_u is the total contribution of the user to the lending pool and P_t is the size of lending pool at time t, and R_t is the staking rewards from the bLuna currently held as collateral.

Overall, this system captured by a smart contract layer, a Luna staking derivative and a compound money market facilitates a use case where users can get exposure to Luna staking on Terra deposits in a way that protects the deposit principal.

5 Likes

I like it .

What would be the complexity of adding a WASM module to Terra Core?

This would be a fork of cosmos WASM which the regen team developed and is in their testnet. Not too much work for us! Just a few modifications

Hi @dokwon, nice to hear your interest in CosmWasm.com

It is actually created by my company, Confio, rather than Regen. Although I am collaborating with them quite a bit and they will be the first public testnet to use it. It has been designed from the ground up to be a multi-chain contracting environment and this works best if everyone keeps the same interfaces, so the same contracts can run on multiple networks. We are also planning to work on IBC-aware contracts in the next months.

Using smart contracts as an intermediary between users (public keys) and staking (bonded tokens) is one use case I have thought much about in theory, and it is nice to read your ideas on actual business logic to implement there. I would be happy to discuss your ideas and our roadmap more in depth.

We are moving fast and adding features and I would recommend against forking it now (this is a deep stack of repos in Go, Rust, and TypeScript), but rather import the pieces you need, and customize how they are used by your app. CyberCore easily imported the x/wasm module from the CosmWasm/wasmd repo into their own app - it just requires you to be based on Cosmos SDK 0.38. You can check out https://medium.com/confio to see much of the progress we have made in the last month or two alone.

I’m happy to see your interest and open to collaborating on a successful integration.

3 Likes

This would be a fork of cosmos WASM which the regen team developed and is in their testnet. Not too much work for us! Just a few modifications

What would the Wasm module be used for?

liquid money market: replication of the compound protocol over bLuna. bLuna can be used as collateral to borrow Terra (inspired by compound)

I am not too familiar with how Cosmos works, but couldn’t a third party team just build this on top of Terra or why do you think it’s best that the Terra team is building this?

Anchor depends on a few components with nontrivial complexity. For instance, the creation of the bLuna staking derivative would need to account for bonding costs, validator state changes (slashing etc) that should logically should not sit on layer 1. Money market code also needs to be logically decoupled for similar reasons.

Besides from Anchor, there are teams that are working on dApps needing either cross border stablecoin swaps / payment facilities, so WASM integration would help us service these teams.

We will be issuing RFPs this week for the development of these components. We already have several teams interested in one or more projects.

Hey Ethan! Thanks for reaching out. Already doing work to upgrade to SDK 0.38, will reach out if we run into any issues. Glad we have this opportunity to collaborate closely :slight_smile: