Trading API
Trade from a bot using the same Practice account you see on the Novrinex website. API orders, positions and pUSDC balances appear in Practice mode. pUSDC has no monetary value.
This endpoint is for devnet trading. A Practice key cannot trade live funds.
https://trading-api.testnet.novrinex.comPractice API: https://trading-api.testnet.novrinex.com
Public market-data endpoints do not require a key. Account and order endpoints require a developer key and an Ed25519 signature.
Quick start
Section titled “Quick start”Activate Practice on the website, then create and download a key from Settings > Developer API. Choose the scopes your client needs. The private key is generated in your browser; store the downloaded file securely.
Install the Python client:
python -m pip install https://docs.novrinex.com/downloads/novrinex-1.0.0-py3-none-any.whlLoad the downloaded key file. The SDK generates order IDs when omitted.
import asyncio
from novrinex import NovrinexApiError, NovrinexClient
async def main(): async with NovrinexClient.from_key_file("novrinex-key.json") as client: positions = (await client.positions()).get("data", []) active = positions[0] if positions else None order = { "market_id": active["market_id"] if active else "BTC-PERP", "side": "sell" if active and active["side"] == "short" else "buy", "type": "market", "quantity": "0.001", "leverage": int(active["leverage"]) if active else 1, "margin_mode": active["margin_mode"] if active else "cross", "max_slippage_percent": "0.50", }
try: simulation = await client.simulate_order(order) if simulation["decision"] != "READY": print(simulation["issues"]) return
current = await client.place_order(order) for _ in range(30): if current["execution_stage"] == "TERMINAL": break await asyncio.sleep(1) current = await client.get_order(current["order_id"]) print(current["status"]) except NovrinexApiError as error: print(error)
asyncio.run(main())Orders use your website Practice account and execute on Novrinex L1. The returned route is novrinex-paper.
For TypeScript on Node.js 20 or later:
npm install https://docs.novrinex.com/downloads/novrinex-trading-api-1.0.0.tgzThe key file contains the API URL and Practice account ID. Resetting that account requires a new key. Revoking a key stops new requests and access to private WebSocket updates.
The OpenAPI schema and interactive reference describe the HTTP contract.
Request rules
Section titled “Request rules”- Send prices, quantities, balances, and monetary values as decimal strings.
- Use RFC 3339 UTC timestamps.
- Raw HTTP clients must send unique
request_idandclient_order_idvalues. The SDK generates them when omitted. - Treat HTTP
202as accepted for processing, not filled. - Use the returned
order_idto read, amend, or cancel an order. - After a timeout, recover the original
request_idbefore submitting another order.
Main endpoints
Section titled “Main endpoints”| Task | Endpoint |
|---|---|
| Check availability | GET /v1/status |
| List markets | GET /v1/markets |
| Read an order book | GET /v1/markets/{market_id}/book |
| Read account totals | GET /v1/account |
| Read positions | GET /v1/positions |
| Simulate an order | POST /v1/orders/simulate |
| Place an order | POST /v1/orders |
| Read an order | GET /v1/orders/{order_id} |
| Cancel an order | POST /v1/orders/{order_id}/cancel |
| Recover a request | GET /v1/requests/{request_id} |
| Stream updates | GET /v1/ws |
Continue with authentication or the order examples.