Pure Market Making Design
Source: Notion | Last edited: 2025-02-06 | ID: 7c8c8f07-757...
Introduction
Section titled “Introduction”There are a few market making (MM) strategies, including pure market making, cross-exchange market making, spot-perpetual market making, triangle market making, etc. The MM strategy we are referring here is pure market making strategy. It means we only buy/sell a single instrument in a single exchange.
A market making strategy is composed of a few things: a smart signal to open/close position, a reasonable spread to get orders filled, and a reliable risk management system. For the initial version of MM strategy, we will use Enigma prediction as our open/close signal, market volatility as the spread, and state diff between MM state and Enigma state for the risk management indicator.
Flowchart
Section titled “Flowchart”flowchart TBEnigmaprediction(["Enigma prediction"]);ShouldcreateEnigmaOrders\n --> |Yes, targetState = currentState + stateChange. <br> stateChange = enigmaTargetState - enigmaPrevTargetState + unusedStateChange <br>_| Createenigmaorders["Create enigma orders"];Enigmaorderisfilled --> |risky = is reducing position & gap between enigmaState and mmState is too large| Riskmanagement:IscreatingMMorderslowrisk?{{"Risk management: Is creating MM orders low risk?"}};style Riskmanagement:IscreatingMMorderslowrisk? fill:#FDECC8,stroke:#402c1b;Riskmanagement:IscreatingMMorderslowrisk? --> |No| NoMMorders["No MM orders"];style NoMMorders fill:#FFE2DD,stroke:#5D1715;Riskmanagement:IscreatingMMorderslowrisk? --> |Yes| CreatefirstMMorder("Create first MM order");style CreatefirstMMorder fill:#DBEDDB,stroke:#1C3829;Createenigmaorders --> |websocket| Enigmaorderisfilled("Enigma order is filled");style Enigmaorderisfilled fill:#DBEDDB,stroke:#1C3829;IsMMorderfilledinxminutes? --> |Yes by websocket| MMorderisfilled("MM order is filled");style MMorderisfilled fill:#DBEDDB,stroke:#1C3829;MMorderisfilled --> |risky = isOpeningPosition && Abs.targetState - Abs.enigmaTargetState > Risk Tolerance| Riskmanagement:iscreatingsubsequentMMorderlowrisk?{{"Risk management: is creating subsequent MM order low risk?"}};style Riskmanagement:iscreatingsubsequentMMorderlowrisk? fill:#FDECC8,stroke:#402c1b;Riskmanagement:iscreatingsubsequentMMorderlowrisk? --> |Yes| createsubsequentMMorder("create subsequent MM order");style createsubsequentMMorder fill:#DBEDDB,stroke:#1C3829;Riskmanagement:iscreatingsubsequentMMorderlowrisk? --> |No| NosubsequentMMorder["No subsequent MM order"];style NosubsequentMMorder fill:#FFE2DD,stroke:#5D1715;IsMMorderfilledinxminutes? --> |No| CancelMMorder["Cancel MM order"];style CancelMMorder fill:#FFE2DD,stroke:#5D1715;CreatefirstMMorder --> IsMMorderfilledinxminutes?{{"Is MM order filled in x minutes?"}};createsubsequentMMorder --> IsMMorderfilledinxminutes?;style IsMMorderfilledinxminutes? fill:#FDECC8,stroke:#402c1b;ShouldcreateEnigmaOrders\n --> |No| Noenigmaorders["No enigma orders"];style Noenigmaorders fill:#FFE2DD,stroke:#5D1715;Enigmaprediction --> |No = isOpeningPosition && Abs.targetState - Abs.enigmaTargetState > Risk Tolerance| ShouldcreateEnigmaOrders\n{{"Should create Enigma Ordersn"}};style ShouldcreateEnigmaOrders\n fill:#FDECC8,stroke:#402c1b;Flowchart Views
Section titled “Flowchart Views”- Database: Flowcharts
Flowchart Nodes
Section titled “Flowchart Nodes”- Database: Flowchart Nodes