Skip to main content
Place bids on NFTs in a collection whose metadata matches filters you define (for example, Background is Blue or Red). Trait bids are a stricter form of collection bids. The seller must still choose a concrete token when filling, but that token’s indexed attributes must satisfy all of your trait criteria.
See Getting Started for prerequisites and installation.

What is a trait bid?

  • You offer ERC-20 tokens to buy one or more NFTs from a collection, identified by an ERC-721 collection or ERC-1155 collection buy item.
  • You attach traitCriteria: an array of filters. Each filter has a trait type (metadata attribute name) and a list of allowed values.
  • Matching semantics: every trait type you specify must be matched by the NFT’s metadata. For a given type, the token matches if its attribute value is one of the values you listed. Matching is case-insensitive for values and numerical values are converted to their string equivalent.
  • Orders appear as TRAIT_BID in API responses alongside listings, bids, and collection bids. Use the order type field when branching in your app or webhooks.

Prerequisites

  • Same setup as other orderbook flows (Passport or wallet, fees, etc.).
  • Metadata for fulfillment: when a seller fills your bid with a specific tokenId, Immutable validates that token’s attributes against your criteria. That requires the NFT’s metadata to be available through Immutable’s indexer. If metadata is missing or out of date, fulfillment can fail even if the token exists on-chain.

Creating a trait bid

The flow mirrors collection bids: prepare (builds orderComponents, orderHash, and actions) → run any approval transactions → sign the EIP-712 order from the SIGNABLE action → create.

Filling a trait bid (seller)

Sellers call fulfillOrder with the trait bid order id and the token ID they are selling. The fifth argument is tokenId (criteria fulfillment); pass undefined for amountToFill when you are not doing a partial ERC-1155 quantity fill.
If the token’s indexed metadata does not satisfy every trait filter on the bid, the orderbook will not return valid fulfillment data for that token.
For more context on actions, fees, and expiry, see Fill orders.

Querying trait bids

List trait bids

Filter by collection contract, status, maker, and pagination — same ergonomics as listCollectionBids.

Get one trait bid

Comparison: token bid vs collection bid vs trait bid vs metadata bid

Fees and cancellation

  • Fees: same maker/taker concepts as other orders — see Fees.
  • Cancel: use the bid’s order id with Cancel orders (soft or hard cancel patterns apply to open orders).

Next steps

Collection bids

Bids on any NFT in a collection without trait filters

Metadata bids

Bids matched by metadata ID or field-level metadata criteria

Fill orders

Fulfillment, actions, and approvals

Order management

Status, pagination, and webhooks

Cancel orders

Cancel trait bids you created