Skip to content

[Feature] feat: OKX live/paper trading execution via OKX Agent Trade Kit (close the backtest → execution loop) #100

@fanqi1909

Description

@fanqi1909

Problem or Motivation

Summary

Vibe-Trading currently uses OKX as a free market data source for backtesting (via the okx loader in backtest/loaders/). This proposal adds the missing execution layer: live and paper trading on OKX via the OKX Agent Trade Kit — an OAuth 2.1-secured MCP server that exposes spot, swap, futures, and algo order tools to any MCP-compatible agent.

Motivation

The current Vibe-Trading loop is:

natural language → strategy → backtest → report

With this addition it becomes:

natural language → strategy → backtest → execute (live or paper)

Users who backtest on OKX crypto data today have no path to execution without leaving Vibe-Trading. This closes that gap natively, without requiring a separate trading terminal.

Proposed Solution

Proposed Implementation

This fits cleanly into two existing contribution categories from CONTRIBUTING.md:

1. New toolagent/src/tools/okx_trade_tool.py

Wraps the OKX Agent Trade Kit MCP server. Exposes:

  • place_order (spot / swap / futures)
  • get_positions
  • cancel_order
  • get_balance
  • Simulated trading flag (simulatedTrading=true) for paper mode

2. New skillagent/src/skills/crypto/okx-live-trading/SKILL.md

Triggers when the user says things like:

  • "execute this strategy on OKX"
  • "place a BTC long on my OKX account"
  • "run this in paper trading mode on OKX"

The skill guides the agent through: confirm signal → preflight check (balance, position size, risk) → require explicit user confirmation → execute.

What We Can Contribute

We are the team that built and maintains the OKX Agent Trade Kit. We are happy to contribute:

  • The tool implementation (okx_trade_tool.py)
  • The skill definition (SKILL.md)
  • Tests covering simulated trading paths (no real money needed in CI)
  • Documentation

We would open a PR after discussion here.

Scope & Safety Notes

  • No credentials in code — users configure OKX_API_KEY / OKX_SECRET_KEY / OKX_PASSPHRASE in .env, same pattern as existing providers
  • Paper trading firstsimulatedTrading=true is the default; live trading requires explicit opt-in
  • Confirmation gate — the skill enforces a preflight + explicit confirmation step before any order, consistent with Vibe-Trading's existing Shadow Account pattern
  • No core module changes — touches only tools/ and skills/, both open for contribution per CONTRIBUTING.md

References

Happy to discuss scope, API surface, or implementation details here before opening a PR.

Area

MCP Plugin

Alternatives Considered

No response

Contribution

  • I'm willing to submit a PR for this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions