Abracadabra Developer Docs
  • Getting Started
    • Introduction
    • Security & Vulnerability
    • Architecture Overview
  • Core Contracts
    • DegenBox
    • BentoBox
    • Cauldrons
      • Cauldron V1
      • Cauldron V2
      • Cauldron V3
        • Cauldron V3_2
        • Whitelisted CauldronV3
      • Cauldron V4
        • PrivilegedCauldronV4
        • GmxV2 CauldronV4
      • Liquidations
    • Proxy Oracles
    • Strategies
    • MIMSwap
  • Periphery Contracts
    • Swappers
    • Wrappers
      • GLP Self Repaying
      • magicGLP
      • magicAPE
    • Withdrawers
    • CauldronOwner
    • GMX V2 OrderAgent & RouterOrder
      • GmxV2CauldronOrderAgent
      • GmxV2CauldronRouterOrder
  • Token Related
    • MIM
    • Omnichain MIM
      • LzProxyOFTV2
      • LzIndirectOFTV2
      • ElevatedMinterBurner
    • SPELL
    • sSPELL
      • 1InchSpellSwapper
    • mSPELL
      • mSpellSender
      • mSpellStaking
      • mSpellReporter
  • Deployment Addresses
    • Ethereum Mainnet
    • Arbitrum One
    • Optimism
    • Kava
    • Avalanche C-Chain
    • Polygon POS
    • Fantom Opera
    • BNB Chain
    • Moonriver
    • Base
    • Linea
    • Blast Mainnet
Powered by GitBook
On this page
  • createOrder | only callable by cauldrons
  • setOracle | only owner
  • setCallbackGasLimit | only owner
  1. Periphery Contracts
  2. GMX V2 OrderAgent & RouterOrder

GmxV2CauldronOrderAgent

Agent handling the creation and management of RouterOrder clones.

createOrder | only callable by cauldrons

This function creates a new order for a specific user with the given parameters. It is called by the GmxV2CauldronV4 contract to set up a new order in response to user actions.

It creates a clone of the RouterOrder contract and initializes it accordingly.

function createOrder(address user, GmRouterOrderParams memory params) external payable onlyOperators returns (address order)

Parameters

Name
Type
Note

user

address

Address of the user for whom the order is being created.

params

GmRouterOrderParams

Parameters defining the details of the order.


setOracle | only owner

Sets the oracle for a specific GMX V2 market, essential for ensuring accurate market data for the orders.

This oracle is then used by all RouterOrder clones

function setOracle(address market, IOracle oracle) external onlyOwner

Parameters

Name
Type
Note

market

address

The market for which the oracle is being set.

oracle

IOracle

The oracle contract to use for the specified market.


setCallbackGasLimit | only owner

Adjusts the gas limit for callback functions used in the GMX architecture. This function sets the maximum amount of gas allowed for operations following a callback. This is particularly relevant for the non-atomic nature of GMX transactions, where a user creates an order that is later filled by a keeper. The callback mechanism allows for composability by enabling the orderRouter proxy contract to continue the flow after receiving tokens from the deposit or withdrawal handler.

This callback gas limit is used by all RouterOrder clones.

function setCallbackGasLimit(uint256 _callbackGasLimit) external onlyOwner

Parameters

Name
Type
Note

_callbackGasLimit

uint256

The new gas limit for callbacks.


PreviousGMX V2 OrderAgent & RouterOrderNextGmxV2CauldronRouterOrder

Last updated 8 months ago