Merge pull request #339 from blockworks-foundation/lou/stub-oracle-enable

enable spot trading on stub oracle markets
This commit is contained in:
Lou-Kamades 2023-12-04 12:11:31 -06:00 committed by GitHub
commit 4cc2ab5df8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -1,4 +1,5 @@
import {
OracleProvider,
PerpMarket,
PerpOrderSide,
PerpOrderType,
@ -377,10 +378,11 @@ const AdvancedTradeForm = () => {
return selectedMarket.oracleLastUpdatedSlot !== 0
} else if (selectedMarket instanceof Serum3Market) {
return (
baseBank?.oracleLastUpdatedSlot !== 0 &&
(quoteBank?.name == 'USDC'
? true
: quoteBank?.oracleLastUpdatedSlot !== 0)
baseBank?.oracleProvider == OracleProvider.Stub ||
(baseBank?.oracleLastUpdatedSlot !== 0 &&
(quoteBank?.name == 'USDC'
? true
: quoteBank?.oracleLastUpdatedSlot !== 0))
)
}
}, [baseBank, quoteBank, selectedMarket])