XCN Distribution Speeds
XCN Speed
The "XCN speed" unique to each market is an unsigned integer that specifies the amount of XCN that is distributed, per block, to suppliers and borrowers in each market. This number can be changed for individual markets by calling the _setXcnSpeed
method through a successful Onyx Governance proposal.
The following is the formula for calculating the rate that XCN is distributed to each supported market.
XCN Distributed Per Block (All Markets)
The Comptroller contract’s xcnRate
is an unsigned integer that indicates the rate at which the protocol distributes XCN to markets’ suppliers or borrowers, every Ethereum block. The value is the amount of XCN (in wei), per block, allocated for the markets. Note that not every market has XCN distributed to its participants (see Market Metadata).
The xcnRate indicates how much XCN goes to the suppliers or borrowers, so doubling this number shows how much XCN goes to all suppliers and borrowers combined. The code examples implement reading the amount of XCN distributed, per Ethereum block, to all markets.
Comptroller
Solidity
Web3 1.2.6
XCN Distributed Per Block (Single Market)
The Comptroller contract has a mapping called xcnSpeeds
. It maps oToken addresses to an integer of each market’s XCN distribution per Ethereum block. The integer indicates the rate at which the protocol distributes XCN to markets’ suppliers or borrowers. The value is the amount of XCN (in wei), per block, allocated for the market. Note that not every market has XCN distributed to its participants (see Market Metadata).
The speed indicates how much XCN goes to the suppliers or the borrowers, so doubling this number shows how much XCN goes to market suppliers and borrowers combined. The code examples implement reading the amount of XCN distributed, per Ethereum block, to a single market.
Comptroller
Solidity
Web3 1.2.6
Last updated