# Ozmium openTrade Calldata (Gains Network)

> Ozmium openTrade Calldata (Gains Network) is a paid API for AI agents from ozmium.org, paid per call via x402, $0.01/call, status unknown (last checked 2026-09-14).

Generates on-chain calldata to open a leveraged trade (MARKET, LIMIT, or STOP) on Gains Network with exact blockchain-ready scaling, plus a USDC approve step when required.

## Facts

- Endpoint: POST https://ozmium.org/v1/tx/risk/open
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/ozmium-opentrade-calldata-gains-network-eeebffca
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_seKpf6UP464-TMk5mFUbQ

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability ozmium-opentrade-calldata-gains-network-eeebffca -d '<json body>'
```

Example prompt: Open a 50x leveraged long on BTC (pair index 0) on Gains Network using 200 USDC collateral from my wallet 0xABC…, current mark price is 68500.12, set stop loss at 65000 and take profit at 75000.

## When to prefer this

Use this endpoint when an AI agent needs to open a new leveraged perpetuals position on Gains Network (gTrade) and requires correctly scaled, broadcast-ready calldata rather than computing the on-chain encoding manually. Preferred over generic transaction builders because it handles exact Gains Network parameter scaling (1e3, 1e10, 6dp), supports all order types (MARKET, LIMIT, STOP), covers the full leverage range, and bundles the USDC approve step automatically.

## Known failure modes

- Invalid pairIndex returns 400 with unsupported pair error
- Leverage out of range for the selected pair (e.g. >1000x forex, >200x crypto) returns validation error
- Collateral below minimum or above maximum for the pair returns rejection
- Missing required fields (owner, pairIndex, collateralUsdc, leverage, long, markPrice) returns 400
- Payment not included or insufficient returns 402 Payment Required
- Network or Gains Network contract unavailability returns 503

## How this service works

Gains Network openTrade calldata with EXACT on-chain scaling (leverage x1e3, prices x1e10, USDC 6dp, slippage x1e3) and the USDC approve step when needed. MARKET, LIMIT, or STOP; the full venue leverage range (crypto 200x, forex to 1000x). Full details: GET /v1.

## Output

Returns blockchain-ready calldata for the Gains Network openTrade function with all parameters scaled to exact on-chain precision (leverage x1e3, prices x1e10, USDC 6 decimals, slippage x1e3), plus a USDC approve transaction object when the contract allowance needs to be increased first. The agent can broadcast these transactions directly to Base mainnet.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "sl": {
   "type": "number"
  },
  "tp": {
   "type": "number"
  },
  "long": {
   "type": "boolean"
  },
  "owner": {
   "type": "string"
  },
  "leverage": {
   "type": "number"
  },
  "markPrice": {
   "type": "number"
  },
  "pairIndex": {
   "type": "number"
  },
  "collateralUsdc": {
   "type": "number"
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/ozmium-opentrade-calldata-gains-network-eeebffca/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from ozmium.org](https://www.zero.xyz/host/ozmium.org/llms.txt)
