Public data structures

MgvLib.SingleOrder

Type
Field
Comments

OLKey

olKey

Struct 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)

uint

offerId

%%ID|offer-id%% of the offer that is matched by the order

Offer

offer

The offer given to the maker will be cleaned of prev/next pointers

uint

takerWants

The amount of outbound tokens that are required by the order (in max precision units of outbound_tkn ERC20).

uint

takerGives

The amount of inbound tokens that are given by the taker (in max precision units of inbound_tkn ERC20).

OfferDetail

offerDetail

Packing of the matched offer's detail. It holds the maker’s address and provision/penalty-related information: • makergasreqkilo_offer_gasbasegasprice

Global

global

Packing of the global parameters of Mangrove that apply to this order

Local

local

Packing of the offer list parameters that apply to this order

MgvLib.OrderResult

Type
Field
Description

bytes32

makerData

The returned or reverted value of %%makerExecute

bytes32

mgvData

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).