Skip to content

Commit 4524a18

Browse files
Chris KhanChris Khan
authored andcommitted
feat: disable Trading Bots UI (pages, forms, actions) and force Standard trading mode
1 parent ca53ecb commit 4524a18

7 files changed

Lines changed: 29 additions & 586 deletions

File tree

components/Partials/Trade/Futures/Form/Index.vue

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,12 @@ const options = computed(() => [
1111
{
1212
value: TradingInterface.Standard,
1313
disabled: false
14-
},
15-
{
16-
value: TradingInterface.TradingBots,
17-
disabled:
18-
jsonStore.derivativeGridMarkets.find(
19-
({ slug }) => slug === derivativeMarket.value.slug
20-
) === undefined
2114
}
2215
])
2316
2417
onMounted(() => {
25-
if (
26-
queryTradingMode.value === TradingInterface.TradingBots &&
27-
options.value.find(({ value }) => value === TradingInterface.TradingBots)
28-
?.disabled
29-
) {
30-
queryTradingMode.value = TradingInterface.Standard
31-
}
18+
// Force Standard mode; Trading Bots is disabled in this build
19+
queryTradingMode.value = TradingInterface.Standard
3220
})
3321
</script>
3422

@@ -46,9 +34,6 @@ onMounted(() => {
4634
{{ $t(`trade.${value}`) }}
4735
</AppButtonSelect>
4836
</div>
49-
<PartialsTradeFuturesFormStandard
50-
v-if="queryTradingMode === TradingInterface.Standard"
51-
/>
52-
<PartialsTradeFuturesFormTradingBots v-else />
37+
<PartialsTradeFuturesFormStandard />
5338
</div>
5439
</template>
Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,7 @@
11
<script setup lang="ts">
2-
import { MarketKey } from '@/types'
3-
import type { UiDerivativeMarket, DerivativeGridTradingForm } from '@/types'
4-
5-
const futuresMarket = inject(MarketKey) as Ref<UiDerivativeMarket>
6-
7-
const gridStrategyStore = useGridStrategyStore()
8-
9-
useForm<DerivativeGridTradingForm>({
10-
keepValuesOnUnmount: true
11-
})
12-
13-
const activeStrategy = computed(() =>
14-
gridStrategyStore.activeDerivativeStrategies.find(
15-
(strategy) => strategy.marketId === futuresMarket.value?.marketId
16-
)
17-
)
2+
// Trading Bots disabled in this build.
183
</script>
194

205
<template>
21-
<div class="p-4">
22-
<PartialsTradingBotsDerivativeStrategyDetails
23-
v-if="activeStrategy"
24-
:active-strategy="activeStrategy"
25-
/>
26-
27-
<div v-else>
28-
<div>
29-
<PartialsTradeFuturesFormTradingBotsManual />
30-
</div>
31-
</div>
32-
</div>
6+
<div />
337
</template>

components/Partials/Trade/Spot/Form/Index.vue

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,12 @@ const options = computed(() => [
1717
{
1818
value: TradingInterface.Standard,
1919
disabled: false
20-
},
21-
{
22-
value: TradingInterface.TradingBots,
23-
disabled:
24-
jsonStore.spotGridMarkets.find(
25-
({ slug }) => slug === spotMarket.value.slug
26-
) === undefined
2720
}
2821
])
2922
3023
onMounted(() => {
31-
if (
32-
queryTradingMode.value === TradingInterface.TradingBots &&
33-
options.value.find(({ value }) => value === TradingInterface.TradingBots)
34-
?.disabled
35-
) {
36-
queryTradingMode.value = TradingInterface.Standard
37-
}
24+
// Force Standard mode; Trading Bots is disabled in this build
25+
queryTradingMode.value = TradingInterface.Standard
3826
})
3927
</script>
4028

@@ -57,11 +45,7 @@ onMounted(() => {
5745
</div>
5846

5947
<div>
60-
<PartialsTradeSpotFormStandard
61-
v-if="queryTradingMode === TradingInterface.Standard"
62-
/>
63-
64-
<PartialsTradeSpotFormTradingBots v-else />
48+
<PartialsTradeSpotFormStandard />
6549
</div>
6650
</div>
6751
</template>
Lines changed: 2 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,7 @@
11
<script setup lang="ts">
2-
import {
3-
MarketKey,
4-
BusEvents,
5-
UiSpotMarket,
6-
GridStrategyType,
7-
InvestmentTypeGst,
8-
SpotGridTradingForm
9-
} from '@/types'
10-
11-
const spotMarket = inject(MarketKey) as Ref<UiSpotMarket>
12-
13-
const gridStrategyStore = useGridStrategyStore()
14-
const strategyType = ref(GridStrategyType.Auto)
15-
16-
useForm<SpotGridTradingForm>({
17-
initialValues: {
18-
investmentType: InvestmentTypeGst.BaseAndQuote
19-
},
20-
keepValuesOnUnmount: true
21-
})
22-
23-
const activeStrategy = computed(() =>
24-
gridStrategyStore.activeSpotStrategies.find((strategy) => {
25-
return strategy.marketId === spotMarket.value?.marketId
26-
})
27-
)
28-
29-
function updateType(type: GridStrategyType) {
30-
strategyType.value = type
31-
}
32-
33-
function onOpenTradingBotDetails() {
34-
if (!activeStrategy.value) {
35-
return
36-
}
37-
38-
useEventBus(BusEvents.OpenTradingBotDetails).emit(activeStrategy.value)
39-
}
2+
// Trading Bots disabled in this build.
403
</script>
414

425
<template>
43-
<div class="p-4">
44-
<PartialsTradingBotsSpotStrategyDetails
45-
v-if="activeStrategy"
46-
v-bind="{ activeStrategy, market: spotMarket }"
47-
/>
48-
49-
<div v-else>
50-
<div class="flex mt-4 bg-brand-875 rounded-md">
51-
<AppButtonSelect
52-
v-for="type in Object.values(GridStrategyType)"
53-
:key="type"
54-
v-bind="{ value: type }"
55-
v-model="strategyType"
56-
class="flex-1 rounded-md"
57-
active-classes="bg-blue-500"
58-
>
59-
<template #default="{ isActive }">
60-
<AppButton
61-
:variant="isActive ? 'primary' : 'primary-cta'"
62-
:class="['w-full py-1.5 leading-relaxed focus-within:ring-0']"
63-
>
64-
{{ $t(`tradingBots.${type}`) }}
65-
</AppButton>
66-
</template>
67-
</AppButtonSelect>
68-
</div>
69-
70-
<div>
71-
<PartialsTradeSpotFormTradingBotsAuto
72-
v-if="strategyType === GridStrategyType.Auto"
73-
:has-active-strategy="!!activeStrategy"
74-
@update:tab="updateType"
75-
@view:details="onOpenTradingBotDetails"
76-
/>
77-
78-
<PartialsTradeSpotFormTradingBotsManual
79-
v-else
80-
:has-active-strategy="!!activeStrategy"
81-
@view:details="onOpenTradingBotDetails"
82-
/>
83-
</div>
84-
</div>
85-
</div>
6+
<div />
867
</template>

components/Partials/TradingBots/Homepage/Hero.vue

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,12 @@ const gridStrategyStore = useGridStrategyStore()
5858
</div>
5959

6060
<div class="flex gap-4 mt-4">
61-
<NuxtLink :to="{ name: MainPage.TradingBotsLiquidityBotsSpot }">
62-
<AppButton size="lg">
63-
{{ $t('tradingBots.createYourStrategy') }}
64-
</AppButton>
65-
</NuxtLink>
66-
67-
<NuxtLink
68-
to="https://docs.helixapp.com/advanced/trading-bots"
69-
target="_blank"
70-
>
71-
<AppButton variant="primary-outline" class="border-white" size="lg">
72-
{{ $t('common.learnMore') }}
73-
</AppButton>
74-
</NuxtLink>
61+
<AppButton size="lg" disabled>
62+
{{ $t('tradingBots.createYourStrategy') }}
63+
</AppButton>
64+
<AppButton variant="primary-outline" class="border-white" size="lg" disabled>
65+
{{ $t('common.learnMore') }}
66+
</AppButton>
7567
</div>
7668
</div>
7769
</template>

pages/trading-bots/index.vue

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,14 @@
11
<script setup lang="ts">
2-
import { Status, StatusType } from '@injectivelabs/utils'
3-
4-
const gridStrategyStore = useGridStrategyStore()
5-
6-
const status = reactive(new Status(StatusType.Loading))
7-
8-
const { $onError } = useNuxtApp()
9-
10-
onMounted(() => {
11-
status.setLoading()
12-
13-
Promise.all([gridStrategyStore.fetchStrategyStats()])
14-
.catch($onError)
15-
.finally(() => {
16-
status.setIdle()
17-
})
18-
})
2+
// Trading Bots have been disabled in this build.
193
</script>
204

215
<template>
22-
<UContainer class="py-8">
23-
<PartialsTradingBotsHomepageHero />
24-
<PartialsTradingBotsHomepageMyActiveBots class="mt-10" />
25-
26-
<PartialsTradingBotsHomepageMyLpRewards class="mt-10" />
27-
28-
<PartialsTradingBotsHomepageShowcase class="mt-10" />
6+
<UContainer class="py-16">
7+
<div class="text-center py-24">
8+
<h1 class="text-4xl lg:text-6xl font-bold">Trading Bots Unavailable</h1>
9+
<p class="text-lg mt-4">This feature is not available in this build.</p>
10+
<NuxtLink class="btn btn-primary mt-8" to="/trade">Go to Trade</NuxtLink>
11+
</div>
2912
</UContainer>
13+
3014
</template>

0 commit comments

Comments
 (0)