Logo von B3 Brazil Exchange Api Integration

B3 Brazil Exchange Api Integration

Community
HimanshuJ16
b3-brazil-exchange-api-integration

Verwenden Sie diesen Skill, wenn Sie die Konnektivität zum B3 PUMA Trading System konfigurieren und zwischen dem Legacy-Stack FIX/FAST und Binary SBE wählen: Er erzwingt die SBE-Voraussetzung zur Gap-Recovery, durch die sich beide unterscheiden, und verwaltet den Verbindungslebenszyklusstatus rund um ein Vendor-SDK.

Übersicht

HerausgeberHimanshuJ16
RepositoryAlgo-Trading-Skills
Skill-Nameb3-brazil-exchange-api-integration
Sterne
50
Forks
7
Mitgelieferte Dateien
5
LizenzApache-2.0
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • Mitgelieferte Dateien: 5

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von HimanshuJ16 auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill B3 Brazil Exchange Api Integration in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/b3-brazil-exchange-api-integration
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/HimanshuJ16/Algo-Trading-Skills.git /tmp/Algo-Trading-Skills
mkdir -p .claude/skills
cp -r /tmp/Algo-Trading-Skills/skills/b3-brazil-exchange-api-integration .claude/skills/b3-brazil-exchange-api-integration
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie B3 Brazil Exchange Api Integration in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt B3 Brazil Exchange Api Integration automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist B3 Brazil Exchange Api Integration nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Purpose

Validates B3-specific connectivity configuration and manages connection state for algorithmic trading systems connecting to the B3 PUMA Trading System. Its central job is to make one architectural asymmetry impossible to get wrong: B3's legacy FIX/FAST UMDF publishes TCP-based recovery services, while the newer Binary UMDF (SBE) feed does not — so an SBE consumer must implement its own gap recovery or it will lose market data silently.

Scope — what this skill does NOT do

This module performs no network I/O. It opens no sockets, sends no FIX/FIXP messages, and contacts nothing. connect() drives a state machine and delegates to an injected connector callable; with no connector supplied it logs a warning and reports success without touching the network.

A successful connect() is therefore not evidence of reachability, valid credentials, IP whitelisting, or entitlement. Earlier versions of this skill presented if engine.connect(): print("Connected to B3") as a connectivity example, which was misleading — it would print success on a machine with no network at all. Inject a real connector (OnixS, B2BITS, or your own socket layer) for actual sessions.

When to Use

  • Validating B3 DMA configuration before handing it to a real session layer
  • Choosing between the legacy FIX/FAST stack and the Binary SBE stack
  • Enforcing the SBE gap-recovery precondition in CI or at application startup
  • Managing connection lifecycle state around a vendor SDK

When NOT to Use

  • As a connectivity or credential test — it performs no I/O (see Scope above)
  • As a FIX/FIXP engine or SBE decoder — use binary-protocol-parsing-for-low-latency-feeds and a real session library
  • Connecting to B3 via broker-provided APIs (use broker-specific adapters)
  • Systems that do not need direct exchange connectivity

Prerequisites

  • Python 3.10+
  • Network connectivity to B3 colocation or a certified B3 network provider
  • B3-assigned SenderCompID/TargetCompID from B3 Membership Services
  • Valid B3 credentials and IP whitelisting for order entry and market data
  • For Binary SBE: an application-level gap recovery implementation (sequence tracking + snapshot recovery), which is outside this skill

Protocol Selection

LEGACY_FIX_FASTMODERN_BINARY_SBE
Order entryFIX 4.4Binary Order Entry (FIXP + SBE)
Market dataUMDF FIX/FASTBinary UMDF (SBE)
Book modelMBP / Top of Book availableMBO only — no MBP, no TOB
Gap recoveryTCP Replayer, TCP Historical Replayer, Snapshot RecoveryNo TCP recovery channel; sequence tracking + snapshot
enable_application_gap_recoveryOptionalMust be True (enforced)

Legacy is not a neutral long-term choice. B3 has been reducing FIX order entry gateways in phases — Derivatives in Q4 2025, Equities 10 April – 15 May 2026 — reassigning IPs, ports, and TargetCompIDs, with login failures for participants who miss their cutoff. Confirm current gateway status with B3 before starting new legacy work. See references/standards.md for sources and dating.

Workflow

  1. Create B3ConnectionConfig. Validation runs in __post_init__ and raises B3ConfigurationError (a ValueError subclass):
    • comp_id — matched against a conservative ^[A-Za-z0-9_]{1,12}$ whitelist. This is this skill's defensive default, not a published B3 grammar; override via comp_id_pattern once you confirm the real limits with B3.
    • password — excluded from repr so it cannot leak into logs or tracebacks.
    • order_entry_ip — must be a dotted-quad string and must not be multicast (order entry is point-to-point TCP).
    • market_data_multicast_ip — must be a genuine multicast address unless you pass require_multicast_market_data=False for an isolated test rig.
    • protocol_suite — must be a B3ProtocolSuite member, not a string.
  2. Construct B3IntegrationEngine. If protocol_suite is MODERN_BINARY_SBE and enable_application_gap_recovery is False, construction fails — the SBE feed has no TCP gap-fill channel to fall back on.
  3. Inject a connector if you want real connectivity. Without one, connect() is a state-machine simulation and says so at WARNING level.
  4. Call connect(). DISCONNECTED/FAILED → CONNECTING → CONNECTED. A connector that raises moves the engine to FAILED and raises B3ConnectionError; retry with backoff from there, since connect() is callable again after a failure.
  5. Implement SBE gap recovery separately. Track sequence numbers on every message, detect gaps, and recover via the snapshot/refresh streams — not via a TCP gap-fill request, which Binary UMDF does not offer.
  6. Call disconnect() on shutdown. Idempotent, and it forces the state to DISCONNECTED even if the injected disconnector raises, so a failing teardown cannot strand the session.

Full procedure: see references/workflows.md. Protocol specifics, recovery mechanisms, and sources: see references/standards.md. Printable pre-flight checklist: see assets/checklist.md.

Common Pitfalls

  • Reading connect() == True as connectivity. With no connector injected this function does nothing but set an enum. It is configuration validation, not a reachability check.
  • Expecting a TCP gap-fill channel on Binary UMDF. It does not exist. Legacy FIX/FAST offers TCP Replayer and TCP Historical Replayer; the SBE feed gives you sequence numbers and snapshot recovery, and nothing else. Building against a gap-fill request that Binary UMDF does not implement is a design dead end.
  • Assuming Binary UMDF is a drop-in upgrade. It is MBO-only — no Market-by-Price, no Top of Book. An algorithm consuming aggregated MBP from the legacy feed must rebuild the book from individual order events, not merely re-point at a new multicast group.
  • Treating a data-quality gap as recoverable after the fact. Once an SBE consumer has missed messages without detecting it, book state is wrong and every downstream signal is wrong with it. Detect at receive time via sequence continuity.
  • Assuming legacy FIX will stay available on the same endpoints. B3 has been consolidating FIX order entry gateways and reassigning IPs, ports, and TargetCompIDs; sessions that miss a cutoff fail to log in.
  • Logging the config object. A credential in a dataclass repr ends up in logs and crash reporters. password is repr=False here; keep it that way if you extend the config.
  • Unicast market data addresses in production. UMDF is multicast; a unicast address means no data arrives. This is now rejected by default rather than merely warned about in prose.
  • Trusting unsourced latency figures. The precise microsecond ranges commonly quoted for B3 trace to no B3 or vendor publication — measure in your own footprint.

Verification

Run python -m unittest discover -s skills/b3-brazil-exchange-api-integration/scripts — 29 tests, 100% pass rate. The suite covers:

  • MODERN_BINARY_SBE rejected without enable_application_gap_recovery, accepted with it; LEGACY_FIX_FAST allowed without it
  • CompID whitelist, including the regression that special characters and control characters were accepted whenever the ID also contained an underscore
  • IP validation: malformed addresses, integer addresses, multicast enforcement on market data, and multicast rejection on order entry
  • State machine: idempotent connect/disconnect, and the FAILED state, which was previously unreachable
  • Credential redaction from repr
  • Concurrent connect/disconnect leaving a valid state

Related Skills

  • binary-protocol-parsing-for-low-latency-feeds — decoding the SBE market data messages
  • fix-protocol-session-management-across-venues — full FIX/FIXP session handling
  • order-placement-idempotency — safe order submission once connected
  • sequence-number-gap-detection-for-feeds — the gap detection this skill requires but does not implement
  • exchange-multicast-feed-handling — multicast joins and feed plumbing
  • market-data-cost-optimization-tiered-subscriptions — B3 market data subscription costs

References

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill B3 Brazil Exchange Api Integration?

Verwenden Sie diesen Skill, wenn Sie die Konnektivität zum B3 PUMA Trading System konfigurieren und zwischen dem Legacy-Stack FIX/FAST und Binary SBE wählen: Er erzwingt die SBE-Voraussetzung zur Gap-Recovery, durch die sich beide unterscheiden, und verwaltet den Verbindungslebenszyklusstatus rund um ein Vendor-SDK.

Warum B3 Brazil Exchange Api Integration in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. B3 Brazil Exchange Api Integration besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich B3 Brazil Exchange Api Integration in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/HimanshuJ16/Algo-Trading-Skills/tree/main/skills/b3-brazil-exchange-api-integration ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können B3 Brazil Exchange Api Integration nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit B3 Brazil Exchange Api Integration verwenden?

So viele Sie möchten. In TypingMind können Sie B3 Brazil Exchange Api Integration mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill B3 Brazil Exchange Api Integration kostenlos?

Ja. Der Skill wird von HimanshuJ16 auf GitHub unter der Lizenz Apache-2.0 veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇