Mangrove
Developper
Developper
  • Welcome
  • Protocol
    • Introduction
    • Technical References
      • Overview
      • Ticks, ratios, and prices
      • Offer-list
        • Views on offers
      • Market-order
        • Delegation
      • Creating & Updating offers
        • Maker contract
        • Offer provisions
        • Gas requirement
        • Public data structures
        • Executing offers
      • Cleaning offers
      • Governance-parameters
        • Global variables
        • Local variables
        • Data structures and views
      • Periphery Contracts
        • MgvReader
        • MgvOracle
      • Literate Source Code
    • Background
      • Taking available liquidity
      • Making liquidity available
      • Reneging on offers
  • Strat Lib
    • What is the Strat Library?
    • Getting-started
      • Set Up Your Local Environment
      • Post a Smart Offer
    • Guides
      • Unlocking liquidity
      • Reposting an offer in the posthook
      • Using last look to renege trades
      • Determining gas requirements
      • Creating a Direct contract
      • Deploying your contract
      • Testing a maker contract
      • Safe offer logic guidelines
      • Approvals
    • Technical references
      • Principal hooks
      • Liquidity routing
      • API preferences
        • Core
          • SRC
            • IMangrove
        • Strats
          • SRC
            • Strategies
              • MangroveOffer
              • MangroveOrder
              • Integrations
                • AaveV3Borrower
                • AaveV3BorrowerImplementation
                • AaveV3BorrowerStorage
                • AaveV3Lender
                • CompoundModule
              • Interfaces
                • IForwarder
                • ILiquidityProvider
                • IOfferLogic
                • IOrderLogic
              • Offer_forwarder
                • Abstract
                  • Forwarder
              • Offer_maker
                • Abstract
                  • Direct
                • Market_making
                  • Kandel
                    • AaveKandel
                    • AaveKandelSeeder
                    • KandelSeeder
                    • Abstract
                      • AbstractKandelSeeder
                      • CoreKandel
                      • DirectWithBidsAndAsksDistribution
                      • GeometricKandel
                      • HasIndexedBidsAndAsks
                      • KandelLib
                      • TradesBaseQuotePair
              • Routeurs
                • SimpleRouter
                • Abstract
                  • AbstractRouter
                • Integrations
                  • AavePooledRouter
                  • HasAaveBalanceMemoizer
              • Utils
                • AccessControlled
              • Vendor
                • AAVE
                  • V3
                    • Contracts
                      • Dependencies
                        • Oppenzeppelin
                          • Contracts
                            • IERC20
                      • Interfaces
                        • IAToken
                        • IAaveIncentivesController
                        • IAaveOracle
                        • ICreditDelegationToken
                        • IInitializableAToken
                        • IPool
                        • IPoolAddressesProvider
                        • IPriceOracleGetter
                        • IScaledBalanceToken
                      • Protocol
                        • Libraries
                          • Configurations
                            • ReserveConfiguration
                          • Helpers
                            • Errors
                          • Types
                            • DataTypes
                    • Periphery
                      • Contracts
                        • MISC
                          • Interfaces
                            • IEACAggregatorProxy
                        • Rewards
                          • Interfaces
                            • IRewardsController
                            • IRewardsDistributor
                            • ITransferStrategyBase
                          • Libraries
                            • RewardsDataTypes
                • Compound
                  • CarefulMath
                  • Exponential
                  • ExponentialNoError
                  • ICompound
    • Background
      • Building Blocks
        • MangroveOffer
        • Direct
        • Forwarder
  • Vaults
    • Understanding vaults
      • Oracles
    • Managing a vault (CLI)
      • Deploying an oracle
      • Creating a vault
      • Monitoring the vault
      • Setting the vault position
      • Setting the fee data
      • Rebalancing
      • Adding or removing liquidity
    • Custom interactions
      • Oracles
      • Vault Factory
      • Managing a vault
        • Setting the position
        • Rebalancing
        • Setting a manager
        • Setting fee
  • Keeper Bots
    • Keeper Bots
    • Guides
      • Using borrowed funds for cleaning
    • Backgroud
      • The role of cleaning bots in Mangrove
      • The role of gas price updater bots in Mangrove
  • Adresses
    • Deployment Addresses
  • Quick Links
    • Glossary
    • Website
    • Whitepaper
Powered by GitBook
On this page
  • MgvLib.SingleOrder
  • MgvLib.OrderResult
  1. Protocol
  2. Technical References
  3. Creating & Updating offers

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: • maker • gasreq • kilo_offer_gasbase • gasprice

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

PreviousGas requirementNextExecuting offers