Matador Docs
Asset Management

Mandates & Constraints

Defining the "rules of the road" for asset managers.

Mandates & Constraints

A "Mandate" is the set of rules an asset manager agrees to follow. In traditional finance, this is a legal document. In Matador, it is a smart contract policy.

Types of Constraints

1. Universe Constraints (Allowlists)

Restricting what can be traded.

    import "abis/UniswapRouter.json" as Uniswap;

    permission UniverseGuard -> 1.0.0 {
        parameters: {
            router: address,
            tokenA: address,
            tokenB: address
        }

        fn main() -> bool {
            if (context.target != parameters.router) {
                return false;
            }

            if (context.selector == Uniswap.exactInputSingle) {
                if (Uniswap.exactInputSingle.params.tokenIn == parameters.tokenA) {
                    return Uniswap.exactInputSingle.params.tokenOut == parameters.tokenB;
                }

                if (Uniswap.exactInputSingle.params.tokenIn == parameters.tokenB) {
                    return Uniswap.exactInputSingle.params.tokenOut == parameters.tokenA;
                }
            }

            return false;
        }
    }

2. Concentration Constraints (Risk Limits)

Restricting how much exposure is allowed.

    permission ConcentrationLimit -> 1.0.0 {
        parameters: {
            asset: address,
            account: address,
            maxBalance: uint256
        }

        pub fn balanceAllowed(balance: uint256) -> bool {
            return balance <= parameters.maxBalance;
        }

        fn main() -> bool {
            return context.target == parameters.asset;
        }
    }

3. Execution Constraints (Slippage/Price)

Restricting execution quality.

    import "abis/UniswapRouter.json" as Uniswap;

    permission SlippageGuard -> 1.0.0 {
        parameters: {
            router: address,
            minAmountOut: uint256
        }

        fn main() -> bool {
            if (context.target != parameters.router) {
                return false;
            }

            if (context.selector == Uniswap.exactInputSingle) {
                return Uniswap.exactInputSingle.params.amountOutMinimum == parameters.minAmountOut;
            }

            return false;
        }
    }

Combine constraints for mandates

Real mandates typically stack universe, concentration, and execution constraints in a single policy.

Policy Composition

You can combine these constraints into a comprehensive mandate.

graph TD
    A[Manager Tx] --> B{Universe Check}
    B -- Fail --> R[Revert]
    B -- Pass --> C{Concentration Check}
    C -- Fail --> R
    C -- Pass --> D{Slippage Check}
    D -- Fail --> R
    D -- Pass --> E[Execute Trade]

This layered approach ensures that even if a manager makes a "fat finger" mistake or acts maliciously, the fund's core invariants are preserved.

On this page