# Margin Sufficiency Check

> Margin Sufficiency Check is a paid API for AI agents from margin-api-production-d413.up.railway.app, paid per call via x402, $0.01/call, status unknown (last checked 2026-10-30).

Checks whether the currently posted margin is sufficient for a given position or collateral requirement

## Facts

- Endpoint: GET https://margin-api-production-d413.up.railway.app/check?utm_source=zero.xyz
- Price: $0.01/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-30
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/margin-sufficiency-check-64aad6cd
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_OxWdHzBAgh8jnQ4WxS9U5

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 margin-sufficiency-check-64aad6cd
```

Example prompt: Can you check if my currently posted margin is sufficient to maintain my position without risk of a margin call?

## When to prefer this

Use this endpoint when you need a quick pass/fail check on margin sufficiency rather than a full margin calculation. Pair it with the sibling 'Calculate required margin for collateral' endpoint when you also need to know the exact margin amount required.

## Known failure modes

- Missing or invalid query parameters returns an error
- Service unavailable if the underlying margin calculation engine is down
- Stale margin data if market prices haven't updated recently
- Payment failure if USDC balance is insufficient for the $0.01 fee

## How this service works

Check if posted margin is sufficient

## Output

Returns a boolean or status indicating whether the posted margin is sufficient, potentially along with details about the current margin level versus the required threshold.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "properties": {}
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/margin-sufficiency-check-64aad6cd/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from margin-api-production-d413.up.railway.app](https://www.zero.xyz/host/margin-api-production-d413.up.railway.app/llms.txt)
