Data structures and views
Last updated
Last updated
Ground truth for configuration can be found in the code . All configuration options are under the control of governance.
address
monitor
If enabled, acts as a gas price oracle for Mangrove and/or receives notifications when an offer is executed.
bool
useOracle
If true
, monitor will be used as a gas price oracle. Otherwise, the internal gas price global parameter will be used.
bool
notify
If true
, monitor will be called every time an offer has been executed.
uint
gasprice
Internal gas price estimate, in Mwei/gas. Used to calculate the provision required for writing offers.
uint
gasmax
Maximum gas an offer can require.
bool
dead
If true
, this Mangrove instance is dead and the only possible interactions are retracting offers and getting provisions back. Once true
, it cannot be set back to false
.
uint
maxRecursionDepth
The maximum number of times a market order can recursively execute offers. This is a protection against stack overflows.
uint
maxGasreqForFailingOffers
The maximum gasreq failing offers can consume in total. This is used in a protection against failing offers collectively consuming the block gas limit in a market order.
For every offer list, there is a set of local parameters. Note that the parameters for an (A,B,t) offer list might be different from the (B, A, t) offer list parameters.
Note that root
and level{1,2,3}
are part of the internal tick tree datastructure.
bool
active
If inactive, offers on this pair can only be retracted.
uint
fee
Fee in basis points, at most 255 (~2.5%).
Density
density
Minimum amount of token an offer must promise per gas required.
uint
kilo_offer_gasbase
Represents the gas overhead used by processing the offer inside Mangrove + the overhead of initiating an entire order, in 1k gas increments.
bool
lock
Re-entrancy and read-lock that is applied during order execution and cleaning.
uint
last
Counter for offer IDs, incremented every time a new offer is created.
Field
level3
Cache of level 3 for the best, non-empty tick of the tick tree.
Field
level2
Cache of level 2 for the best, non-empty tick of the tick tree.
Field
level1
Cache of level 1 for the best, non-empty tick of the tick tree.
Field
root
Root of the tick tree.
Info :
The data structures containing Mangrove's global and local configuration parameters are accessible via the public view function configInfo(address outbound, address inbound)
function on the MgvReader
periphery contract.
Info :
For read/write efficiency, Mangrove provides access to configuration parameters in a packed manner via the getter config(OLKey memory olKey).