GoodMarketMaker
Helper contract for the GoodReserveCDai. It serves as a dynamic reserve ratio market maker.
Last updated
Helper contract for the GoodReserveCDai. It serves as a dynamic reserve ratio market maker.
Last updated
Emits when a change has occurred in a reserve balance, i.e. buy / sell will change the balance.
Parameter name | Annotation |
---|---|
Emits when the ratio changed. The caller should be the Avatar by definition.
Calculates how much to decrease the reserve ratio for _token
by the reserveRatioDailyExpansion
.
Returns: the new reserve ratio.
Calculates the buy return in G$ according to the given _tokenAmount
.
Returns: A number of G$ that should be given in exchange as calculated by the bonding curve.
Calculates the sell return in _token
according to the given _gdAmount
.
Returns: A number of tokens that should be given in exchange as calculated by the bonding curve.
Updates the _token
bonding curve params. Emits BalancesUpdated
with the new reserve token information.
Returns: A number of G$ that will be given in exchange as calculated by the bonding curve.
Calculates the sell return with contribution in _token
and update the bonding curve params. Emits BalancesUpdated
with the new reserve token information.
Returns: A number of tokens that will be given in exchange as calculated by the bonding curve.
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
Parameter name | Annotation |
---|---|
caller
The account who initiated the action.
reserveToken
The address of the reserve token.
amount
The incoming amount.
returnAmount
The return value.
totalSupply
The updated total supply.
reserveBalance
The updated reserve balance.
caller
The address of the staker.
nom
Nominator of the ratio.
denom
Denominator of the ratio.
_token
The reserve token to calculate the reserve ratio for.
_token
The reserve token buying with.
_tokenAmount
The amount of reserve token buying with.
_token
The reserve token buying with.
_gdAmount
The amount of reserve token buying with.
_token
The reserve token buying with.
_tokenAmount
The amount of reserve token buying with.
_token
The desired reserve token to have.
_gdAmount
The amount of G$ that are sold.
_contributionGdAmount
The number of G$ tokens that will not be traded for the reserve token.