Strike Docs
  • 📖Strike Documentation
  • ⭐Getting Started
    • 🧑‍🏫Guides
    • 🔬Networks
    • 📒Protocol Math
      • sToken and Underlying Decimals
      • Interpreting Exchange Rates
      • Calculating Accrued Interest
      • Calculating the APY Using Rate Per Block
    • 💹Gas Costs
  • 🎙️STokens
    • Mint
    • Redeem
    • Redeem Underlying
    • Borrow
    • Repay Borrow
    • Repay Borrow Behalf
    • Transfer
    • Liquidate Borrow
    • Key Events
    • Error Codes
    • Failure Info
    • Exchange Rate
    • Get Cash
    • Total Borrow
    • Borrow Balance
    • Borrow Rate
    • Total Supply
    • Underlying Balance
    • Supply Rate
    • Total Reserves
    • Reserve Factor
  • ⚙️Comptroller
    • Enter Markets
    • Exit Market
    • Get Assets In
    • Collateral Factor
    • Get Account Liquidity
    • Close Factor
    • Liquidation Incentive
    • Key Events
    • Error Codes
    • Failure Info
    • STRK Distribution Speeds
    • Claim STRK
    • Market Metadata
  • 👨‍👩‍👦Governance
    • Delegate
    • Delegate By Signature
    • Get Current Votes
    • Get Prior Votes
    • Key Events
    • Governor Alpha
    • Quorum Votes
    • Proposal Threshold
    • Proposal Max Operations
    • Voting Delay
    • Voting Period
    • Propose
    • Queue
    • Execute
    • Cancel
    • Get Actions
    • Get Receipt
    • State
    • Cast Vote
    • Cast Vote By Signature
    • Timelock
    • Pause Guardian
  • 🔡API
    • STokenService
      • GET: /stoken
    • MarketHistoryService
      • GET: /market_history/graph
    • ProposalService
      • GET: /proposals
      • GET: /proposals/:id
      • GET: /proposals/statistics
    • VoterService
      • GET: /voters/accounts
      • GET: /voters/accounts/:address
      • GET: /voters/history/:address
      • GET: /voters/:proposalId
    • GovernanceService
      • GET: /governance/strike
      • GET: /governance/proposals
      • GET: /governance/proposal_vote_receipts
      • GET: /governance/accounts
    • UserHistoryService
      • GET: /user/history
    • LiquidationService
      • GET: /get_liquidators
      • GET: /get_liquidator:account
      • GET: /get_liquidator_detail:account
      • GET: /liquidator
    • Shared Data Types
  • ⌛Strike.js
    • Strike Constructor
    • API Methods
      • Account
      • sToken
      • Market History
      • Governance
    • sToken Methods
      • Supply
      • Redeem
      • Borrow
      • Repay Borrow
    • STRK Methods
      • To Checksum Address
      • Get Strk Balance
      • Get Strk Accrued
      • Claim Strk
      • Delegate
      • Delegate By Sig
      • Create Delegate Signature
    • Comptroller Methods
      • Enter Markets
      • Exit Market
    • Ethereum Methods
      • Read
      • Trx
      • Get Balance
    • Governance Methods
      • Cast Vote
      • Cast Vote By Sig
      • Create Vote Signature
    • Price Feed Methods
      • Get Price
    • Utility Methods
      • Get Address
      • Get ABI
      • Get Network Name With Chain ID
  • 🤑DeFi 3.0 Vault
  • 🍍Revenue Share Staking
  • 🔒Security
    • Formal Verification
    • Bug Bounty Program
    • Immunefi
Powered by GitBook
On this page
  • STRK Speed
  • STRK Distributed Per Block (All Markets)
  • STRK Distributed Per Block (Single Market)

Was this helpful?

  1. Comptroller

STRK Distribution Speeds

STRK Speed

The "STRK speed" unique to each market is an unsigned integer that specifies the amount of STRK that is distributed, per block, to suppliers and borrowers in each market. This number can be changed for individual markets by calling the _setStrikeSpeed method through a successful Strike Governance proposal.

The following is the formula for calculating the rate that STRK is distributed to each supported market.

utility = sTokenTotalBorrows * assetPrice

utilityFraction = utility / sumOfAllStrikedMarketUtilities

marketStrikeSpeed = strikeRate * utilityFraction

STRK Distributed Per Block (All Markets)

The Comptroller contract’s strikeRate is an unsigned integer that indicates the rate at which the protocol distributes STRK to markets’ suppliers or borrowers, every Ethereum block. The value is the amount of STRK (in wei), per block, allocated for the markets. Note that not every market has STRK distributed to its participants (see Market Metadata).

The strikeRate indicates how much STRK goes to the suppliers or borrowers, so doubling this number shows how much STRK goes to all suppliers and borrowers combined. The code examples implement reading the amount of STRK distributed, per Ethereum block, to all markets.

Comptroller

uint public strikeRate;

Solidity

Comptroller troll = Comptroller(0xABCD...);

// STRK issued per block to suppliers OR borrowers * (1 * 10 ^ 18)
uint strikeRate = troll.strikeRate();

// Approximate STRK issued per day to suppliers OR borrowers * (1 * 10 ^ 18)
uint strikeRatePerDay = strikeRate * 4 * 60 * 24;

// Approximate STRK issued per day to suppliers AND borrowers * (1 * 10 ^ 18)
uint strikeRatePerDayTotal = strikeRatePerDay * 2;

Web3 1.2.6

const comptroller = new web3.eth.Contract(comptrollerAbi, comptrollerAddress);

let strikeRate = await comptroller.methods.strikeRate().call();
strikeRate = strikeRate / 1e18;

// STRK issued to suppliers OR borrowers
const strikeRatePerDay = strikeRate * 4 * 60 * 24;

// STRK issued to suppliers AND borrowers
const strikeRatePerDayTotal = strikeRatePerDay * 2;

STRK Distributed Per Block (Single Market)

The Comptroller contract has a mapping called strikeSpeeds. It maps sToken addresses to an integer of each market’s STRK distribution per Ethereum block. The integer indicates the rate at which the protocol distributes STRK to markets’ suppliers or borrowers. The value is the amount of STRK (in wei), per block, allocated for the market. Note that not every market has STRK distributed to its participants (see Market Metadata).

The speed indicates how much STRK goes to the suppliers or the borrowers, so doubling this number shows how much STRK goes to market suppliers and borrowers combined. The code examples implement reading the amount of STRK distributed, per Ethereum block, to a single market.

Comptroller

mapping(address => uint) public strikeSpeeds;

Solidity

Comptroller troll = Comptroller(0x123...);
address sToken = 0xabc...;

// STRK issued per block to suppliers OR borrowers * (1 * 10 ^ 18)
uint strikeSpeed = troll.strikeSpeeds(sToken);

// Approximate STRK issued per day to suppliers OR borrowers * (1 * 10 ^ 18)
uint strikeSpeedPerDay = strikeSpeed * 4 * 60 * 24;

// Approximate STRK issued per day to suppliers AND borrowers * (1 * 10 ^ 18)
uint strikeSpeedPerDayTotal = strikeSpeedPerDay * 2;

Web3 1.2.6

const sTokenAddress = '0xabc...';

const comptroller = new web3.eth.Contract(comptrollerAbi, comptrollerAddress);

let strikeSpeed = await comptroller.methods.strikeSpeeds(sTokenAddress).call();
strikeSpeed = strikeSpeed / 1e18;

// STRK issued to suppliers OR borrowers
const strikeSpeedPerDay = strikeSpeed * 4 * 60 * 24;

// STRK issued to suppliers AND borrowers
const strikeSpeedPerDayTotal = strikeSpeedPerDay * 2;
PreviousFailure InfoNextClaim STRK

Last updated 4 years ago

Was this helpful?

⚙️