Skip to content
Finance
Skill

/primary

Trading API de Primary (Matba ROFEX): futuros, opciones, acciones, bonos. Órdenes, posiciones, cuenta, market data.

BOOST
From plugin
gauss314-skills
25032 skills
Install
$ npx -y skills add gauss314/skills --skill primary --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/primary

Context preview

The summary Claude sees to decide when to auto-load this skill.

Trading API de Primary (Matba ROFEX): futuros, opciones, acciones, bonos. Órdenes, posiciones, cuenta, market data.

SKILL.md

primary.SKILL.md
name: primary
description: "Trading API de Primary (Matba ROFEX): futuros, opciones, acciones, bonos. Órdenes, posiciones, cuenta, market data."
license: MIT

Primary — Trading API de Matba ROFEX

API para operar en el Mercado Argentino de Futuros y Opciones (Matba ROFEX) a través de Primary Trading Platform (PTP). Soporta futuros (dólar, soja, trigo, maíz, índices), opciones sobre futuros, acciones, bonos y CEDEARs.

**Base URL:** `https://api.remarkets.primary.com.ar`

**Docs:** [github.com/matbarofex](https://github.com/matbarofex/) — repositorio oficial con ejemplos open source.

---

Autenticación

Obtener Credenciales

| Entorno | URL | Descripción | |---------|-----|-------------| | **REMARKET** (demo) | [remarkets.primary.ventures](https://remarkets.primary.ventures/) | Crear cuenta gratis para paper trading | | **LIVE** (producción) | Contactar a [mpi@primary.com.ar](mailto:mpi@primary.com.ar) | Solicitar acceso al equipo MPI |

Una vez creada la cuenta en REMARKET, tendrás:

  • **Usuario**: el que registraste
  • **Password**: el que configuraste
  • **Account**: tu número de cuenta (suele ser `REM` + últimos dígitos del usuario)

Obtener Token

import requests

r = requests.post("https://api.remarkets.primary.com.ar/auth/getToken",
    headers={"X-Username": tu_usuario, "X-Password": tu_password})

token = r.headers["X-Auth-Token"]

El token se envía en adelante como header `X-Auth-Token` en todos los requests.

**⚠️ NUNCA hardcodear credenciales. Usar variables de entorno o parámetros CLI.**

import os
TOKEN = os.getenv("PRIMARY_TOKEN")  # Opcional: cachear token
USER = os.getenv("PRIMARY_USER")
PASS = os.getenv("PRIMARY_PASSWORD")
ACCOUNT = os.getenv("PRIMARY_ACCOUNT")  # Ej: 12345 o REM12345

Renew Token

Si recibís un 401, el token expiró. Renovalo con un nuevo POST a `/auth/getToken`.

---

Segmentos

El mercado se organiza en **segmentos** (ruedas de negociación). Cada instrumento pertenece a un segmento.

| Segmento | Descripción | |----------|-------------| | `DDF` | Derivados Financieros (futuros de dólar, índices) | | `DDA` | Derivados Agropecuarios (soja, trigo, maíz) | | `DUAL` | Instrumentos listados en ambas divisiones | | `MERV` | Mercados externos a Matba ROFEX (BYMA) | | `MAE` | Mercado Abierto Electrónico | | `TEST` | Ambiente de pruebas | | `U-DDF`, `U-DDA`, `U-DUAL`, `U-FIN`, `U-COMM`, `U-STOCK` | Sub-segmentos de usuarios | | `TIVA`, `AVS` | Otros segmentos |

Listar Segmentos

GET https://api.remarkets.primary.com.ar/rest/segment/all
r = requests.get("https://api.remarkets.primary.com.ar/rest/segment/all",
    headers={"X-Auth-Token": token})
print(r.json()["segments"])

**Respuesta:**

{"status":"OK","segments":[
  {"marketSegmentId":"DDF","marketId":"ROFX"},
  {"marketSegmentId":"DDA","marketId":"ROFX"},
  ...
]}

---

Instrumentos (Securities)

Los instrumentos se identifican por su **símbolo** y **marketId**. Ejemplos:

| Símbolo | Descripción | CFI Code | |---------|-------------|----------| | `DLR/JUN26` | Futuro de dólar Junio 2026 | `FXXXSX` | | `SOJ.ROS/MAY26` | Futuro de soja Rosario Mayo 2026 | `FXXXSX` | | `DLR/JUN26 1460 C` | Opción Call sobre futuro dólar | `OCAFXS` | | `DLR/JUN26 1420 P` | Opción Put sobre futuro dólar | `OPAFXS` | | `GGAL` | Acción Grupo Galicia | `ESXXXX` |

Todos los Instrumentos

GET https://api.remarkets.primary.com.ar/rest/instruments/all

Instrumentos con Detalle

GET https://api.remarkets.primary.com.ar/rest/instruments/details

Devuelve: `symbol`, `segment`, `lowLimitPrice`, `highLimitPrice`, `minPriceIncrement`, `minTradeVol`, `maxTradeVol`, `tickSize`, `contractMultiplier`, `roundLot`, `maturityDate`, `currency`, `orderTypes`, `timesInForce`, `cficode`.

Detalle de un Instrumento

GET https://api.remarkets.primary.com.ar/rest/instruments/detail?symbol=DLR/JUN26&marketId=ROFX

Por Código CFI

GET https://api.remarkets.primary.com.ar/rest/instruments/byCFICode?CFICode=FXXXSX

| CFI Code | Tipo | |----------|------| | `FXXXSX` | Futuro | | `FXXXXX` | Futuro (genérico) | | `OCAFXS` | Opción Call sobre Futuro | | `OPAFXS` | Opción Put sobre Futuro | | `OCEFXS` | Opción Call europea sobre Futuro | | `OPEFXS` | Opción Put europea sobre Futuro | | `ESXXXX` | Acción | | `DBXXXX` | Bono | | `EMXXXX` | CEDEAR | | `OCASPS` | Opción Call sobre Acción | | `OPASPS` | Opción Put sobre Acción | | `DBXXFR` | Obligación Negociable |

Por Segmento

GET https://api.remarkets.primary.com.ar/rest/instruments/bySegment?MarketSegmentID=DDF&MarketID=ROFX

---

Market Data

En Tiempo Real (REST Snapshot)

GET https://api.remarkets.primary.com.ar/rest/marketdata/get
    ?marketId=ROFX
    &symbol=DLR/JUN26
    &entries=BI,OF,LA,OP,CL,SE,OI
    &depth=3

| Entry | Significado | |-------|-------------| | `BI` | Bids (ofertas de compra en el book) | | `OF` | Offers (ofertas de venta en el book) | | `LA` | Last (último precio operado) | | `OP` | Opening Price (precio de apertura) | | `CL` | Closing Price (cierre rueda anterior) | | `SE` | Settlement Price (precio de ajuste, solo futuros) | | `HI` | High Price (máximo de la rueda) | | `LO` | Low Price (mínimo de la rueda) | | `TV` | Trade Volume (volumen operado en contratos) | | `OI` | Open Interest (interés abierto, solo futuros) | | `IV` | Index Value (solo índices) | | `EV` | Effective Volume (solo BYMA) | | `NV` | Nominal Volume (solo BYMA) | | `ACP` | Auction Price (cierre del día corriente) |

r = requests.get("https://api.remarkets.primary.com.ar/rest/marketdata/get",
    headers={"X-Auth-Token": token},
    params={"marketId": "ROFX", "symbol": "DLR/JUN26",
            "entries": "BI,OF,LA,OP,CL,SE,OI", "depth": 3})
data = r.json()["marketData"]
print(f"Bid: {data['BI']}  |  Offer: {data['OF']}")
print(f"Last: {data['LA']}  |  Settle: {data['SE']}")

Histórica (Trades)

Read more
Ships withgauss314-skills

Open-source collection of skills compatible with the SKILL.md standard. Developed for the AI courses at UCEMA.

Get the whole plugin

Other skills on gauss314-skills.