Skip to content

TRC-484:TRON liquidity staking and resource market #484

@raymondliu0711

Description

@raymondliu0711
tip: 484
title: Smart Contract Standard for TRX liquidity staking and resource market 
author: raymondliu0711
discussions-to: https://github.com/tronprotocol/tips/issues/484
status: Draft
type: Standards Track
category: TRC
created: 2022-11-28
requires: TIP-271, TIP-467

Simple Summary

This post proposes a standard for smart-contracts to implement TRX-staking and resource-rental markets after the adoption of TIP-271 and TIP-467. With this standard, this kind of markets could be integrated by other DeFi protocols.

Abstract

When TRX is frozen to participate in on-chain governance, it is not liquid and cannot be combined with ecosystems of smart contract, which greatly limits the usage scenarios of TRX freezing, and discourages TRX holders from freezing TRX and voting to participate in TRON governance.

With the adoption of TIP-271 and TIP-467, freezing, voting and delegating resource operations can be implemented with smart contracts. Furthermore, smart-contracts can be build to provide TRX liquidity staking and resource rental. This kind of market would increase the flexibility and improve the revenue of TRX staking, and allow the community to regulate the price of energy and bandwidth resources in a more flexible way.

So, We propose a standard for smart contract to implement this market. Adopting the same specification facilitates the integration of other Defi protocols.

Motivation

Currently, TRON’s DPoS scheme is only implemented natively by the chain, and the TRX in stake cannot be transferred to others, which is not liquid and cannot be integrated with the contract ecosystem. Users need to unfreeze TRX and wait for a delay before they can transfer these TRX. During the unfreezing period, users do not hold their original voting revenue and free resources.

Staking TRX into TRC-20 tokens, where the staked TRX can share in the SR voting revenue, solves these problems. Users of the tokens share voting revenue during the staking period and can transfer the directly when transferring assets, without the need to unfreeze TRX. At the same time, the tokens also comply well with TRON’s existing ecosystem.

In addition, the TRON network currently provides only 27 free energy for 1 staked TRX, and 518 TRX to get the 14,000 free energy needed for a standard TRC20 transfer, which means a lot of TRX needs to be staked for users with the consistent need of large amounts energy, and it is inconvenient for transient users with needs of small amounts energy to stake and unstake TRX frequently. As you can see from the actual data, TRON has a very high percentage of burning TRX in its transactions.

After tokenizing staked TRX, it will also get free resources (energy/bandwidth), and if they implement a resource leasing mechanism in it, anyone can lease energy from it, and the energy pricing can be flexibly and dynamically adjusted according to the chain and ecology.

Staking TRX Tokenization Combined with the energy market would reduce the obstacle of TRX staking and help to increase the TRX staking rate of TRON; it would also achieve self-balancing of energy supply and demand and help to promote the development of the TRON ecology.

Therefore, it is necessary for us to provide a standard for such contracts, as TRC-484, so that their implementations can be integrated by other DeFi protocols in the community.

Specification

We propose a standard, TRC-484, for decentralized TRX liquidity stake and resource rental market that consists of the following main points.

  1. stake tokenization, and the token can be combined into TRON ecology.
  2. provide an automatically adjustable resource rental market.
  3. any TRX holder can participate in TRON governance by depositing TRX through the standard, instead of on-chain staking.

The standard TRC-484 is as follows.
TRX holders deposit TRX to obtain a corresponding number of pass-through TRC-484 tokens. TRC-484 tokens are freely circulating and convertible with TRX, and can participate in other ecology of the TRON as a standard TRC-20 token.

Holders of TRC-484 tokens share the revenue, which comes from two sources: on-chain frozen TRX voting rewards and revenue from resource rental.

The implementation should be governed by the DAO composed of TRC-484 token holders, and the behavior should include: electing SRs to vote for, adjusting the price strategy of resource rental, etc. The DAO governance will enable the flexible adjustment of resource prices on the chain.

The specification below is just a simple draft and it needs further discussion. We are working on improving it, and all kinds of opinions are welcome.

Every TRC-484 compliant contract must implement the TRC484 and TRC20 interfaces

interface TRC484 /* is TRC20 */ {
    
    /// @dev Deposit `msg.value` TRX to the contract and receive `amount` of TRC484 token.
    function deposit() public payable returns (uint256 amount);
    
    /// @dev Exit `_value` TRC484 token and receive `trxAmount` of TRX.
    function exit(uint256 _value) public returns (uint256 trxAmount);
    
    /// @dev Exit for exact `_trxValue` TRX and pays `tokenAmount` of TRC484 token.
    function exitExact(uint256 _trxValue) public returns (uint256 tokenAmount);
    
    /// @dev Rent `_type` resources of `_amount` TRX for `_period` time units and pays `msg.value` TRX for the rent, and an id `rentId` is assigned to the rent for redeem.
    function rentResources(uint256 _type, uint256 _amount, uint256 _period) public payable returns (uint256 rentId);
    
    /// @dev Repay the rent of `_rentId`, the return value `success` indicates if it is success.
    function repayResources(uint256 _rentId) public returns (bool success);
    
}

Backward Compatibility

There are no backward compatibility issues.

Implementation

There is no detailed implementation so far, but the basic concepts and components of the standard can be indicated in the figure below.

TRC-484

TRX holders can deposit TRX to the TRC-484 contract and get TRC-484 token, meanwhile, TRC-484 token holders can exit TRX with TRC-484 token from it. TRC-484 token holders compose the DAO and govern the contract, they can also participate in the TRON ecosystem as TRC-484 token can serve as a standard TRC-20 token.

The TRC-484 contract freezes the deposited TRX, votes for SRs, provides resources to and collects rent from resourceUsers, and distributes the voting and rental rewards to TRC-484 token holders.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions