Appearance
Marketplace & presale
Two commerce surfaces in the ecosystem layer: an NFT marketplace with hybrid settlement, and a token presale module.
NFT marketplace
Buy, sell and make offers on NFTs, with settlement in either on-chain currency or BlazPoints.
| Concern | Where |
|---|---|
| Contract | contract-deployment/contracts/modular/BzMarketplace.sol (plus per-chain copies) |
| Legacy contracts | contracts/MarketplaceNFT.sol, contracts/deprecated/MarketplaceNFTv2.sol |
| Routes | routes/marketplaceRoutes.js → /api/marketplace |
| Listing model | models/MarketplaceListing.js |
| Offer model | models/MarketplaceOffer.js |
| NFT model | models/marketplaceNFTModel.js, userNFTInventoryModel.js |
| Services | services/marketplaceService.js, marketplaceContractService.js, marketplaceEventListener.js, services/marketplace-service/ |
| ABI | utils/abi/NFTMarketplace.json |
| Cart | models/cartModel.js, routes/cartRoutes.js |
| Integration doc | bz-backend/MARKETPLACE_INTEGRATION.md |
Hybrid settlement
This is the interesting design choice. A listing can be bought with:
- On-chain payment — a real transfer through
BzMarketplace.sol. - BlazPoints — an off-chain balance deduction, with the NFT transfer executed by the platform.
The points path is why the marketplace matters economically: it is the primary sink for the points minted by staking and quests. Without it, BlazPoints would be pure inflation.
Event listener
services/marketplaceEventListener.js watches contract events and reconciles them into MarketplaceListing / MarketplaceOffer. That reconciliation exists because a listing can be filled directly on-chain without going through the API — the database has to catch up rather than being the source of truth.
Marketplace staking
Sellers can stake to gain listing privileges or reduced fees. contracts/modular/BzNFTStaking.sol and contracts/NFTStaking.sol back it.
Cart
A cart flow exists (cartModel.js, /api/cart), which is unusual for an NFT marketplace and suggests the surface is intended for fixed-price consumer purchases as much as for trading.
Presale
Token presale with whitelisting and deposit tracking.
| Concern | Where |
|---|---|
| Routes | routes/presaleRoutes.js → /api/presale, routes/presaleAdminRoutes.js → /api/presale/admin |
| Wallet model | models/presaleWallet.js |
| Deposit model | models/presaleDeposit.js |
| Audit trail | models/presaleAudit.js |
| Whitelist | models/whitelistModel.js, routes/whitelist.routes.js → /api/whitelist |
| Generic deposits | models/depositModel.js, services/depositProcessor.js |
presaleAudit.js is worth noting — presale is the one ecosystem module with a dedicated audit-trail model, because deposit disputes are inevitable and reconstructing them from logs is not good enough.
In BlazAI
The BUY_BZ_TOKEN intent renders swapAI/presale/PresaleMessage.tsx (action buy_bz_token), so a user can buy the native token from chat. v1/services/bzToken.service.js handles it, with the agent node in bz-agent/src/agent/bzTokenNode.ts and template at src/template/bzToken.ts.
Products contract
contracts/Blazpay_ProductsV2.sol, deployed per chain, is the shared on-chain product contract used across the commerce and game surfaces. It is duplicated under contracts/{arbitrum_sepolia,avax,hemi,qubetics,soneium}/.
Related platform pieces
| Feature | Where |
|---|---|
| Payments | routes/paymentRoutes.js, models/paymentModel.js, tokenPaymentModel.js |
| Token transactions | models/tokenTransactionModel.js, transactionV2Model.js |
| Products catalogue | models/productModel.js, routes/productRoutes.js |
| Minting | routes/mintRoutes.js |
| NFT metadata | routes/nftMetadataRoutes.js |
| IPFS pinning | routes/pinataRoutes.js, mounted at /api/pinata |
| Exchange rates | models/exchangeRateModel.js |
| Migration | routes/migrationRoutes.js, models/migrationModel.js |
Analytics API documentation for the payment and transaction surfaces lives at defi-set/TOKEN_PAYMENT_ANALYTICS_API.md and TRANSACTION_V2_ANALYTICS_API.md.
Known limits
- Three generations of marketplace contract exist —
MarketplaceNFT.sol,deprecated/MarketplaceNFTv2.sol, andmodular/BzMarketplace.sol. Old listings may reference old contracts. - The event listener is a reconciliation layer, not a guarantee. If it is down, direct on-chain fills diverge from the database until it catches up.
- BlazPoints settlement is platform-executed. The buyer trusts Blazpay to transfer the NFT after the points deduction. That is a genuine custody step, unlike the trading products.
- No BlazAI marketplace intent. Users cannot browse or buy from chat.
- Presale is campaign-shaped, not evergreen. The module assumes a bounded sale with a whitelist, not continuous issuance.
- Documented in repo markdown (
MARKETPLACE_INTEGRATION.md, the analytics API docs) rather than here.