User-defined matching of objects is disclosed in which an electronic exchange obtains and executes user-defined rules code that overrides default exchange program code for matching objects at the electronic exchange. The electronic exchange may provide an Application Programming Interface (“API”) that exposes various immutable fields that are used to match objects. The API may also include default program code that may be overridden by the user-defined rules code, which may be implemented as a class extension or interface executed by the electronic exchange.