Read time … min

AI-native runtime for Mercado Bitcoin trading strategies

Author in Cursor, Claude Code or any AI IDE. Deploy from GitHub into a managed cloud runtime with first-class MCP control, logs and BRL-native execution.

By the TradingHost engineering team

Section 01 · At a glance

At a glance

Venue
Mercado Bitcoin
Venue type
Crypto exchange (Brazil-headquartered, LATAM's largest digital asset platform)
Asset class
Crypto plus tokenized fixed-income and regulated real-world assets in Brazil
Supported products
Spot trading, tokenized assets (regulated financial assets on XRP Ledger including fixed income), staking on NEAR, ADA, SOL, ETH, CHZ. MBRL BRL-pegged stablecoin issued on TRON (Nov 2024). No public retail crypto derivatives or perpetuals.
Runtime model
Containerised strategy runtime
Deployment source
GitHub
Languages
Any language that runs in a container
Common integrations
Native Mercado Bitcoin API v4 (REST), Mercado Bitcoin WebSocket v0, legacy TAPI v3, CCXT (`mercado`), custom
AI workflow integration
MCP control surface for Cursor, Claude Code, GitHub Copilot and CLI agents
TradingHost role
Runtime, deployment, logs, health checks, region selection, MCP control
Mercado Bitcoin role
Exchange account, API access, market access, execution venue, BRL fiat rails via PIX, custody
Affiliation
TradingHost is independent and is not affiliated with Mercado Bitcoin or its parent 2TM Participações. Mercado Bitcoin operates under Brazilian Virtual Assets Law (Lei 14.478/2022) and the Banco Central do Brasil SPSAV framework (Resolutions 519, 520, 521 from November 2025).

Section 02 · What Mercado Bitcoin offers

What Mercado Bitcoin offers

Mercado Bitcoin is LATAM's largest digital asset platform, BRL-native, with PIX as the dominant fiat rail. Strategies reach the venue through REST and WebSocket on the current API v4 (authorize-then-token), or through the legacy TAPI v3 (HMAC-SHA512 signed paths). Beyond spot crypto, MB offers a regulated tokenized real-world asset programme on XRPL and the MBRL BRL-pegged stablecoin issued on TRON; there are no public retail crypto derivatives or perpetuals.

Markets and strategy patterns

  • BRL spot grid
  • PIX-funded DCA
  • BRL/USDT triangular arbitrage
  • Brazil and LATAM low-latency execution
  • MBRL and BRZ stablecoin pairs
  • Tokenized fixed-income rebalancing (Tesouro-linked, XRPL RWA)
  • Portfolio rebalancing
  • Market-making

API surface

Product surfaces
Spot, tokenized assets (consumer surface). Public sandbox not advertised in MB's developer docs; treat as production-only and stage via TradingHost dry-run.
Connection methods
REST at `https://api.mercadobitcoin.net/api/v4` (current). WebSocket at `wss://ws.mercadobitcoin.net/ws/v4` documented at `https://ws.mercadobitcoin.net/docs/v0/`.
Authentication
New API v4 uses an authorization-token flow (POST `/authorize` with API key + secret, then bearer-token-style header on private endpoints). Legacy TAPI v3 uses HMAC-SHA512 with `TAPI-ID` / `TAPI-MAC` headers signing `/tapi/v3/` request paths. New v4 supersedes TAPI for new integrations. PIX is the fiat rail, handled by MB Pay (the payment institution arm), not by the trading API.

For specifics, refer to Mercado Bitcoin

Specific endpoints, rate-limit weights, symbol lists and fee tiers live in Mercado Bitcoin's documentation. Treat these as the source of truth.

Section 03 · Build with AI

Build your Mercado Bitcoin strategy with AI

Pick an integration method, fork a TradingHost framework starter, and author your strategy in an AI IDE. Cursor, Claude Code, GitHub Copilot and CLI-based AI agents all work with the same GitHub-native deployment loop.

  • Native Mercado Bitcoin API

    Direct control over Mercado Bitcoin-specific behaviour, account data and order execution logic via the current REST API v4 (authorize-then-token) or the legacy TAPI v3 (HMAC-SHA512 signed paths).

  • CCXT

    Common interface across Mercado Bitcoin and other crypto exchanges, exposed as the `mercado` exchange id.

  • Freqtrade

    Framework-based deployments using Freqtrade's strategy structure. Mercado Bitcoin support is available through CCXT at the community tier; expect to validate market metadata and order types against MB before going live.

  • Custom connector

    Your own internal trading engine or proprietary Mercado Bitcoin integration, including direct WebSocket consumers for low-latency BRL spot strategies.

Framework support for Mercado Bitcoin

The spot-only matrix matches Mercado Bitcoin's product surface: there is no USD-M, COIN-M or options column to populate. If your strategy needs perpetuals or USD-margined futures, pair Mercado Bitcoin with a separate venue (for example Binance, Bybit or OKX) for the derivatives leg. MB's tokenized real-world asset programme (XRPL-based regulated series, fixed-income-linked tokens) sits outside the standard programmatic crypto-pair surface and is excluded from this matrix today.

FrameworkSpot
Native Mercado Bitcoin API v4Supported
CCXTSupported
FreqtradePartially supported
HummingbotNot documented as supported

✓ confirmed support per official framework docs. "partial" indicates community-tier support that may require additional validation. "no connector" indicates the framework does not ship a Mercado Bitcoin connector. Workflow links target /workflows/ pages currently in authoring.

TradingHost does not force a framework. It runs your project.

Author with AI

The framework starters above pair naturally with AI IDEs. The TradingHost MCP control surface closes the loop: AI tools can inspect deployments, review logs and manage the runtime alongside you, never the trade execution path.

Section 04 · Run on TradingHost

Run your code on TradingHost

Mercado Bitcoin provides the exchange and API access. TradingHost provides the production environment where your Mercado Bitcoin-connected strategy runs.

Instead of running strategy code on a laptop, desktop machine, generic VPS or manually configured server, you deploy from GitHub into a TradingHost-managed container runtime.

You

  • Your repo contains your code.
  • Your deployment defines how it runs.
  • Your strategy connects to Mercado Bitcoin.

TradingHost

  • Keeps the runtime online.
  • Surfaces logs and health checks.
  • Region selection.
  • Controlled deployment surface.

Deployment flow

  1. STEP 01

    Connect GitHub

    Authorise TradingHost to access your GitHub account.

  2. STEP 02

    Link a repo or start from a framework

    Point TradingHost at your existing strategy repo, or fork a TradingHost framework runtime (CCXT or Freqtrade) for a working baseline.

  3. STEP 03

    Deploy into a TradingHost container

    Pick a region (EU or US-East), supply the environment values your strategy needs (Mercado Bitcoin API v4 credentials drive the authorize-then-token flow: your API key and secret are used to POST `/authorize`, and the returned bearer token is sent on subsequent private endpoints), and deploy. TradingHost builds your container from the repo and runs your strategy on managed Kubernetes infrastructure. No local Docker install required.

  4. STEP 04

    Monitor logs and health

    Watch live logs, health and runtime state from the TradingHost dashboard. The same surface is reachable through MCP from any AI IDE, so Cursor, Claude Code or a CLI agent can read deployment state and manage the runtime alongside you.

  5. STEP 05

    Update and redeploy

    Push changes to your GitHub main branch and TradingHost redeploys automatically.

Section 05 · Operational notes

Operational notes for Mercado Bitcoin

Things that bite you when you actually run a Mercado Bitcoin strategy in a containerised cloud runtime, not in Mercado Bitcoin's docs, not in framework READMEs. Every claim below is quoted or paraphrased from Mercado Bitcoin's own documentation and the published Brazilian regulatory record; the deployment-side guidance is from running these strategies on TradingHost.

  1. 01 · API generations

    Two parallel API surfaces, v4 is the path forward

    Legacy TAPI v3 lives at `/tapi/v3/` using HMAC-SHA512 over request path with `TAPI-ID` and `TAPI-MAC` headers. Current API v4 at `api.mercadobitcoin.net/api/v4` uses an authorize-then-token model. Build new strategies against v4; only fall back to TAPI for endpoints not yet ported.

  2. 02 · PIX rails

    Brazilian instant payments handle BRL funding

    BRL deposits and withdrawals use PIX, the Banco Central do Brasil instant payments network. PIX clearing is 24x7x365 including weekends and holidays. Deposits via PIX appear in MB accounts effectively instantly; BRL withdrawals process up to 1 business day per MB's published terms. PIX is handled outside the trading API.

  3. 03 · KYC tiers

    Verified accounts unlock automation limits

    Unverified accounts cap at R$1,000 per 24h withdrawal and R$50,000 annual deposit. Fully verified (CPF plus identity) accounts unlock R$50,000 daily withdrawals with no deposit cap. KYC tier directly affects what an automated strategy can execute.

  4. 04 · Tokenized assets

    RWA series trade with their own market structure

    Spot crypto pairs trade 24x7. Tokenized regulated assets (MB's XRPL RWA program, fixed-income-linked tokens) follow underlying-asset behaviour and may have settlement constraints; do not assume continuous price discovery on tokenized series the way you would for BTC/BRL.

  5. 05 · Regulation

    Lei 14.478/2022, SPSAV resolutions, CVM oversight

    MB operates under Brazilian Virtual Assets Law (Lei 14.478/2022). On November 10, 2025 the Banco Central do Brasil published Resolutions 519, 520 and 521 establishing the SPSAV (sociedade prestadora de serviços de ativos virtuais) framework. Exchanges must obtain SPSAV authorization, observe minimum paid-in capital (R$1m intermediary, R$2m custodian, R$3m broker), and CVM retains jurisdiction over tokenized assets that qualify as securities. Operational impact on strategies: expect periodic KYC re-verification and source-of-funds requests on large PIX flows.

Section 06 · Built for

Built for

TradingHost Mercado Bitcoin runtimes are best suited to:

  • Brazilian and LATAM quant developers building BRL-native strategies
  • Fintech and crypto desks running production BRL spot books on PIX rails
  • AI-IDE-first developers using Cursor and Claude Code to deploy strategies to a Brazilian execution venue
  • Tokenized-asset and RWA teams using MB's regulated tokenization stack
  • Stablecoin and FX arbitrage teams trading MBRL, BRZ, USDT, USDC across BRL pairs

Connecting GitHub and creating your first strategy is free.

Section 08 · FAQ

FAQ

No. TradingHost is independent and is not affiliated with Mercado Bitcoin or its parent 2TM Participações.

No. Your strategy code connects to Mercado Bitcoin and sends instructions according to your own logic, account permissions and integration method. TradingHost provides the runtime where that code runs.

No. Mercado Bitcoin API access is provided by Mercado Bitcoin. You are responsible for your Mercado Bitcoin account, API permissions, credentials and compliance with Mercado Bitcoin’s terms.

No. TradingHost is the cloud runtime where your strategy code runs. We do not provide signals, AI prediction models or pre-built bots. With TradingHost you write or generate the strategy yourself (often with Cursor or Claude Code), keep it in GitHub as your code, and use TradingHost to run it in production. 3Commas, Cryptohopper and similar products own the strategy logic; TradingHost runs your strategy.

AWS and DigitalOcean give you raw compute. You handle OS updates, container orchestration, log shipping, secret rotation, region failover and uptime monitoring yourself. TradingHost gives you a managed runtime purpose-built for trading strategies: GitHub-native deployment, MCP-driven control from AI IDEs, log and health surfaces out of the box. If you want to operate the infrastructure yourself, AWS works. If you want the runtime as a managed service, TradingHost is the shorter path.

Yes. TradingHost runs Python strategies; pick the framework runtime that matches your stack or deploy your own repo.

Yes. TradingHost supports any language that can run inside a container.

Yes. The exchange id is mercado. It exposes MB spot markets through the standard CCXT unified interface. If you are using Freqtrade or any other CCXT-based framework on TradingHost, set the exchange name to mercado. There is no official Hummingbot connector; that path requires a custom connector. See the CCXT framework runtime for the full setup story.

Yes, if your project is designed that way. You can run multiple strategy processes or services inside one runtime, or separate them into different runtimes for isolation and operational clarity. See the TradingHost runtime page for the multi-strategy model.

The fastest path is to fork a TradingHost framework runtime: CCXT for a ready-to-deploy project, or connect your own GitHub strategy repo. Linking a GitHub repo and creating a strategy is free; runtime plans are listed on the pricing page.

In your GitHub-controlled secrets workflow. TradingHost reads them at runtime through GitHub repository secrets, environment secrets or your own approved secret-management process. TradingHost does not need custody of your API key and secret. See platform secrets for the full handling model.

No. Strategies should never need withdrawal permissions. Use the minimum scope required (read plus trade) and enable any IP whitelisting Mercado Bitcoin offers on your key. Withdrawal-capable keys should be reserved for accounts you operate manually from a fixed host.

Yes. TradingHost supports MCP-based control for AI IDEs including Cursor, Claude Code, GitHub Copilot and CLI-based AI agents. AI tools can inspect deployments, review logs, restart strategies and manage runtime workflows. MCP is a control and observability surface, not the trade execution path. See the MCP control surface for the full picture.

Both. The MCP control surface works equally well from CLI-based agents (Claude Code CLI, custom MCP clients, scripted MCP calls) and from inside an IDE. The GitHub-native deployment loop also works without any AI tooling: a regular git push to your main branch triggers a redeploy.

The runtime detects the crash and exposes the relevant logs and health information. Where supported, the affected strategy can be restarted without disrupting other strategies running in the same container. Your strategy code is still responsible for safe error handling, duplicate-order protection and risk controls. See observability for the logs and health surface.

Confirm which API generation you are calling. The new API v4 uses an /authorize flow that issues a token sent on subsequent private requests; the legacy TAPI v3 uses HMAC-SHA512 over the request path with TAPI-ID and TAPI-MAC headers. Mixing the two is the most common cause. Also check that your server clock is in sync and that the API key is enabled for the operation (read, trade, withdraw) you are calling.

Yes. BRL funding is handled by MB’s PIX integration outside the trading API. PIX runs 24x7 across the Brazilian banking system, so deposits typically credit instantly. Once BRL is on your MB account, strategies running in a TradingHost container call the MB API v4 to place orders against BRL pairs. TradingHost does not touch PIX or your bank credentials.

MB operates under Brazil’s Virtual Assets Law (Lei 14.478/2022). The Banco Central do Brasil’s Nov 2025 SPSAV resolutions (519, 520, 521) define licensing for virtual asset service providers, and the CVM oversees tokenized assets that qualify as securities. Full KYC is required for production trading; withdrawal limits are tied to verification tier; tokenized-asset endpoints may apply suitability or eligibility rules. None of this affects how your code runs in a TradingHost container; it affects what the MB account behind the API key is allowed to do.

For programmatic access, check which series are exposed via the API v4 markets endpoint at runtime. CVM rules may gate certain instruments. MBRL, MB’s BRL-pegged stablecoin issued on TRON (launched Nov 2024), is tradeable on MB’s order book and is a natural cash leg for BRL-side automation. Treat tokenized fixed-income RWA series on XRPL as discrete instruments with their own market structure rather than 24x7 crypto pairs.

TradingHost runs in the EU and US-East regions. Pick the region closest to the matching engine your strategy depends on. For Mercado Bitcoin specifically, US-East typically offers lower round-trip latency to São Paulo-region cloud endpoints than EU. See the regions page for routing and proximity details.

No. TradingHost is focused on production runtime and deployment. Backtesting belongs in your research stack, framework or AlgoBuilder.