Posts

Arbitrage Trading Decision Model

Image
                                                     Directly taken from my Kaggle notebook The formula can be adapted into an arbitrage-trading decision model like below, but by itself it is not an arbitrage formula. R ( t ) = R max ⁡ m ( t ) = R max ⁡ 7 ∑ i = 1 7 s i ( t ) R(t)=R_{\max}m(t) =\frac{R_{\max}}{7}\sum_{i=1}^{7}s_i(t) where the 7 signals s i ( t ) s_i(t) are normalized signals and R ( t ) R(t) is a dynamically calculated risk/reward/allocation value. For arbitrage, I would use the same concept like this: A ( t ) = 1 7 ∑ i = 1 7 s i ( t ) A(t)=\frac{1}{7}\sum_{i=1}^{7}s_i(t) where the signals could be: Price spread Bid/ask spread Trading fees Slippage Market liquidity Transfer/settlement latency Historical spread reliability Then calculate the actual arbitrage profit: P arb = Q ( P sell − P buy ) − F buy − F sell − S buy − S sell − C trans...

Step-by-step Master Guide for Building Features with AI Coding Agents

Here is your step-by-step master guide for building features with AI coding agents before you start a coding project or feature using AI assistance (like GitHub Copilot, Claude Code, or AWS Q Developer). Phase 1: Structuring the Repository for Maximum AI Context Before writing a single line of code, the AI agent needs a clean environment to "understand" your system architecture. 1. Establish an AI Rules File ( .cursorrules or CLAUDE.md ) Place a context rule file in the root of the repository. Define architectural constraints, coding standards, language versions, and testing requirements. Example: Specify "Python 3.12, strict type hints, Pydantic v2 for schema validation, Pytest for unit tests, no raw SQL (use SQLAlchemy ORM)." 2. Implement a Modular, Clean-Architecture Folder Structure Keep directory structures predictable so the AI agent doesn't hallucinate paths or mix concerns: /src/domain/ (Data models, schemas, entities) /src/services/ (Business logic,...