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.MgvStructs.GlobalUnpacked
  • MgvLib.MgvStructs.LocalUnpacked
  • Views
  1. Contracts
  2. Technical references
  3. Governance parameters

Data structures and views

Global governance parameters and Offer List specific parameters.

Last updated 2 years ago

Ground truth for configuration can be found in the code . All configuration options are under the control of governance.

MgvLib.MgvStructs.GlobalUnpacked

Name
Type
Description

gasprice

uint16

Internal gas price estimate, in gwei/gas. Used to calculate the provision required for writing offers.

monitor

address

If enabled, acts as a gas price oracle for Mangrove and/or receives notifications when an offer is executed.

useOracle

bool

If true, monitor will be used as a gas price oracle. Otherwise the internal gas price global parameter will be used.

notify

bool

If true, monitor will be called every time an offer has been executed.

gasmax

uint24

Maximum gas an offer can require.

dead

bool

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.

MgvLib.MgvStructs.LocalUnpacked

For every pair of addresses, there is a set of local parameters. Note that the parameters for the A/B pair might be different from the B/A pair parameters.

Name
Type
Description

active

bool

If inactive, offers on this pair can only be retracted.

fee

uint16

Fee in basis points, at most 500.

density

uint32

Minimum amount of token an offer must promise per gas required.

overhead_ gasbase

uint24

Constant gas overhead associated with taking an any number of offers in 1 call.

offer_gasbase

uint24

Gas overhead associated with taking one offer.

Views

For read/write efficiency, Mangrove provides access to configuration parameters in a packed manner via the getter config(address outbound, address inbound).

config.sol
import "src/IMangrove.sol";

// context of the call
address MGV;
address outTkn;
address inbTkn;

// getting Mangrove's global configuration parameters and those that pertain to the `(outTkn, inTkn)` offer list
// in an ABI compatible format (gas costly, use for offchain static calls)
(MgvStructs.GlobalUnpacked global, MgvStructs.LocalUnpacked local) = IMangrove(MGV)
.configInfo(outTkn, inTkn);

// getting packed config data (gas efficient)
(MgvStructs.GlobalPacked global32, MgvStructs.LocalPacked local32) = IMangrove(MGV)
.config(outTkn, inTkn);

// for all fields f of `GlobalUnpacked global` 
// one may unpack a specific element of `GlobalPacked global32` using the following scheme:
global.f == global32.f()

// for all fields f of `LocalUnpacked local` 
// a similar scheme applies to `LocalPacked local32`:
local.f == local32.f()

The data structures containing Mangrove's global and local are accessible via the public view function configInfo(address outbound, address inbound) function.

documentation
configuration parameters