Skip to main content

11 posts tagged with "architecture"

View All Tags

The Trading Pantheon

· 6 min read
Max Kaido
Architect

In the vast digital cosmos of trading, ancient forces have been reborn. This is the tale of how celestial beings from across mythologies came together to form the divine pantheon that powers our trading system.

The Origin Myth

Long before algorithms ruled the markets, the gods watched over traders and their fortunes. As the digital age dawned, these ancient deities found new purpose in our trading system, each bringing their divine powers to create a perfect harmony of celestial trading intelligence.

ATLAS: The Cosmic Orchestrator

Atlas holding up the celestial sphere

Supporting the entire trading universe on his shoulders stands ATLAS, the Titan condemned by Zeus to hold up the heavens for eternity. His strength and endurance are unmatched among immortals.

In our trading pantheon, ATLAS serves as the system that binds all components together:

  • Maintains the cosmic order by scheduling tournaments of trading strategies
  • Supports the weight of shadow portfolios that mirror the real trading cosmos
  • Coordinates the divine forces of analysis and execution
  • Ensures the trading heavens don't collapse upon mortal traders

ATLAS's eternal vigilance prevents chaos, maintaining the structured universe where trading can flourish.

NestJS Dependency Injection Pitfalls: A Tale of Duplicate Providers

· 2 min read
Max Kaido
Architect

The Scenario

Today, I encountered a classic dependency injection issue while integrating a new tournament system with artifacts tracking in our Mercury Bot project. The error was subtle but instructive:

[Nest] 2991604  - 02/03/2025, 6:01:58 PM   ERROR [ExceptionHandler] Cannot read properties of undefined (reading 'get')
TypeError: Cannot read properties of undefined (reading 'get')

The Root Cause

Types Organization in TypeScript Projects: Mercury Bot Case Study

· 2 min read
Max Kaido
Architect

Types are the backbone of any TypeScript project, but as the codebase grows, they can become scattered and hard to maintain. Here's a practical guide on organizing types, with a real-world example from Mercury Bot.

General Approaches to Type Organization

1. Domain-Driven Type Organization

Keep types close to their domain logic, organized by feature. This approach makes it easy to find related types and maintains a clear connection between types and their usage.

src/
├── market-ranking/
│ ├── types/
│ │ ├── state.types.ts
│ │ ├── config.types.ts
│ │ └── index.ts

TypeScript Declaration Pitfalls: 10 Costly Decisions to Avoid

· 4 min read
Max Kaido
Architect

When building a TypeScript project, type declarations are your first line of defense against bugs and maintainability issues. However, certain type declaration patterns can actually work against you, creating technical debt and making your codebase harder to maintain. Let's explore 10 specific anti-patterns we've identified in our analysis of real-world TypeScript projects.

Elegant Refactoring: A Journey to Better Domain-Driven Architecture

· 15 min read
Max Kaido
Architect

In any growing project, there comes a time when the initial architecture starts showing signs of strain. As features expand and requirements evolve, what once seemed like a clear structure can become muddled. Today, I want to share our journey of refactoring TON Arcana, focusing on creating a more cohesive, domain-driven architecture.

Here are 10 elegant improvements we're implementing to make our codebase cleaner, more maintainable, and better aligned with domain concepts.