Skip to main content

Get gauges

Each share token can be linked to a configured gauge that distributes incentives to its holders. A single gauge may manage multiple incentive programs for a share token, with each program defined by a unique reward token, emission rate, and distribution end date.

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 gauges

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

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);