Why Orderbook?
Shared Liquidity
Shared Liquidity
Gasless Listings
Gasless Listings
Creating orders is free—sellers only sign a message. Gas is only paid when orders are filled.
Enforced Royalties
Enforced Royalties
Royalties are enforced at the protocol level. Creators always get paid on secondary sales.
Instant Settlement
Instant Settlement
Trades settle on-chain immediately. No waiting, no counterparty risk.
Core Concepts
Before diving into implementation, understand these universal orderbook concepts that apply across all platforms:Order Types
| Order Type | Description | Who Creates | Example |
|---|---|---|---|
| Listing (Sell Order) | NFT owner offers to sell at fixed price | Seller | ”Selling Sword #123 for 1 IMX” |
| Bid (Buy Order) | Buyer offers to buy specific NFT | Buyer | ”Offering 0.5 IMX for Sword #123” |
| Collection Bid | Buyer offers to buy ANY NFT in collection | Buyer | ”Offering 0.3 IMX for any Sword” |
Token Standards
Different NFT types behave differently in the orderbook:ERC-721 (Unique NFTs)
ERC-721 (Unique NFTs)
- Each token is unique (e.g., specific Sword #123)
- Amount is always
1 - Orders use
FULL_RESTRICTEDtype - Cannot be partially filled
- Most common for gaming items and collectibles
- Learn more about ERC-721 contracts
ERC-1155 (Semi-Fungible)
ERC-1155 (Semi-Fungible)
- Tokens can have multiple copies (e.g., 100 copies of Health Potion)
- Amount can be any quantity
- Orders use
PARTIAL_RESTRICTEDtype - Supports partial fills (e.g., buy 5 of 10 available)
- Great for in-game consumables and stackable items
- Learn more about ERC-1155 contracts
ERC-20 & Native Tokens
ERC-20 & Native Tokens
- ERC-20: Fungible tokens (e.g., USDC, project tokens)
- NATIVE: Chain native currency (IMX on Immutable zkEVM)
- Used as payment currency in orders
- Amounts specified in smallest unit (wei)
- Learn more about ERC-20 tokens
Maker vs Taker Model
The orderbook uses a maker/taker model to distinguish between liquidity providers and consumers: Maker 👷 Creates an order that goes on the orderbook (adds liquidity)- Listings: Sellers are makers
- Bids: Buyers are makers
- Typically pay lower fees to incentivize order creation
- Maker fees set at order creation and cannot be changed
- Filling listings: Buyers are takers
- Filling bids: Sellers are takers
- Typically pay higher fees as they consume liquidity
- Taker fees set flexibly at fulfillment time
Order Lifecycle
Orders progress through these statuses:| Status | Description | Terminal? |
|---|---|---|
PENDING | Order submitted, awaiting balance/approval checks | No |
ACTIVE | Order is live and can be filled | No |
INACTIVE | Temporarily unfillable (insufficient balance, revoked approval) | No |
FILLED | Order completely filled | Yes |
CANCELLED | Order cancelled by maker | Yes |
EXPIRED | Order passed expiration time | Yes |
Approval Pattern
The orderbook requires token approvals before certain operations: For Sellers (Creating Listings):- Before creating your first listing for an NFT collection, approve the Seaport contract to transfer your tokens
- One-time per collection per user
- Approval transaction costs gas
- Subsequent listings of that collection don’t need approval
- Smart contract wallets (Passport) may have pre-approved contracts via Hub configuration
- Before buying with ERC-20 tokens, approve Seaport to spend those tokens
- One-time per currency per user (or when allowance insufficient)
- Native (IMX) orders never require buyer approval
Getting Started
Prerequisites
Before using the Orderbook SDK, ensure you have:- User Authentication: Users authenticated with Passport or wallet connected (MetaMask, WalletConnect, etc.)
- For Sellers:
- NFT contract deployed with contract address and token ID
- Understanding of maker fees
- For Buyers:
- Sufficient funds in wallet (IMX or ERC-20 tokens)
- Understanding of taker fees
- For Order Management:
- Order IDs for querying or cancellation
- Order ownership (for cancellation operations)
Installation
Install the orderbook package via npm:TypeScript SDK Overview
View all available packages and configuration options
Setup
Creating Listings
Listings let users sell NFTs at a fixed price. Creating a listing is gasless—only the buyer pays gas when filling.List an ERC-721 NFT
List an ERC-1155 NFT
For semi-fungible tokens, specify the quantity. Buy amount must be a multiple of sell amount.Order Type Differences:
- ERC-721 uses
FULL_RESTRICTEDorder type (cannot be partially filled, amount always 1) - ERC-1155 uses
PARTIAL_RESTRICTEDorder type (supports partial fills) - SDK automatically sets the correct order type based on token type
Filling Listings (Buying)
When a buyer fills a listing, the trade executes on-chain.Creating Bids
Bids let users make offers on specific NFTs.Order Expiration
Set when orders should expire:| Expiration | Use Case |
|---|---|
| 1 hour | Flash sales |
| 24 hours | Daily auctions |
| 7 days | Standard listings |
| 30 days | Long-term listings |