Fortress
Search…
FTS Distributed Per Block (Single Market)
The Unitroller Storage contract has a mapping called fortressSpeeds. It maps fToken addresses to an integer of each market’s FTS distribution per BSC block. The integer indicates the rate at which the protocol distributes FTS to markets’ suppliers or borrowers. The value is the amount of FTS (in wei), per block, allocated for the market. Note that not every market has FTS distributed to its participants (see Market Metadata).
The speed indicates how much FTS goes to the suppliers or the borrowers, so doubling this number shows how much FTS goes to market suppliers and borrowers combined. The code examples implement reading the amount of FTS distributed, per BSC block, to a single market.

Unitroller

mapping(address => uint) public fortressSpeeds;

Solidity

Unitroller troll = Unitroller(0x123...);
address fToken = 0xabc...;
// FTS issued per block to suppliers OR borrowers * (1 * 10 ^ 18)
uint fortressSpeed = troll.fortressSpeeds(fToken);
// Approximate FTS issued per day to suppliers OR borrowers * (1 * 10 ^ 18)
uint fortressSpeedPerDay = fortressSpeed * 4 * 60 * 24;
// Approximate FTS issued per day to suppliers AND borrowers * (1 * 10 ^ 18)
uint fortressSpeedPerDayTotal = fortressSpeedPerDay * 2;

Web3 1.0

const fTokenAddress = '0xabc...';
const unitroller = new web3.eth.Contract(unitrollerAbi, unitrollerAddress);
let fortressSpeed = await unitroller.methods.fortressSpeeds(fTokenAddress).call();
fortressSpeed = fortressSpeed / 1e18;
// FTS issued to suppliers OR borrowers
const fortressSpeedPerDay = fortressSpeed * 4 * 60 * 24;
// FTS issued to suppliers AND borrowers
const fortressSpeedPerDayTotal = fortressSpeedPerDay * 2;