Skip to main content

Get gauges

  • A gauge allocates rewards to a single share token.
  • The gauge owner can create an unlimited number of incentive programs. Each program is defined by a reward token, an emission rate, and a distribution end date (must be a future date). If you opt not to fund an active program with the reward token, or gauge runs out of it, users cannot claim accrued incentives. Once the gauge is funded, users can claim their rewards. To deactivate a program, we suggest setting the emission rate to zero. A unique string name identifies each program. To modify an existing program, you must provide the program name, emission rate, and distribution end date (which must be set in the future).
  • The gauge owner retains the right to withdraw all funds deposited in the gauge at any time and for any reason through the rescue function.
  • The current gauge supports reward tokens with 18 decimals. For the time being, we advise using reward tokens with 18 decimals.
  • When you deploy a gauge for a share token, you typically maintain ownership of the gauge. Having an owner prevents the gauge from being DOS’d.
  • The market’s SiloConfig allows for a total of up to six gauges across silo0 and silo1 - two silos form one market - with each silo supporting a maximum of three share tokens. The gauge address can be set to zero, indicating no incentives are being distributed. Configured gauge example: https://sonicscan.org/address/0x2D3d269334485d2D876df7363e1A50b13220a7D8#readContract

Retrieve a gauge

import {ISiloConfig} from "silo-core/contracts/interfaces/ISiloConfig.sol";
import {GaugeHookReceiver, IGauge} from "silo-core/contracts/utils/hook-receivers/gauge/GaugeHookReceiver.sol";
import {IGaugeLike} from "silo-core/contracts/interfaces/IGaugeLike.sol";


// get ConfigData for each silo
(address silo0, address silo1) = _siloConfig.getSilos();
ISiloConfig.ConfigData memory configData0 = _siloConfig.getConfig(silo0);
ISiloConfig.ConfigData memory configData1 = _siloConfig.getConfig(silo1);

// Get three gauges for every share token in one Silo, for example silo0
GaugeHookReceiver hookReceiver = GaugeHookReceiver(configData0.hookReceiver);
address protectedShareTokensGauge = address(hookReceiver.configuredGauges(IShareToken(configData0.protectedShareToken)));
address collateralShareTokensGauge = address(hookReceiver.configuredGauges(IShareToken(configData0.collateralShareToken)));
address debtShareTokensGauge = address(hookReceiver.configuredGauges(IShareToken(configData0.debtShareToken)));

Useful interactions with a gauge

// Returns the share token address this incentives controller is configured for. Equal to the args used in hookReceiver.configuredGauges
gauge.share_token();

// Returns all incentives programs for this share token.
gauge.getAllProgramNames();

// Returns the wS_sUSDC_0020 incentives program details, silo-core/contracts/incentives/base/DistributionManager.sol
gauge.incentivesProgram("wS_sUSDC_0020");

// msg.sender claiming rewards
gauge.claimRewards(who);