BotStudio9
Discord Bot
Featured

Arb Alert Discord Bot

Fee-aware arbitrage Discord bot — checks Binance vs Coinbase vs Kraken live for BTC, ETH, SOL. Slash commands, auto alerts, tiers.

Latency
< 40 ms command
Throughput
unlimited servers
Price
$500

About this bot

Pro all-in-one Discord bot with ticket system, anti-spam, leveling, warn and ban, economy shop with dashboard, plus sub-5ms cross-venue arbitrage engine. Ticket system with open, close, transcript and logs. Anti-spam auto-mod that blocks spam, caps, bad words, invites and mass mentions. Leveling with XP, level up messages, leaderboard and rank card. Warn and ban system with warn, mute, timeout, kick, ban, unban and full mod logs. Economy shop with balance, daily, work, shop, buy, sell, inventory and a web dashboard to manage economy and tickets. Plus Cross-Venue Arb Engine - fee-aware sizing model that checks Binance vs Coinbase vs Kraken live for BTC, ETH, SOL with <40ms command latency, unlimited servers throughput. Commands: /arb, /setalerts, /tiers, /serverinfo, /ping. Discord.js v14 slash commands, TypeScript, ToS safe, ready to deploy.

Code preview

first 100 lines of src/features/economy/index.ts · TypeScript · 77 files · 7,765 lines in the archive
src/features/economy/index.tsTypeScript
1// Arb Alert Discord Bot — economy
2//
3// Every balance change goes through this module, and every one of them runs
4// inside a Prisma transaction that re-reads the row first. That is what stops
5// the classic Discord economy exploit: fire /pay twice in the same tick and
6// spend the same coins on both.
7
8import { prisma } from "../../lib/db.js";
9
10export type Wallet = {
11 wallet: number;
12 bank: number;
13 bankCap: number;
14 totalEarned: number;
15 totalSpent: number;
16 dailyStreak: number;
17};
18
19export const JOBS = [
20 { name: "wrote a cron job that actually worked", min: 120, max: 320 },
21 { name: "reviewed a 900-line pull request", min: 180, max: 420 },
22 { name: "answered the ticket nobody wanted", min: 90, max: 260 },
23 { name: "fixed the flaky test for real this time", min: 200, max: 500 },
24 { name: "migrated the database with no downtime", min: 260, max: 620 },
25] as const;
26
27export const DAILY_COOLDOWN_MS = 22 * 60 * 60 * 1000;
28export const WORK_COOLDOWN_MS = 60 * 60 * 1000;
29export const ROB_COOLDOWN_MS = 2 * 60 * 60 * 1000;
30export const JAIL_MS = 30 * 60 * 1000;
31
32export function randomBetween(min: number, max: number): number {
33 return min + Math.floor(Math.random() * (max - min + 1));
34}
35
36export async function ensureWallet(guildId: string, userId: string) {
37 const existing = await prisma.economy.findUnique({
38 where: { guildId_userId: { guildId, userId } },
39 });
40 if (existing) return existing;
41
42 const guild = await prisma.guild.upsert({
43 where: { id: guildId },
44 update: {},
45 create: { id: guildId },
46 });
47
48 return prisma.economy.create({
49 data: { guildId, userId, wallet: guild.startingWallet },
50 });
51}
52
53export type SpendResult =
54 | { ok: true; wallet: number }
55 | { ok: false; reason: "insufficient"; wallet: number };
56
57/**
58 * Takes money out of a wallet, or reports that it could not.
59 *
60 * The read and the write are in one transaction, so two concurrent purchases
61 * cannot both see the same starting balance.
62 */
63export async function debit(
64 guildId: string,
65 userId: string,
66 amount: number
67): Promise<SpendResult> {
68 await ensureWallet(guildId, userId);
69
70 return prisma.$transaction(async (tx) => {
71 const row = await tx.economy.findUniqueOrThrow({
72 where: { guildId_userId: { guildId, userId } },
73 });
74
75 if (row.wallet < amount) {
76 return { ok: false as const, reason: "insufficient" as const, wallet: row.wallet };
77 }
78
79 const updated = await tx.economy.update({
80 where: { guildId_userId: { guildId, userId } },
81 data: { wallet: { decrement: amount }, totalSpent: { increment: amount } },
82 });
83
84 return { ok: true as const, wallet: updated.wallet };
85 });
86}
87
88export async function credit(
89 guildId: string,
90 userId: string,
91 amount: number
92): Promise<number> {
93 await ensureWallet(guildId, userId);
94
95 const updated = await prisma.economy.update({
96 where: { guildId_userId: { guildId, userId } },
97 data: { wallet: { increment: amount }, totalEarned: { increment: amount } },
98 });
99 return updated.wallet;
100}

This is the real file from the archive you receive, with your listing's metadata already substituted.

What is in the archive

Discord bot (TypeScript · discord.js v14 · Prisma · Canvas) — Pro — $500 · 10 feature(s): Talk-back replies, Roast, Support tickets, Welcome messages, Premium automod, Moderation suite, Economy, Shop and inventory, Leveling with rank cards, Giveaways · 0 tier-blocked

  • .env.example
  • .gitignore
  • Dockerfile
  • README.md
  • TIER.md
  • config/badwords.json
  • config/branding.json
  • config/levels.json
  • docker-compose.yml
  • package.json
  • prisma/schema.prisma
  • src/commands/automod/automod.ts
  • src/commands/core/arb.ts
  • src/commands/core/avatar.ts
  • src/commands/core/help.ts
  • src/commands/core/invite.ts
  • src/commands/core/ping.ts
  • src/commands/core/say.ts
  • src/commands/core/serverinfo.ts
  • src/commands/core/setalerts.ts
  • src/commands/core/uptime.ts
  • src/commands/core/userinfo.ts
  • src/commands/economy/balance.ts
  • src/commands/economy/bank.ts
  • src/commands/economy/daily.ts
  • src/commands/economy/economy.ts
  • src/commands/economy/gamble.ts
  • src/commands/economy/leaderboard.ts
  • src/commands/economy/pay.ts
  • src/commands/economy/rob.ts
  • src/commands/economy/withdraw.ts
  • src/commands/economy/work.ts
  • src/commands/fun/roast.ts
  • src/commands/fun/roastopt.ts
  • src/commands/fun/roastoptin.ts
  • src/commands/giveaway/giveaway.ts
  • src/commands/leveling/levelrewards.ts
  • src/commands/leveling/levels.ts
  • src/commands/leveling/rank.ts
  • src/commands/moderation/ban.ts
  • src/commands/moderation/clear.ts
  • src/commands/moderation/clearwarnings.ts
  • src/commands/moderation/kick.ts
  • src/commands/moderation/modlog.ts
  • src/commands/moderation/slowmode.ts
  • src/commands/moderation/timeout.ts
  • src/commands/moderation/warn.ts
  • src/commands/moderation/warnings.ts
  • src/commands/shop/inventory.ts
  • src/commands/shop/shop.ts
  • src/commands/tickets/ticket.ts
  • src/commands/welcome/welcome.ts
  • src/config.ts
  • src/deploy-commands.ts
  • src/events/guildMemberAdd.ts
  • src/events/interactionCreate.ts
  • src/events/messageCreate.ts
  • src/events/ready.ts
  • src/features/automod/index.ts
  • src/features/economy/index.ts
  • src/features/giveaway/index.ts
  • src/features/leveling/index.ts
  • src/features/shop/index.ts
  • src/features/talkback/index.ts
  • src/features/tickets/index.ts
  • src/features/welcome/index.ts
  • src/index.ts
  • src/lib/branding.ts
  • src/lib/canvas.ts
  • src/lib/cooldown.ts
  • src/lib/db.ts
  • src/lib/embeds.ts
  • src/lib/loaders.ts
  • src/lib/logger.ts
  • src/lib/modlog.ts
  • src/types.ts
  • tsconfig.json
  • LICENSE.txt
  • bs9-manifest.json