Make luna reduce only
This commit is contained in:
parent
11aaf85d3d
commit
2b798ac216
|
@ -118,6 +118,7 @@ export default function AdvancedTradeForm({
|
|||
const [postOnlySlide, setPostOnlySlide] = useState(false)
|
||||
const [postOnly, setPostOnly] = useState(false)
|
||||
const [ioc, setIoc] = useState(false)
|
||||
const [isLuna, setIsLuna] = useState(false)
|
||||
|
||||
const orderBookRef = useRef(useMangoStore.getState().selectedMarket.orderBook)
|
||||
const orderbook = orderBookRef.current
|
||||
|
@ -223,6 +224,11 @@ export default function AdvancedTradeForm({
|
|||
: availableBalance
|
||||
}
|
||||
|
||||
if (marketConfig.baseSymbol == 'LUNA') {
|
||||
setIsLuna(true)
|
||||
setReduceOnly(true)
|
||||
}
|
||||
|
||||
const {
|
||||
max: maxQuote,
|
||||
deposits,
|
||||
|
@ -781,6 +787,16 @@ export default function AdvancedTradeForm({
|
|||
<span className="ml-2 rounded border border-th-primary px-1 py-0.5 text-xs text-th-primary">
|
||||
{initLeverage}x
|
||||
</span>
|
||||
{ isLuna ? (<Tooltip
|
||||
content={
|
||||
<div className="text-center">
|
||||
LUNA is currently in reduce only mode. No new positions may be entered.
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<ExclamationIcon className="ml-2 h-5 w-5 text-th-primary" />
|
||||
</Tooltip>) : null }
|
||||
|
||||
</ElementTitle>
|
||||
{insufficientSol ? (
|
||||
<div className="mb-3 text-left">
|
||||
|
@ -963,7 +979,7 @@ export default function AdvancedTradeForm({
|
|||
auto updating the reduceOnly state when doing a market order:
|
||||
&& showReduceOnly(perpAccount?.basePosition.toNumber())
|
||||
*/}
|
||||
{marketConfig.kind === 'perp' ? (
|
||||
{marketConfig.kind === 'perp' || isLuna ? (
|
||||
<div className="mr-4 mt-3">
|
||||
<Tooltip
|
||||
className="hidden md:block"
|
||||
|
@ -974,7 +990,7 @@ export default function AdvancedTradeForm({
|
|||
<Checkbox
|
||||
checked={reduceOnly}
|
||||
onChange={(e) => reduceOnChange(e.target.checked)}
|
||||
disabled={isTriggerOrder}
|
||||
disabled={isTriggerOrder || isLuna}
|
||||
>
|
||||
Reduce Only
|
||||
</Checkbox>
|
||||
|
|
Loading…
Reference in New Issue