Skip to main content

Public data structures

MgvLib.SingleOrder

TypeFieldComments
OLKeyolKeyStruct containing:
outbound_tkn (address of the outbound token)
inbound_tkn (address of the inbound token)
tickSpacing (number of ticks that should be jumped between allowed ticks)
uintofferId%%ID|offer-id%% of the offer that is matched by the order
OfferofferThe offer given to the maker will be cleaned of prev/next pointers
uinttakerWantsThe amount of outbound tokens that are required by the order (in max precision units of outbound_tkn ERC20).
uinttakerGivesThe amount of inbound tokens that are given by the taker (in max precision units of inbound_tkn ERC20).
OfferDetailofferDetailPacking of the matched offer's detail. It holds the maker’s address and provision/penalty-related information:
maker
gasreq
kilo_offer_gasbase
gasprice
GlobalglobalPacking of the global parameters of Mangrove that apply to this order
LocallocalPacking of the offer list parameters that apply to this order

MgvLib.OrderResult

TypeFieldDescription
bytes32makerDataThe returned or reverted value of %%makerExecute
bytes32mgvData

It holds a message that was either returned by the maker or passed as revert message at the end of the trade execution. If the offer was a success it is equal to:

  • "mgv/tradeSuccess": offer execution succeeded.

If the offer failed (Offer Bounty will be taken from Maker Contract), it will be equal to one the following messages:

  • "mgv/makerRevert": offer execution reverted.
  • "mgv/makerTransferFail": Mangrove could not transfer order.outbound_tkn tokens from Maker Contract to itself (e.g. contract has insufficient balance).
  • "mgv/makerReceiveFail": Mangrove could not transfer order.inbound_tkn tokens to Maker Contract (e.g. contract is blacklisted).