📈 TradeJack v1.0: AI Supply Chain Hedge Fund

React Vite JavaScript AWS Docker

TradeJack levels the playing field for local vendors by autonomously predicting market shocks, detecting monopoly price-fixing, and executing split-second procurement across legacy B2B portals before prices spike.


🏛️ System Architecture

graph TD
    A[👨‍💼 SME Vendor <br> React / Vite UI] -->|1. News Ingestion| B(Serverless Logic <br> Puter.js)
    B <-->|2. KV Caching| C[(Puter.kv Store)]
    B -->|3. AI Orchestration| D{Amazon Bedrock}

    D -->|Reasoning & TAME| E[🧠 Nova 2 Lite]
    D -->|Voice Alert| F[📞 Nova 2 Sonic]
    D -->|Swarm Execution| G[🤖 Nova Act]

    E -->|JSON Output| B
    F -.->|Simulated Call| A
    G --> H[Legacy B2B Portals]
    G --> I[Wholesale Suppliers]

    classDef ui fill:#0f172a,stroke:#22d3ee,stroke-width:2px,color:#fff;
    classDef logic fill:#1e293b,stroke:#10b981,stroke-width:2px,color:#fff;
    classDef aws fill:#FF9900,stroke:#232F3E,stroke-width:2px,color:#fff;
    classDef models fill:#334155,stroke:#a855f7,stroke-width:2px,color:#fff;

    class A ui;
    class B,C logic;
    class D aws;
    class E,F,G models;

💡 Inspiration

The global B2B procurement process is fundamentally broken for Small and Medium Enterprises (SMEs). While mega-corporations enjoy custom APIs and automated supply chains, local vendors are forced to manually navigate clunky, legacy wholesaler portals that lack modern integrations.

Worse, SMEs suffer from the "Illusion of Choice." They manually compare prices across three different suppliers, unaware that all three are subsidiaries of the same parent company artificially inflating the True Landed Cost. Studies show SMEs lose up to 20-30% of potential margins due to these inefficiencies (McKinsey Supply Chain Report). We wanted to build an Agentic AI that doesn't just scrape prices, but acts as a cognitive financial advocate for the unorganized sector.


🚀 What it does

TradeJack is an AI-powered Supply Chain Hedge Fund. It actively predicts market shocks and autonomously executes procurement across legacy websites to secure the lowest True Landed Cost.

Our pipeline operates in four distinct phases:

  1. 🌩️ Predict (The Macro-Event Trigger): Using unstructured news APIs, Amazon Nova 2 Lite detects global events (e.g., "Floods in Brazil"). It reasons that coffee supply will drop, predicting a price spike.
  2. 📞 Authorize (Nova 2 Sonic Dispatch): Instead of a passive email, TradeJack initiates a real-time voice call alert to the warehouse manager using Nova 2 Sonic, explaining the risk and asking for a verbal "Execute Order" command.
  3. 🕵️ Verify (Anti-Monopoly Engine - TAME): Before buying, the agent fetches the raw commodity index and runs an economic check to ensure the vendor isn't getting price-gouged by an oligopoly.
  4. 🤖 Execute (UI Swarm via Nova Act): TradeJack deploys a parallel swarm of browser agents. It navigates the non-API legacy portals, clicks through the UI, and completes the checkout for the best cart.

📐 The Economics (TAME Engine)

To prove market health, TradeJack calculates the exact markup over marginal cost using this economic formula:

$$Markup = \frac{\text{Landed Cost} - \text{Commodity Index Cost}}{\text{Commodity Index Cost}} \times 100$$

If the markup exceeds the standard competitive threshold (e.g., 15%) and parent-company entity resolution matches, the UI flags a Monopoly Warning.


🏗️ How we built it

We completely bypassed the traditional, heavy backend architecture to build a Serverless Agentic App:

  • Frontend & Orchestrator: A responsive React/Vite Progressive Web App (PWA) acting as both the vendor's command center and the state machine driving the 4-stage cognitive loop.
  • Serverless AI Layer: We utilized Puter.js to integrate Amazon Bedrock models directly from the client side. This allowed us to call Nova 2 Lite for rapid reasoning without managing complex AWS IAM roles or backend SDKs.
  • UI Swarm Animation: We built a custom dark-mode CSS engine with scanline animations to visually demonstrate the Nova Act browser automation race.
  • Caching & Persistence: We leveraged the Puter Key-Value store (puter.kv) to cache the AI's market predictions for 24 hours, effectively eliminating redundant API calls and ensuring token optimization.

🚧 Challenges we ran into

  • Prompt Injection Security: Because we moved the AI logic to the serverless frontend, we had to build rigorous "Delimiter Shielding" in our system prompts to prevent malicious users from overriding Nova 2 Lite's core economic instructions.
  • Managing Agentic State: Orchestrating a seamless UI transition from ANALYZING to AUTHORIZING to SWARMING within React required careful management of asynchronous promises and simulated staggered timeouts to mimic the real-world latency of headless browsers.
  • JSON Hallucinations: Forcing an LLM to output pure, parsable JSON for the TAME Engine without conversational filler required strict negative constraints in the prompt engineering phase.

🏆 Accomplishments that we're proud of

  • The Serverless Pivot: Achieving complex Agentic AI workflows entirely in the browser using React and Puter.js, proving that SMEs don't need massive DevOps budgets to leverage enterprise-grade AI.
  • Moving Beyond Chatbots: We built an AI that actually does something. Visualizing an autonomous "Swarm" executing trades based on macroeconomic weather predictions is a massive leap from standard text generation.
  • The TAME Engine: Applying real economic theory (calculating perfect competition vs. monopolies) natively within an LLM's reasoning loop.

🧠 What we learned

We learned the immense power of Defensive Prompt Engineering. When building autonomous agents, ensuring the model's output is strictly structured and immune to "jailbreaks" is just as important as the intelligence itself. We also learned how tools like Puter.js can radically accelerate the ideation-to-deployment pipeline for Amazon Nova models.


🔮 What's next for TradeJack

Our immediate next step is to close the physical-to-digital loop by introducing the Multimodal "Bait-and-Switch" Auditor.

Currently, TradeJack secures the best price online. In Phase 2, when the physical goods arrive at the vendor's warehouse, the user will snap a photo of the physical invoice and the goods. Using Amazon Nova Multimodal Embeddings, TradeJack will cross-reference the handwritten delivery slip against the digital receipt to instantly flag unauthorized "unloading fees" or substituted lower-grade materials before the vendor signs off!

Built With

  • amazon-bedrock
  • amazon-ecs
  • amazon-nova-2-sonic
  • amazon-nova-act
  • docker
  • javascript-es6
  • lang-chain
  • model-context-protocol
  • news-api
  • puter.js
  • react
  • typescript
Share this project:

Updates