Gates
Midnight supports optional access control at the market level.
Gates are set at market creation and cannot be changed afterward. Introducing gate conditions requires creating a new market, which fragments liquidity.
Gates are noncustodial. They can restrict who may increase credit, increase debt, or liquidate, but they cannot lock or take control of user assets.
Gates add flexibility, but they also change how users should evaluate a market.

Entry gates
A market can define an entry gate.
The entry gate can restrict who may:
- increase credit
- increase debt
In practice, this can support markets with allowlists or other custom access policies.
Gates cannot block exits. Users can always reduce debt, reduce credit, withdraw available loan tokens, or withdraw collateral as long as normal protocol conditions are met.
Liquidator gates
A market can define a liquidator gate.
The liquidator gate can restrict who may liquidate borrower positions. This can support markets where only approved liquidators are expected to handle collateral or realize bad debt.
A liquidator gate is part of the market's risk profile. If too few liquidators are available, unhealthy or overdue positions may take longer to resolve.