Local variables
Taker feesβ
Taker fee is defined in basis points (i.e., in percents of a percent) of the total amount of outbound tokens received by taker. It is capped by the protocol to 5%. Collected fees accrue in the procol's vault that is Governance controlled.
- Signature
- Events
// Governance sets the fee for the `(outbound_tkn, inbound_tkn)` offer list
function setFee(address outbound_tkn, address inbound_tkn, uint fee) public;
event SetFee(address outbound_tkn, address inbound_tkn, uint fee); // emitted when fee is set
Offer gas baseβ
Offer gas base is an over-approximation of the gas overhead associated with processing one offer.
The Mangrove considers that a failed offer has used at least this amount of gas.
The parameter is offer list specific since the costs of calling outbound and inbound transferFrom
are part of the offer gasbase.
Offer gas base needs to be updated when ERC20 contracts managing inbound or outbound tokens change or when opcode prices are updated.
This parameter may aslo be used to increase/decrease bounty of failing offers in a specific offer list.
- Signature
- Events
// Governance sets the gas overhead for the `(outbound_tkn, inbound_tkn)` offer list
function setGasbase(address outbound_tkn, address inbound_tkn, uint offer_gasbase) public;
event setGasbase(address outbound_tkn, address inbound_tkn, uint offer_gasbase); // emitted when gasbase is set
Densityβ
Density is expressed in amount of outbound tokens delivered per gas units. The offer list's density corresponds to a "dust" parameter, which constraints the volume of outbound tokens an offer must deliver w.r.t the gas it requires to be executed. An offer cannot be posted on an offer list if its density is below the offer list's density.
The density of an offer in a (outbound, inbound)
offer list with an offer gasbase set to is defined as:
where is the volume of outbound tokens given by the offer and is the gas required by the offer.
- Signature
- Events
// Governance sets density for the `(outbound_tkn, inbound_tkn)` offer list
function setDensity(address outbound_tkn, address inbound_tkn, uint density) public;
event SetDensity(address outbound_tkn, address inbound_tkn, uint density); // emitted when density is set
A rationale to define density is to set it such that the gas required by an offer is negligible in front of the volume delivered. For instance setting offer list density with the formula:
with being the unit price of outbound tokens in ETH and insuring that the amount delivered per gas unit is times greater than , a realistic gas price.
(De)activating an Offer Listβ
An (outbound_tkn,inbound_tkn)
offer list is inactive by default, but may be activated/deactivated by governance. Only offer removals (and deprovision) are possible on innactive offer lists.
- Signature
- Events
// Governance activates the `(outbound_tkn, inbound_tkn)` offer list
function activate(address outbound_tkn, address inbound_tkn) public;
// Governance deactivates the `(outbound_tkn, inbound_tkn)` offer list
function deactivate(address outbound_tkn, address inbound_tkn) public;
event SetActive(address outbound_tkn, address inbound_tkn, bool isActive); // emitted when activation status changes