SettleMint
Trading venue

Place and cancel orders

Sign an EIP-712 order intent, submit it to the Trading Venue, poll the reserved-balance transaction to completion, and cancel a working order on-chain.

A Trading Venue order is an EIP-712-signed intent from the maker wallet. You sign the order with the wallet's own key, submit it to the Platform API, and poll the queued reserved-balance transaction. The order becomes matchable only after its reservation confirms on-chain. This page covers placement, the intake checks that can reject an order, the order statuses, and cancellation. For depth, trades, and streams, see Read market data and streams.

Prerequisites

  • An API key with an active organization, or an authenticated session.
  • The maker wallet belongs to the selected participant and is registered in the deployment's identity registry for both listed tokens.
  • The maker wallet holds a trading authorization to the market's venue contract that covers the reserved amount plus the maximum applicable fee. Intake rejects orders the authorization does not cover.
  • A live market id from GET /api/v2/addons/trading-venue-markets.

Build and sign the order intent

The signature covers the on-chain order struct, so settlement can verify it independently of the platform. Sign with eth_signTypedData_v4 or your library's typed-data signer. Deployed smart accounts sign through ERC-1271.

The EIP-712 domain names the venue contract for the market:

{
  "name": "DALPTradingVenue",
  "version": "1",
  "chainId": 1,
  "verifyingContract": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0"
}

Take verifyingContract from the market's venueAddress and chainId from the network the deployment runs on. The primary type is Order:

{
  "Order": [
    { "name": "maker", "type": "address" },
    { "name": "recipient", "type": "address" },
    { "name": "marketId", "type": "bytes32" },
    { "name": "side", "type": "uint8" },
    { "name": "priceTick", "type": "uint256" },
    { "name": "quantity", "type": "uint256" },
    { "name": "expiry", "type": "uint256" },
    { "name": "epoch", "type": "uint256" },
    { "name": "salt", "type": "uint256" },
    { "name": "maxFeeBps", "type": "uint256" }
  ]
}

Field semantics:

FieldMeaning
makerThe wallet that signs and funds the order. Must belong to the selected participant.
recipientThe counter-leg recipient. Normally the maker wallet.
marketIdThe venue contract's market id: keccak256(abi.encode(baseTokenAddress, quoteTokenAddress)). This differs from the API's market id.
side0 for buy, 1 for sell.
priceTickThe integer limit price tick. For a market order, the protection-band limit you are willing to sign.
quantityThe base quantity in token base units. A positive multiple of the market's lotSize.
expiryUnix seconds after which the order can no longer fill. Enforced at match time and on-chain at execution.
epochThe bulk-cancel epoch the order is signed under. Use 0 unless the maker has bulk-cancelled.
saltA random uniqueness value. No ordering requirement.
maxFeeBpsThe signed fee cap in basis points. A fee schedule above this cap can never charge the order; sign at least the market's current maximum of makerFeeBps and takerFeeBps.

Place the order

Submit the signed intent with the API's market id. Amounts and prices travel as integer strings in token base units and price ticks.

curl -X POST "https://your-platform.example.com/api/v2/addons/trading-venue-orders" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "marketId": "0198f1c4-5e6f-7a80-bc13-4d5e6f7a8b9c",
    "maker": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
    "recipient": "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955",
    "side": "buy",
    "orderType": "limit",
    "timeInForce": "gtc",
    "priceTick": "1010",
    "quantity": "1000000000000000000",
    "expiry": "1785661200",
    "epoch": "0",
    "salt": "873245987234",
    "maxFeeBps": "25",
    "signature": "0x2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae1b"
  }'

timeInForce is gtc (good till cancelled), gtd (good till date, requiring a real expiry), or ioc (immediate or cancel); see time in force for the semantics. An optional triggerTick arms the order as a dormant stop instead of reserving it immediately; the stop contract is documented in Place stop orders. The platform verifies the signature, checks eligibility, desk limits, the trading authorization, and the fee cap, then queues the reserved-balance transaction and answers 202:

{
  "data": {
    "orderId": "0198f1c4-5e6f-7a80-bc13-4d5e6f7a8b9d",
    "orderHash": "0x2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae",
    "transactionHash": "0x2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"
  },
  "meta": {
    "txHashes": ["0x2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae"]
  },
  "links": { "self": "/v2/addons/trading-venue-orders" }
}

A 202 body carries transactionId and statusUrl. Poll that URL until the write is confirmed; see Transaction tracking for the polling contract. Do not treat the order as placed before the reservation confirms: until then its status is pending_reservation, it is not matchable, and it does not appear in depth. With the TypeScript SDK, the same call is v2AddonsTradingVenueOrdersPlace from @settlemint/dalp-sdk/operations.

Track the order status

Read your working orders, filtered by market or status:

curl -X GET "https://your-platform.example.com/api/v2/addons/trading-venue-orders?status=working" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx"
StatusMeaning
armedA dormant stop order waiting for its trigger. Nothing is reserved.
pending_reservationThe reserved-balance transaction is awaiting confirmation.
workingThe order rests on the book.
partially_filledPart of the quantity settled; the rest still works.
filledTerminal. The full quantity settled.
cancelledTerminal. The on-chain cancellation confirmed.
expiredTerminal. The signed expiry passed.
rejectedTerminal. An intake check failed or the reservation did not confirm.
prunedTerminal. The venue removed the order after a failed fill, a compliance change, or a fee-schedule raise above its signed cap.

GET /api/v2/addons/trading-venue-reservations lists the reserved balances backing your open orders, and GET /api/v2/addons/trading-venue-blotter returns your fills with the fee charged to your side.

Cancel an order

Cancellation is effective on-chain, so a cancelled signed order can never fill, even if the venue matched it before the cancel arrived.

curl -X DELETE "https://your-platform.example.com/api/v2/addons/trading-venue-orders/0198f1c4-5e6f-7a80-bc13-4d5e6f7a8b9d" \
  -H "X-Api-Key: sm_dalp_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{}'

The platform marks the order cancelled on the book and queues the on-chain cancellation; the response is the same 202 shape as placement. The reserved balance is released when the cancellation confirms. Poll the statusUrl before you treat the order as cancelled on chain. The SDK operation is v2AddonsTradingVenueOrdersCancel.

Errors

StatusWhat happenedWhat to do
422An intake check rejected the order before it reached the book. The rejection reason names the failed check: eligibility, desk limits, trading authorization, fee cap, expiry, signature, or submission rate.Correct the named check and submit a new order. Do not retry unchanged.
409 on placementThe wallet's cumulative reserved balance plus this order would exceed its spendable balance.Cancel resting orders to release reserved balance, or submit a smaller order.
503 on placementThe reserved-balance transaction reverted or timed out. The order was rejected and its reservation compensated.Check the wallet balance and the venue's custodian role on the reserved token, then submit a new order.
404The market or order id does not name a resource the selected participant can see.Use ids from the markets list or the working-orders list.
409 on cancelThe order already reached a terminal status, so nothing was cancelled.Refresh the working-orders list.

On this page