Offerings
Initial property offerings. List and detail are public. Subscribing needs a Privy JWT. A login token is refused.
The path ticker is the asset ticker (TERA). tokenName is the asset display name, the same value the trade list serves as name. Call the API with the ticker.
Endpoints
| Method | Path | Auth | Description |
|---|---|---|---|
GET | /api/offerings/ | Public | Every offering |
GET | /api/offerings/:ticker | Public | One offering |
POST | /api/offerings/subscribe | Privy JWT | Buy units |
GET | /api/wallet/ipo-holds | Privy JWT | Wallet money an earlier purchase still holds |
List and detail are cached briefly. Holds are Cache-Control: private, no-store.
List
GET /api/offerings/
curl 'https://api.loafmarkets.com/api/offerings/'{
"ipos": [
{
"ipoId": 12,
"tokenName": "Tera",
"ticker": "TERA",
"streetAddress": "1 Example St",
"country": "AU",
"suburb": "Sydney",
"unitPrice": 150,
"totalUnits": 10000,
"offeringValuation": 1500000,
"imageUrl": "https://…/header.webp",
"ipoContractAddress": "0xabc…",
"opensAt": 1764000000,
"closesAt": 1765000000,
"unitsAllocated": 1200,
"status": "LIVE",
"preSaleStatus": "LIVE"
}
]
}status is PENDING, LIVE, or CLOSED. The list leaves out a cancelled offering. The detail can also show CANCELLED. preSaleStatus is PENDING or LIVE. Times are unix seconds, or null.
Detail
GET /api/offerings/:ticker
curl 'https://api.loafmarkets.com/api/offerings/TERA'The detail has the list fields except suburb and imageUrl, and adds:
marketList, the same list asmarketListon GET /api/trade/:tickerfeeBpsimagesvideoUrlipoChainIdtradingStartsAtmarketStatussubscribersordersAllocatedrecentOrders
A recent order:
| Field | Meaning |
|---|---|
buyerAddress | Buyer address |
buyerHandle | Buyer handle |
quantity | Units |
timestamp | Unix seconds |
txHash | Transaction hash |
Live allocation also arrives on ipo:{ipoId} as ipo_allocation_update.
| Status | code | Meaning |
|---|---|---|
400 | INVALID_REQUEST | Ticker is not ^[A-Z0-9]{1,10}$ |
404 | { "error": "Asset not found" }, "IPO not found for this asset", or "IPO sale contract not yet deployed". No asset has that ticker, the asset has no offering, or its sale contract is not deployed yet | |
500 | { "error": "Failed to list IPOs" } or "Failed to fetch IPO page" |
Subscribe
POST /api/offerings/subscribe
Privy JWT. The account must have passed KYC and wholesale investor verification. One purchase in flight per buyer. A second while the first is still pending is refused.
The body is the buyer’s EIP-712 PurchaseWithFee signature (domain name LoafPrimarySale, version 1, chainId ipoChainId, verifyingContract the sale). Loaf relays the transaction.
{
"ipoId": 12,
"quantity": 10,
"maxBasePayment": 1500000000,
"maxFeeAmount": 15000000,
"nonce": "…32 hex chars…",
"deadline": 1764100000,
"signature": "0x…",
"permitDeadline": 1764100000,
"permitSignature": "0x…",
"l2Withdrawal": {
"l2AccountIndex": 4,
"l2ApiKeyIndex": 0,
"l2AssetId": 3,
"l2Route": 1,
"amount": "1515000000",
"l2Nonce": 7,
"l2ExpiryMs": 1764359080000,
"l2ChainId": 1,
"l2SigS": "…80 hex…",
"l2SigE": "…80 hex…",
"maxWithdrawFee": "0.05"
}
}maxBasePayment and maxFeeAmount are the signed caps, in the payment token’s base units. maxBasePayment must cover the cost, quantity × unitPrice. maxFeeAmount must cover the fee, feeBps of the cost, rounded up. Lower caps are refused. In the example, 10 units at a unitPrice of 150 cost 1500000000 base units, and a feeBps of 100 makes the fee 15000000.
deadline and permitDeadline are unix seconds. Each must be in the future and at most 65 minutes ahead, or 125 minutes ahead when paying from the trading balance.
Omit l2Withdrawal to pay from the wallet. Include it to pay from the trading balance: a signed spot-route withdrawal of the payment asset (l2Route must be 1, l2ApiKeyIndex must be 0). Loaf waits until that withdrawal is paid, then relays the purchase. maxWithdrawFee is the most withdrawal fee you accept, in USD. It is not part of the signed message. Absent means 0. Send withdrawFee from GET /api/portfolio/summary. A withdrawal fee above maxWithdrawFee, or any fee while it is absent, is refused 422 WITHDRAW_FEE_ABOVE_MAX.
l2Withdrawal.amount is in L2 ticks (see Money and units). It must be at least the cost plus the fee, and at most the two caps together, each rounded up to a whole tick. At a tickSize of 1, the example’s amount is the cost plus the fee.
Paid this way, deadline and permitDeadline must each be at least 30 minutes ahead. Sign l2Withdrawal.l2ExpiryMs 72 hours after the earlier of the two deadlines, less 2 minutes, as the example does. A later expiry is refused, and so is one inside the 72-hour buffer.
nonce is 32 lowercase hex characters: the first 12 are a unix-ms timestamp in hex, then 20 random hex characters. The signature’s payment token has to be the token the sale is priced in.
{
"success": true,
"subscriptionId": 88,
"allocatedQuantity": 10,
"funding": { "source": "L2", "state": "AWAITING_PAYOUT", "withdrawalJournalSeq": 4412 }
}funding is present only when the purchase is paid from the trading balance.
| Field | Meaning |
|---|---|
source | L2 |
state | SUBMITTING, AWAITING_PAYOUT, RELAYED, SETTLED, FAILED, or EXPIRED |
withdrawalJournalSeq | Journal sequence of the withdrawal. Null while state is SUBMITTING |
| Status | code | Meaning |
|---|---|---|
400 | ORDER_EXPIRY_INVALID | deadline or permitDeadline is too far ahead, or l2Withdrawal.l2ExpiryMs is inside the 72-hour buffer or later than the deadlines allow |
400 | INVALID_REQUEST | The body failed validation, or l2Withdrawal.l2ChainId is not market.l2.l2ChainId |
400 | INVALID_SIGNATURE | The permit is not the wallet’s signature of the sale, the two caps together, permitDeadline, and the token’s current nonce. Sign it again |
400 | IPO_WALLET_HAS_CODE | The wallet is a smart account or has an EIP-7702 delegation. Loaf does not relay a purchase from it |
400 | Another refusal, for example a malformed permit signature, caps below the cost, a deadline that has passed or is too near, or an l2Withdrawal.amount out of range. error says which | |
401 | UNAUTHENTICATED | A missing, invalid, or expired Privy JWT, or a login token |
401 | INVALID_SIGNATURE | Paid from the trading balance: the l2Withdrawal signature does not verify, or the account has no enabled trading key. error says which |
401 | { "error": "Signature is not by this account's wallet" }. The PurchaseWithFee signature does not verify for the account’s wallet | |
403 | ORDER_NOT_OWNED | Paid from the trading balance: l2Withdrawal.l2AccountIndex is not the account the buyer’s wallet opened |
403 | { "error": "KYC verification required" }, "Wholesale investor verification required", or "Trading is currently halted" | |
404 | { "error": "IPO not found" }. No offering has that ipoId | |
409 | IPO_ORDER_IN_FLIGHT | This buyer already has a purchase in flight on the sale |
409 | IPO_WALLET_HELD | Wallet balance minus older holds cannot pay this purchase |
409 | ORDER_INDEX_USED | That withdrawal nonce is already in use |
422 | INSUFFICIENT_BALANCE | Paid from the trading balance: the trading balance cannot pay l2Withdrawal.amount plus the withdrawal fee |
422 | BELOW_MIN_ORDER_VALUE | Paid from the trading balance: l2Withdrawal.amount is below the asset’s minimum withdrawal |
422 | WITHDRAW_FEE_ABOVE_MAX | Paid from the trading balance: the withdrawal fee is above maxWithdrawFee, or above 0 when it is absent |
422 | ORDER_INDEX_USED | Paid from the trading balance: l2Withdrawal.l2Nonce is not withdrawalNonce from GET /api/l2/keys |
429 | RATE_LIMITED | Account or relay limit. Retry after the Retry-After seconds |
503 | The purchase could not be completed now. Retry after the Retry-After seconds when it is set. If error contains may or may not have been recorded or the outcome is unknown, check offeringOrders on GET /api/portfolio/component before you sign again | |
500 | INTERNAL_ERROR | { "error": "Failed to authenticate request" }. Authentication failed on the server, not because of the JWT. Try again in a moment |
500 | { "error": "Failed to create IPO subscription" } |
A 422 rejects the purchase. Nothing leaves the trading balance.
Refusals are { "error" }, with code where the table gives one. code is one of the values above, or an order error code.
Wallet holds
GET /api/wallet/ipo-holds
Privy JWT. Money the wallet cannot spend because an earlier purchase still holds it. A new purchase can spend only wallet money no older purchase holds.
{
"blockNumber": 21000000,
"blockTimestamp": 1764096000,
"holds": [
{
"orderId": 88,
"paymentToken": "0xusdc…",
"amount": "1515000000",
"claimBlock": 20998000,
"deadline": 1764100000
}
]
}amount is the purchase’s cost plus the fee, in the payment token’s base units.