Skip to main content
OCX runs order books for USDC loans. A bid is an offer to borrow, an ask is an offer to lend, and a fill opens a fixed-term loan between the two accounts. Rates are quoted as an annual yield; the loan settles at its maturity, when the borrower pays back principal plus interest. Every endpoint is served through the gateway at https://api.ocx.global. GET /funding/book is Public; every other endpoint here needs a signed-in session (cookie or Authorization: Bearer) — see Authentication. The API paths use the name funding; this has nothing to do with futures funding payments, which OCX does not have.
Enums: side = borrow | lend; timeInForce = gtc | ioc (default gtc; fok is accepted and treated as ioc). Rates are rateBps: annual yield in basis points, 0 to 100,000, to 0.1 bp — 1625 is 16.25% a year. Sizes are USDC decimal strings, rounded to the cent.

Books and tenors

There is one book per tenor. A loan matures at the daily settlement time on the first day that is at least its term away from the fill. For every tenor except 23h the term is counted less one hour before the next settlement is taken, so a 1w loan filled at 21:00 UTC matures at the settlement seven days later, not eight. Each fill reports its exact maturesAt. OCX’s own levels carry venue: true in the book. Where OCX has lent on a book, it also bids for that money back, below the rate it lent at, so a borrower can close early by lending into those bids.

Matching

  • A borrow takes offers at or below its rateBps; a lend hits bids at or above its rateBps. Best rate first, then time.
  • A fill is priced at the resting order’s rate.
  • Your own orders never match each other. A gtc order that would cross your own resting order on the same book is refused (SELF_CROSS); an ioc order is not.
  • gtc rests whatever does not fill; ioc cancels it.

Interest and fees

Interest is simple, on the principal, at the loan’s rate, for the loan’s exact term in seconds over a 365-day year, rounded to the cent. The borrower pays the full term’s interest, including when it repays early through POST /funding/repay. The one exception is a loan recalled because its lender was liquidated: the borrower then pays interest to the recall.
Three fees apply. GET /funding/book returns the live values.

How the cash moves

All funding cash moves through your options bucket. See Balances & transfers.
1

Post a lend

The full size leaves options when you post (lend_reserve), so a resting offer is cash you really have. If options is short, the gateway tops it up from your other buckets and retries once, as it does for orders. Cancelling, or an ioc remainder, returns it (lend_release).
2

Fill

The borrower receives the principal in options (lend_borrow), less the fill fee (lend_fee).
3

Warning

At warnUtc each day, a borrower whose loans mature at the next settlement and who would then be short of margin has those loans flagged: warning in GET /funding/me.
4

Settlement

At settleUtc (currently 20:15 UTC) every matured loan settles. The borrower’s options bucket pays principal (lend_repay) and interest (lend_interest), even if that takes it below zero; the borrower’s resting lend offers are cancelled first if needed to cover it. The lender receives principal (lend_return) and interest less feeBps (lend_yield).
These entries appear in GET /wallet/history, with the order or loan id in txHash. A lend_lend entry records a lend filling; its cash already left at lend_reserve.
blackout in the book describes an optional daily window around settlement in which new 23h orders are refused (BOOK_CLOSED). It is currently disabled; closed is true while a book is inside it.

Limits

Borrow capacity

A multiple (maxLeverage) of your own NLV, less what you already owe net on each book, less your resting borrow bids. GET /funding/me returns it as capacity. A resting bid is checked again when it fills: it is cut back to your capacity at that moment, or cancelled.

Lend limit

You can lend only free equity: NLV not already lent or offered, less the initial margin your positions and working orders need. Borrowed cash and sold premium cannot be lent. Lending back what you owe on the same book is exempt.
While you owe on the books, a withdrawal must leave at least the principal you owe × (1 + 1/maxLeverage) across your buckets; the rejection states the most you can withdraw. See Withdraw.

Borrowing, margin, and liquidation

  • Borrowed cash is collateral. It sits in options, so during the day your requirement is measured against NLV plus what you borrowed. NLV itself does not rise: the loan is netted.
  • Overnight, only longer loans count. At the daily cutoff, borrowing that runs past the next settlement still carries your positions; borrowing due at the next settlement does not. Money you have lent that is not back by the next settlement does not count either.
  • Loan floor. While you owe on the books, your account is liquidated if its NLV falls to liquidationFloorPct of the equity it had when your oldest open loan was taken. GET /funding/me shows the level as liquidation.floorEquity.
  • Liquidation settles your loans. Your resting funding orders are cancelled, and once your positions are closed every loan you borrowed is settled with its full-term interest. Loans you made to other clients are recalled: the borrower repays now, with interest to date.
If you borrowed from a client who is liquidated, your loan can therefore be recalled before maturity. See Margin & liquidations.

Endpoints

Book

GET /funding/book?tenor=23h — Public. One book, aggregated by rate. tenor defaults to 23h.
string
array
Offers to lend (lowest rate first) and bids to borrow (highest first).
boolean
Whether the books are open, and whether this book is inside its blackout window now.
number
The fees described in Interest and fees.
string
Smallest order the books accept, USDC.
string
Daily settlement and warning times (UTC), and the next settlement.
string
The loan floor, as a share of equity at your first open loan.
number
How OCX’s exit bids step: each further clip bids this many bps lower, starting below the rate OCX lent at.
string
Size of each clip of OCX’s exit bids, USDC.
object
{ enabled, fromUtc, toUtc }.
Response

Your account

GET /funding/me — Session. Your open orders, open loans in both directions, interest to date, and limits.
string
What you can still borrow now, the leverage behind it, and your own NLV (net of loans) it is measured on.
string
What your buckets hold, borrowed cash included.
string
Open principal, gross.
string
The same netted per book: lending back on a book offsets borrowing on that book.
string
Interest accrued to now; the receivable is net of feeBps.
string
Cash in your resting lend offers, and cash your working option orders hold.
object | null
{ floorPct, equityAtGrant, floorEquity } while you owe; null otherwise.
array
Open orders: { id, tenor, side, rateBps, size, remaining, status, createdAt }.
array
Open loans, soonest maturity first: { id, tenor, role, principal, rateBps, feeBps, accruedInterest, openedAt, maturesAt, warnedAt }. role is borrower or lender.
object | null
{ maturesAt, warnedAt } when loans you borrowed are flagged ahead of settlement.
Response

Place an order

POST /funding/orders — Session.
string
required
23h | 1w | 2w | 1m | 3m | 6m | 1y
string
required
borrow (bid) | lend (ask)
number | string
required
Annual yield in bps, to 0.1. For a borrow, the most you will pay; for a lend, the least you will accept.
string
required
USDC, at least minSize.
string
gtc (default) | ioc. Must be ioc on 23h.
Returns { orderId, tenor, side, rateBps, size, remaining, status, fills }. status is filled, open (resting), or cancelled (an ioc remainder). Each fill is { loanId, rateBps, size, maturesAt, counterpartyOrderId }.
Response

Amend, cancel, and repay

POST /funding/repay takes no body and returns { settled, netPaid, keptOpen }. settled lists each loan settled (loanId, principal, interest, fee, and both account ids); netPaid is what left your account (negative when you received); keptOpen lists lends to OCX left to run, as { loanId, principal }. Repayment is paid from your options bucket only — move cash there first if it is short — and is refused if what remains would not cover your margin.

Borrow and place

An opening single-leg option order can borrow what it is short in the same request. Add borrow to POST /orders:
object
If the order is short of premium cash or margin, OCX borrows the shortfall ioc on that book (at least minSize, sized so the cash after the fill fee covers it), then checks the order again. The loan and the order commit together or not at all: if the borrow is refused, the order is still short, or an ioc/market order fills nothing (ORDER_DID_NOT_FILL), nothing is borrowed and the order is not sent. The response adds borrowed: { size, fee, cash, fills }, or null when nothing was borrowed.
POST /orders
The automatic top-up from your other buckets acts only on a rejected order. With borrow, the order is not rejected for a shortfall; it borrows instead. Move cash into options first if you would rather use your own.

Errors

Refusals return 400 with { code, message, details } unless noted.