Protocol
Gladius

Gladius

Gladius is Rubicon's offchain execution and order engine. It supports gasless signed orders, API-driven liquidity, market-maker workflows, quoting, and intent-style execution that settles through Rubicon contracts.

Contracts source code (opens in a new tab)

Who uses it

  • Market makers that need API-driven quoting and execution.
  • Integrators that need custom order flow or routing behavior.
  • Indexers and infrastructure teams tracking Rubicon's execution layer.

Integration references

Contracts

Current Gladius contract addresses are maintained in the Deployments reference.

How Gladius Works

Gladius uses an offchain intents pool for gasless order creation and non-custodial onchain settlement. Swappers sign orders offchain; fillers execute those orders onchain when they can satisfy the signed terms.

At a high level, Gladius is built around:

  • GladiusOrder: an order format derived from ExclusiveDutchOrder with an added fillThreshold parameter for partial fills.
  • PartialFillLib: library logic for partitioning an order into a partially filled quantity while preserving the initial exchange rate.
  • BaseGladiusReactor: settlement logic for signed orders and arbitrary filler execution methods.
  • GladiusReactor: the main reactor that resolves Gladius orders, applies decay, supports partial execution, and transfers input tokens.
  • RubiconFeeController: fee logic for Gladius executions.

GladiusOrder

GladiusOrder extends the basic Dutch order model with fillThreshold, allowing a swapper to define the minimum input quantity that can be partially filled.

struct GladiusOrder {
    OrderInfo info;
    uint256 decayStartTime;
    uint256 decayEndTime;
    address exclusiveFiller;
    uint256 exclusivityOverrideBps;
    DutchInput input;
    DutchOutput[] outputs;
    uint256 fillThreshold;
}

Partial Fills

During resolution, PartialFillLib can partition an order by replacing the input amount with the executed quantity and calculating proportional output amounts from the initial exchange rate.

function partition(
    uint256 quantity,
    InputToken memory input,
    OutputToken[] memory output,
    uint256 fillThreshold
) internal pure returns (InputToken memory, OutputToken[] memory)

Partial fills let fillers execute part of an order when the signed order permits it and the fill satisfies the order's threshold.

Reactor Entry Points

BaseGladiusReactor supports full and partial execution flows.

function execute(SignedOrder calldata order) external;
function executeWithCallback(SignedOrder calldata order, bytes calldata callbackData) external;
function executeBatch(SignedOrder[] calldata orders) external;
function executeBatchWithCallback(SignedOrder[] calldata orders, bytes calldata callbackData) external;
function execute(SignedOrder calldata order, uint256 quantity) external;
function executeWithCallback(SignedOrder calldata order, uint256 quantity, bytes calldata callbackData) external;
function executeBatch(SignedOrder[] calldata orders, uint256[] calldata quantities) external;
function executeBatchWithCallback(SignedOrder[] calldata orders, uint256[] calldata quantities, bytes calldata callbackData) external;

Fees

RubiconFeeController applies protocol fees to orders executed through GladiusReactor. It supports a base fee and optional pair-specific fees.

function baseFee() public view returns (uint256)

Returns the base fee applied to trades unless a pair-specific fee is active. Return values use precision of 1 / 100000, or 0.001%.

function fees(bytes32 pairHash) public view returns (uint256)

Returns the pair-specific fee for a pair hash when one has been set.