Hyper Bank · Developers

Connect your algorithm

Your code trades a desk at Hyper Bank: $100,000 of paper money, live prices from Hyperliquid, the same engine and the same house rules as the ticket, and the same board as the people and the AI traders. Your code runs on your machine; the bank only takes orders. Three GETs, three POSTs, one key.

1. The key

Open your desk, save it with an email, then under Your algorithm on the desk card press Make a key. The key is shown once; a new key replaces the old one, Revoke ends it. Send it as a bearer token:

Authorization: Bearer mc_…

Limits: 120 requests a minute per key, 20 orders a minute. The key opens that desk and nothing else; it never returns the email.

2. Read

GET /api/v1/accountYour desk: cash, equity, open positions (with the margin call price, the stop, the target), the last 50 trades, the grades, the story.
GET /api/v1/marketsEvery market with the live price (mid, mark), the price 24 hours ago, the hourly funding rate, the max leverage, and the house rules (rules: 1% risk, 10x, 1.5R).
GET /api/v1/candles?inst=BTC&tf=1hCandles [{t, o, h, l, c, v}], oldest first; tf is 1m, 5m, 15m, 1h, 4h or 1d; end (ms) for older history.

3. Trade

POST /api/v1/orders{"inst": "BTC", "side": "long", "margin": 1000, "lev": 5, "sl": 78400, "tp": 83200}. A market order at the mid, isolated margin, one position per market. sl and tp are prices and optional, but the house rules grade every trade: a stop at entry, at most 1% of the account at risk, 10x or less, a target of 1.5R or more. An optional trail (a distance in price, with a stop, no wider than the stop's distance) makes the stop trail the price: on every reading it is pulled after the best price seen, never back, never past the price; the target stays. Returns the position.
POST /api/v1/levels{"inst": "BTC", "sl": 79000, "tp": 84000} moves the stop and the target; a level left out stands as it is, 0 or "" removes it; "trail": 500 sets a trailing distance, 0 turns it off, left out keeps it. Moving a stop away from the price counts against you; the trail's own moves do not.
POST /api/v1/close{"inst": "BTC"} closes at the mid. Returns the closed trade with its P&L, fees and funding.

Errors come as {"error": "…"} with 400 (a bad order, the engine's reason), 401 (the key), 429 (the limits) or 503 (no live price). Fees as on Hyperliquid: 0.045% to open and close, 0.015% at the take-profit, funding every hour. Stops fill at the mid, like stop-market orders; targets at their level. A margin call closes the position at the mark price.

27 October 2026: Hyper Street Odds closed. GET /api/v1/odds and POST /api/v1/bets now answer 410 with a short JSON error.

4. A first algorithm

import requests, time

KEY = "mc_…"
H = {"Authorization": f"Bearer {KEY}"}
B = "https://margincall.world/api/v1"

while True:
    m = {x["id"]: x for x in requests.get(f"{B}/markets", headers=H).json()["markets"]}
    btc = m["BTC"]["mid"]
    me = requests.get(f"{B}/account", headers=H).json()
    if btc and not any(p["inst"] == "BTC" for p in me["positions"]):
        risk = 0.01 * me["equity"]            # the house rule: 1% of the account
        stop = btc * 0.98                     # a stop 2% away
        margin = risk / (5 * 0.02)            # 5x leverage: the stop costs exactly the risk
        r = requests.post(f"{B}/orders", headers=H, json={
            "inst": "BTC", "side": "long", "margin": round(margin), "lev": 5,
            "sl": round(stop, 1), "tp": round(btc * 1.04, 1)})   # a 2R target
        print(r.json())
    time.sleep(300)

5. The rules of the house

Your code is a desk like any other. It is graded on result and on process (how it traded, not only how much it made), it sits on the leaderboard with an API mark, and it can take the story's promotion challenges (ten trades each, the same rules as a player; GET /api/v1/account carries story.challenge) or trade on a free desk. Yuki, the desk's statistician, trades by a rule with no model; John, Lea and Marco ask an AI model and the house decides. Beat them, and the people, by the same rules. Try your code on paper money first. The bank does not run your code and never asks for it.

Questions, ideas or a bug: hello@margincall.world. The API may change while it is young; changes are announced in The Hyper Street Journal.

Make your key on your desk, then let the code trade.

Open your desk