You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(market-factory): support bStock markets and wire the liquidation suite
Add a stockCollateral flag to createMarket / batchCreateMarkets that registers
the collateral in StockOracleSwitch via setStock. The factory never touches the
switch's global market-hours flag, so a new bStock is registered but stays gated
by ops. An already-registered stock is skipped, since setStock reverts on a
no-op and creating a market must not reopen a deliberately closed stock.
Whitelist market tokens uniformly across all three liquidation contracts
(Liquidator, BrokerLiquidator, LiquidationVault) for common, fixed-term and
smart-collateral markets, and register smart providers on BrokerLiquidator too.
A smart-collateral LP is the one exception: it is excluded from the vault
whitelist and reflow-blacklisted on both liquidators instead, because the vault
cannot sell it. This matches the live BSC posture, which was previously only
half-reproduced by the factory.
liquidationVault and stockOracleSwitch are storage variables with admin setters,
following the rateCalculator / brokerLiquidator pattern, so the constructor
immutables and the existing deploy scripts are unchanged and ETH can leave both
unset.
Deploying this requires granting MarketFactory the MANAGER role on
LiquidationVault and StockOracleSwitch, then calling the two setters.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@@ -118,20 +128,23 @@ contract MarketFactory is UUPSUpgradeable, AccessControlEnumerableUpgradeable, P
118
128
* @param supplyWhitelist An array of address arrays for the supply whitelist of each market
119
129
* @param liquidatorMarketWhitelist An array of booleans indicating whether to whitelist the market in the liquidator for each market
120
130
* @param liquidatorSmartProviders An array of booleans indicating whether the market is a smart collateral market that requires special provider configuration for each market
131
+
* @param stockCollaterals An array of booleans indicating whether the collateral token is a tokenized stock (bStock) that must be registered in the StockOracleSwitch for each market
@@ -141,7 +154,8 @@ contract MarketFactory is UUPSUpgradeable, AccessControlEnumerableUpgradeable, P
141
154
liquidatorWhitelist[i],
142
155
supplyWhitelist[i],
143
156
liquidatorMarketWhitelist[i],
144
-
liquidatorSmartProviders[i]
157
+
liquidatorSmartProviders[i],
158
+
stockCollaterals[i]
145
159
);
146
160
}
147
161
}
@@ -153,15 +167,24 @@ contract MarketFactory is UUPSUpgradeable, AccessControlEnumerableUpgradeable, P
153
167
* @param supplyWhitelist An array of addresses for the supply whitelist of the market
154
168
* @param liquidatorMarketWhitelist A boolean indicating whether to whitelist the market in the liquidator
155
169
* @param liquidatorSmartProvider A boolean indicating whether the market is a smart collateral market that requires special provider configuration
170
+
* @param stockCollateral A boolean indicating whether the collateral token is a tokenized stock (bStock) that must be registered in the StockOracleSwitch
0 commit comments