Views on offers
Mangrove provides a number of getter functions providing views on offers and %%offer lists|offer-list%%.
Public getters
best(OLKey memory olKey)
best(OLKey memory olKey)
Info :
Returns the offerId
of the best offer in the %%offer list|offer-list%%.
Solidity
offers()
, offerDetails()
, offerData()
, and offerInfo()
offers()
, offerDetails()
, offerData()
, and offerInfo()
Mangrove.offers(OLKey memory olKey, uint offerId)
: get an offer in packed format.Mangrove.offerDetails(OLKey memory olKey, uint offerId)
: get an offer detail in packed format.Mangrove.offerData(OLKey memory olKey, uint offerId)
: get both offer and offer detail in packed format.MgvReader.offerInfo(OLKey memory olKey, uint offerId)
: get both offer and offer detail in unpacked format.
Info :
Solidity
isLive(Offer offer)
isLive(Offer offer)
Info :
An offer is live in a given Offer List if it can be matched during a market order. The view function isLive
can be used to verify whether an ID identifies a live offer (i.e. gives
is not zero) in its offer list.
Solidity
Custom types
Info :
Offer data is split between OfferUnpacked
and OfferDetailUnpacked
for storage read/write optimisation (as both structs can be efficiently packed in storage).
OfferUnpacked
OfferUnpacked
prev
uint
ID of the preceeding offer with the same tick (if the offer is live)
next
uint
ID of the next offer with the same tick (if the offer is live)
tick
Tick
The offer's "price" %%tick
gives
uint
The amount of outbound token the offer gives
OfferDetailUnpacked
OfferDetailUnpacked
maker
address
Address of the offer maker, either an EOA or a Maker contract
gasreq
uint
Gas required by the offer (in gas units)
kilo_offer_gasbase
uint
Mangrove's kilo_offer_gasbase
at the time the offer was posted (in 1k gas units)
gasprice
uint
The gas price covered by the offer bounty (in Mwei per gas unit)
Last updated