Skip to Content
API ReferenceOfferings API

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

MethodPathAuthDescription
GET/api/offerings/PublicEvery offering
GET/api/offerings/:tickerPublicOne offering
POST/api/offerings/subscribePrivy JWTBuy units
GET/api/wallet/ipo-holdsPrivy JWTWallet 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 as marketList on GET /api/trade/:ticker
  • feeBps
  • images
  • videoUrl
  • ipoChainId
  • tradingStartsAt
  • marketStatus
  • subscribers
  • ordersAllocated
  • recentOrders

A recent order:

FieldMeaning
buyerAddressBuyer address
buyerHandleBuyer handle
quantityUnits
timestampUnix seconds
txHashTransaction hash

Live allocation also arrives on ipo:{ipoId} as ipo_allocation_update.

StatuscodeMeaning
400INVALID_REQUESTTicker 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.

FieldMeaning
sourceL2
stateSUBMITTING, AWAITING_PAYOUT, RELAYED, SETTLED, FAILED, or EXPIRED
withdrawalJournalSeqJournal sequence of the withdrawal. Null while state is SUBMITTING
StatuscodeMeaning
400ORDER_EXPIRY_INVALIDdeadline or permitDeadline is too far ahead, or l2Withdrawal.l2ExpiryMs is inside the 72-hour buffer or later than the deadlines allow
400INVALID_REQUESTThe body failed validation, or l2Withdrawal.l2ChainId is not market.l2.l2ChainId
400INVALID_SIGNATUREThe permit is not the wallet’s signature of the sale, the two caps together, permitDeadline, and the token’s current nonce. Sign it again
400IPO_WALLET_HAS_CODEThe wallet is a smart account or has an EIP-7702 delegation. Loaf does not relay a purchase from it
400Another 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
401UNAUTHENTICATEDA missing, invalid, or expired Privy JWT, or a login token
401INVALID_SIGNATUREPaid 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
403ORDER_NOT_OWNEDPaid 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
409IPO_ORDER_IN_FLIGHTThis buyer already has a purchase in flight on the sale
409IPO_WALLET_HELDWallet balance minus older holds cannot pay this purchase
409ORDER_INDEX_USEDThat withdrawal nonce is already in use
422INSUFFICIENT_BALANCEPaid from the trading balance: the trading balance cannot pay l2Withdrawal.amount plus the withdrawal fee
422BELOW_MIN_ORDER_VALUEPaid from the trading balance: l2Withdrawal.amount is below the asset’s minimum withdrawal
422WITHDRAW_FEE_ABOVE_MAXPaid from the trading balance: the withdrawal fee is above maxWithdrawFee, or above 0 when it is absent
422ORDER_INDEX_USEDPaid from the trading balance: l2Withdrawal.l2Nonce is not withdrawalNonce from GET /api/l2/keys
429RATE_LIMITEDAccount or relay limit. Retry after the Retry-After seconds
503The 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
500INTERNAL_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.

Last updated on