The Season Facet contains the gm
function and handles all logic for Season changes.
Advances Beanstalk to the next Season, sending reward Beans to the caller's Circulating balance.
Advances Beanstalk to the next Season, sending reward Beans to a specified address and balance.
Returns the current Season number.
Returns whether Beanstalk is Paused. When Paused, sunrise
cannot be called.
Returns the Season struct.
Returns whether Beanstalk started this Season above or below peg.
Returns the block during which the current Season started.
Returns the expected Season number given the current block timestamp. The sunrise
function can be called when seasonTime() > season()
.
Returns the Weather struct.
Returns the Rain struct.
Returns the Season of Plenty (SOP) rewards per Root for the given Season.
Returns the cumulative deltaB across all pools on the Oracle Whitelist.
Returns the deltaB for a given pool.
Returns the last Well oracle snapshot for a given Well.
Returns the last Curve oracle data snapshot for the BEAN:3CRV pool.
Emitted when the Season changes.
Emitted when Beanstalk pays Beans to the sunrise
caller.
Emitted during Sunrise when Beans are distributed to the Field, the Silo, and Fertilizer.
Emitted during Sunrise when Beanstalk adjusts the amount of available Soil.
Emitted when the Weather (now Temperature) changes.
Emitted when Beans are minted during the Season of Plenty.
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Return Type | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Return Type | Description |
---|---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Return Value | Description |
---|---|
Parameter | Type | Description |
---|---|---|
Type |
---|
Return Value | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
uint256
The number of Beans minted to the caller.
account
address
Indicates to which address reward Beans should be sent.
mode
To
The balance to transfer Beans to; see LibTransfer.To
.
uint256
The number of Beans minted to the caller.
uint32
The current Season number.
bool
Whether Beanstalk is Paused.
Season
The Season struct in App Storage.
bool
Whether Beanstalk started this Season above or below peg.
uint32
The block during which the current Season started.
uint32
The expected Season number given the current block timestamp.
Weather
Returns the Weather struct in App Storage.
Rain
Returns the Rain struct in App Storage.
season
uint32
The Season to fetch SOP rewards per Root for.
uint256
The SOP rewards for the given Season.
deltaB
int256
The cumulative deltaB.
pool
address
The address of the pool .
int256
The deltaB for the given pool.
well
address
The address of the pool to get the snapshot for.
int256
co
Storage.CurveMetapoolOracle
Last Curve oracle data snapshot.
season
uint256
The new Season number.
account
address
The address to which the reward Beans were sent.
beans
uint256
The amount of Beans paid as a reward.
season
uint32
The Season in which Beans were distributed.
toField
uint256
The number of Beans distributed to the Field.
toSilo
uint256
The number of Beans distributed to the Silo.
toFertilizer
uint256
The number of Beans distributed to Fertilizer holders.
season
uint32
The Season in which Soil was adjusted.
soil
uint256
The new amount of Soil available.
season
uint256
The current Season.
caseId
uint256
The "Weather Case".
change
int8
The change in Temperature from the previous value.
season
uint256
The Season in which Beans were minted for distribution.
amount
uint256
The amount of 3CRV which was received for swapping Beans.
toField
uint256
The amount of Beans which were distributed to remaining Pods in the Field.
This page has not been updated yet for BIP-34, which made significant changes to the gm
incentive mechanism, or BIP-37, which updated the Beanstalk oracle. The Season Facet page is up to date.
The Sun advances Beanstalk to the next Season through the sunrise
function in the Season Facet. Every time an hour passes, sunrise
can be called 1 more time.
The Season Facet has several subcontracts:
Oracle.sol
-> Calculates the time weighted average number of Beans that Bean is above/below its value peg in all pools on the Oracle Whitelist.
Weather.sol
-> Changes the Max Temperature (interest rate) depending on the Bean price, debt level and demand for Soil.
sunrise
does the following steps:
Increments the Season number;
Calls Oracle
to get deltaB
;
Calls Weather
to adjust the Max Temperature and checks for Rain and Season of Plenty;
Calls Sun
to set the Soil and mint Beans if deltaB > 0
; and
Pays msg.sender
Beans for paying the transaction fee associated with calling the function.
In the Beanstalk ecosystem,
Rain is referred to as Oversaturation; and
Season of Plenty is referred to as Flood.