Skip to content

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.

ConcernWhere
Contractcontract-deployment/contracts/modular/BzMarketplace.sol (plus per-chain copies)
Legacy contractscontracts/MarketplaceNFT.sol, contracts/deprecated/MarketplaceNFTv2.sol
Routesroutes/marketplaceRoutes.js/api/marketplace
Listing modelmodels/MarketplaceListing.js
Offer modelmodels/MarketplaceOffer.js
NFT modelmodels/marketplaceNFTModel.js, userNFTInventoryModel.js
Servicesservices/marketplaceService.js, marketplaceContractService.js, marketplaceEventListener.js, services/marketplace-service/
ABIutils/abi/NFTMarketplace.json
Cartmodels/cartModel.js, routes/cartRoutes.js
Integration docbz-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.

ConcernWhere
Routesroutes/presaleRoutes.js/api/presale, routes/presaleAdminRoutes.js/api/presale/admin
Wallet modelmodels/presaleWallet.js
Deposit modelmodels/presaleDeposit.js
Audit trailmodels/presaleAudit.js
Whitelistmodels/whitelistModel.js, routes/whitelist.routes.js/api/whitelist
Generic depositsmodels/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}/.

FeatureWhere
Paymentsroutes/paymentRoutes.js, models/paymentModel.js, tokenPaymentModel.js
Token transactionsmodels/tokenTransactionModel.js, transactionV2Model.js
Products cataloguemodels/productModel.js, routes/productRoutes.js
Mintingroutes/mintRoutes.js
NFT metadataroutes/nftMetadataRoutes.js
IPFS pinningroutes/pinataRoutes.js, mounted at /api/pinata
Exchange ratesmodels/exchangeRateModel.js
Migrationroutes/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 existMarketplaceNFT.sol, deprecated/MarketplaceNFTv2.sol, and modular/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.

Internal + developer documentation. Usage figures are point-in-time snapshots — re-verify before publishing them.