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.


Last updated