Mangrove
Mangrove
Mangrove
  • START HERE
    • What is Mangrove?
      • Smart offers
      • Bounty
      • Makers, Takers, Keepers
        • Makers
        • Takers
        • Keepers
    • Why Mangrove?
    • Who is the Mangrove dApp for?
    • Audits
    • FAQ
    • Glossary
    • Terms & Conditions
  • Strategies
    • Kandel
      • What is Kandel?
      • How does Kandel Work?
        • Step-by-step visual explanation
        • Parameters
        • Choosing Kandel parameters
        • Published Liquidity
        • More on failing offers
      • Potential risks
  • DAPP GUIDE
    • Swap
    • Trade
      • How to make an order
        • Market Order
        • Limit Order
        • Amplified Order
        • More on order types
      • Approvals
      • Minimum Volume
      • How to Track and Manage Orders
    • Earn
    • Rewards
    • Bridge
    • Wrap
  • MGV INCENTIVES
    • Fee Rewards
      • How the programs Work
      • Current programs
    • Vault LP programs
      • How the Programs Work
      • Current programs
      • Earning rewards
      • Example
      • Previous programs
    • MS2 Program (closed)
      • How Rewards Are Calculated
        • Reward Rate ρ
        • Takers Rewards
        • Adjusted Volume for Makers
        • How to Maximize Your Score
      • MGV Token Allocation per User Type
        • Specific Allocation for Kandel users and vault managers
        • Community Contributors
        • Incentives with a custom strategy
      • Epochs and Updates
    • MS1 Program (closed)
      • Intro
      • Trading Points
      • Boost
      • Referral Points
      • Community Points
      • Parameters
      • Technical Insights
      • MS1 FAQ
      • Disclaimer
  • Governance
    • General Governance
      • Key Stakeholders
        • Token Holders
          • Builders
        • Builders
        • Pods
      • Guardians
      • Governance Process
        • Initial Discussions
        • Proposals
        • Voting
        • Execution
    • Councils
      • Responsibilities
      • Elections
      • Budgets
    • Guides and resources
      • How to vote on a governance proposal
      • How to delegate my voting power
      • How to access the Builders’ directory
      • How to access the Pods’ directory
      • Snapshot configuration & membership
      • Links and adresses
  • QUICK LINKS
    • Whitepaper
    • Website
    • Feedback
    • Blog
    • GitHub
    • X
    • Discord
    • Telegram
    • Deployment adresses
Powered by GitBook
On this page
  • MgvLib.SingleOrder
  • MgvLib.OrderResult
  1. Contracts
  2. Technical references
  3. Taking and making offers
  4. Creating & Updating offers

Public data structures

Mangrove communicates with Offer Logics with public data structures described in this section.

Last updated 2 years ago

MgvLib.SingleOrder

Type
Field
Comments

address

outbound_tkn

outbound token address of the market order

address

inbound_tkn

inbound token address of the market order

uint

offerId

Id of the offer that is matched by the order

MgvStructs.OfferPacked

offer

Offer data of the current state of the offer on the offer list

uint

wants

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

uint

gives

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

MgvStructs.OfferDetailPacked

offerDetail

packing of the matched offer details

MgvStructs.GlobalPacked

global

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

MgvStructs.LocalPacked

local

packing of the market parameters that apply to this order

MgvLib.OrderResult

Type
Field
Description

bytes32

makerData

The returned or reverted value of makerExecute, truncated to fit a bytes32 word.

bytes32

mgvData

Information gathered by Mangrove concerning the offer 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 to itself (e.g. contract has insufficient balance).

  • "mgv/makerReceiveFail": Mangrove could not transfer order.inbound_tkn tokens to (e.g. contract is blacklisted).

Offer Logic
Offer Logic