Create your marketplace with your own order book, and customize market fee.
1. Introduction
The best practice for building a marketplace is combining your own order book and trading aggregator, enabling you to fetch orders from 3rd-party marketplaces and post new orders to them, including your own order book. Read Build a Trading Aggregator if you'd like to learn more. Here, we'll mainly focus on building a marketplace with your own order book.
In this documentation, we outline the systematic procedure to create an NFT marketplace empowered with your own order book using the GoTrading platform. Through the steps detailed here, you will learn to configure your marketplace to retain a specified marketplace fee upon the on-chain execution of each transaction, ensuring a direct revenue channel irrespective of where the trade is executed.
2. Pre-requisites
- Kindly take some time to grasp the core concepts of business, it's vital to the integration.
- Your API Key is prepared, make sure you have access to the endpoints. Get your API key here.
3. Create Your Own Order Book
- Login to the developer platform and access the marketplace dashboard
- Choose the order book and click 'create'.
- Confirm the information and then the order book will be created successfully
- Tips on Managing and Maintaining the Order Book
- Order book name
We automatically generate the order book name, which is solely for trade tracking and data analysis. It will not be displayed to your users. - Fee ratio assigned to NFTGo
- We charge a portion of your trading fee amounting to 30% to fund our product development. If you have concerns or would like to change it, feel free to contact us, send email to [email protected] or DM @rommelbrito on Telegram.
- To explain the ratio further, for example: at 30%, if you set a fee of 0.01ETH for a trade, we'll take 0.003ETH and you'll receive 0.007ETH.
- Order book name
4. Trading NFTs with Your NFT Marketplace Using Your Own Order Book
Below, we delve into the paramount benefits and unique features of trading NFTs using your own order book within your marketplace. Harness the power to define personalized trading strategies, secure increased revenue through marketplace fees, and offer a seamless, efficient trading experience to your users.
Note: We utilized the NFT marketplace protocol, Seaport, to establish your own order book. All transactions related to your orders will be executed through the Seaport contract. During order creation, always ensure to pass the
order_kind
parameter asseaport-v1.5
. We anticipate incorporating support for additional marketplace protocols in the future to enhance the flexibility of your NFT marketplace.
5. Bulk Listings to Your Order Book and Collecting Marketplace Fee
In this section, we outline the technical process for adding bulk listings to your order book using the GoTrading platform. During this process, you'll specify the marketplace fee as a parameter with each order creation, effectively setting a designated commission rate for transactions occurring through your marketplace. This documentation guides you through the precise steps to configure this attribute correctly, facilitating a seamless and efficient setup of your personalized NFT marketplace.
5.1 With HTTP API
The following curl command provides an example where you merely need to replace YOUR_API_KEY}
with your actual API key to initiate a test request for listing an NFT to your order book using Create Listings API.
curl --location --request POST 'https://data-api.nftgo.io/trade/v1/nft/create-listings?chain=ethereum' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: YOUR_API_KEY' \
--data '{
"maker": "0x9398BA28015F0ce82b00CCB0da0C686a86DBad36",
"params": [
{
"token": "0x3d053C1B9eF47f14E9d97e076b96c3A7C5054B1d:7079",
"wei_price": "10000000000000",
"order_kind": "seaport-v1.5",
"orderbook": "self",
"listing_time": "1692605611",
"expiration_time": "1692615611",
"marketplace_fees_bps": ["0x9398BA28015F0ce82b00CCB0da0C686a86DBad36:100"]
"quantity": 1
}
]
}'
Note:
- Ensure to replace
YOUR_API_KEY
with your actual API key. - The
maker
field should contain the wallet address that initiates the listing. - In the
marketplace_fees
parameter, specify the list of wallet addresses for collecting the marketplace fee followed by the fee percentage (in basis points). In this case, "0x9398BA28015F0ce82b00CCB0da0C686a86DBad36:100" means the wallet address 0x9398BA28015F0ce82b00CCB0da0C686a86DBad36 will receive a 1% fee of the listing's price upon a successful transaction."
The following process is quite similar to the guide: https://docs.nftgo.io/docs/create-an-nft-marketplace-with-aggregated-order-books#--with-http-api.
Don't forget the last action is to post the signed-order. In your own order book case, we will store and maintain the availability of all orders for you.
6. Create Offers to Your Order Book and Collecting Marketplace Fee
6.1 With HTTP API
Below is an example using the curl command to create an NFT token offer to your order book using the Create Offers API:
curl --location --request POST 'https://data-api.nftgo.io/trade/v1/nft/create-offers?chain=ethereum' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: YOUR_API_KEY' \
--data '{
"maker": "0x9398BA28015F0ce82b00CCB0da0C686a86DBad36",
"params": [
{
"token": "0x3d053C1B9eF47f14E9d97e076b96c3A7C5054B1d:7080",
"wei_price": "10000000000000",
"order_kind": "seaport-v1.5",
"orderbook": "self",
"listing_time": "1692605611",
"expiration_time": "1692615611",
"marketplace_fees_bps": ["0x9398BA28015F0ce82b00CCB0da0C686a86DBad36:100"]
"quantity": 1
}
]
}'
Note:
- Ensure to replace
YOUR_API_KEY
with your actual API key. - The
maker
field should contain the wallet address that initiates the offer. - In the
marketplace_fees
parameter, specify the list of wallet addresses for collecting the marketplace fee followed by the fee percentage (in basis points). In this case, "0x9398BA28015F0ce82b00CCB0da0C686a86DBad36:100" means the wallet address 0x9398BA28015F0ce82b00CCB0da0C686a86DBad36 will receive a 1% fee of the offer's price upon a successful transaction."
7. Query Orders
Once the orders are posted to our service, you will be able to query them through the order book APIs:
- Get Orders by Contract: get all the orders of the specific collection.
- Get Orders by NFT: get orders of the specific NFT, you can use it on the NFT detailed page.
- Get Orders by Maker: get orders of the wallet address, you can use it on the user profile page.
- Get Orders by Id: you can use it to query specific groups of orders.
- Batch Get NFT Best Listing: get best listings of NFTs, you can use it on the NFT list of a collection or address.
- Get NFTs by collection: get filtered NFT of a collection, along with the best listing and best offer of NFTs.
Your orders will be returned together with the aggregated orders from other marketplaces' order books.
8. Buying NFTs with Your Order Book
Utilize the order ID specified in your listing to initiate a listing fulfillment transaction retrieval. Following the on-chain execution of this transaction, the marketplace fee delineated during order creation will be automatically allocated to your designated wallet. This fee is deducted from NFT seller's (listing's maker) receiving amount.
8.1 With HTTP API
Below is an example using the curl command to create an NFT token offer to your order book using the Fulfill Listings API:
curl --location --request POST 'https://data-api.nftgo.io/trade/v1/nft/fulfill-listings?chain=ethereum' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: YOUR_API_KEY' \
--data '{
"buyer": "0x9398BA28015F0ce82b00CCB0da0C686a86DBad36",
"order_ids": ["xxx"] // Place the order IDs you want to fulfill here
}'
In the code snippet above, you only need to make a couple of adjustments:
- Replace
YOUR_API_KEY
with the actual API key you have. - Populate the
order_ids
array with the specific order IDs you intend to fulfill. These IDs can be obtained through a previous API response or a query to your database.
9. Selling NFTs with Your Order Book
In this section, we will guide you through the process of setting up and executing selling orders using your personalized order book. Similar to buying, you will use the order ID specified at the time of listing to initiate selling transactions. Upon on-chain execution, the previously delineated marketplace fee will be automatically transferred to your specified account, this fee is deducted from NFT seller's (offer's taker) receiving amount.
9.1 With HTTP API
To streamline the sales process within your marketplace, consider leveraging the Fulfill Offers API, specially designed for this operation. The following curl
example demonstrates how to invoke this API:
curl --location --request POST 'https://data-api.nftgo.io/trade/v1/nft/fulfill-offers?chain=ethereum' \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: YOUR_API_KEY' \
--data '{
"seller_address": "SELLER_ADDRESS",
"offer_fulfillment_intentions": [
{
"contract_address": "CONTRACT_ADDRESS",
"order_id": "ORDER_ID",
"quantity": 1,
"token_id": "TOKEN_ID"
}
]
}'
Before executing, undertake the following adjustments to customize the API request to your needs:
- Substitute
YOUR_API_KEY
with your authentic API key. - Alter
CONTRACT_ADDR
,TOKEN_ID
, andORDER_ID
with the specific details of the NFT you're selling and the offer's order ID you are selling into.
10. Cancelling NFTs with Your Order Book
In the event that you wish to retract an order, either a listing or an offer, the GoTrading platform facilitates an uncomplicated cancellation procedure. Utilize the specific order ID associated with the order in question to initiate the cancellation transaction. Upon the on-chain validation of this transaction, the order will be promptly removed from your order book, and any marketplace fees specified at the time of order creation will be nullified. This functionality grants a seamless management of your marketplace, ensuring a streamlined experience for both marketplace operators and users alike.
For further details, you can visit the page: https://docs.nftgo.io/docs/create-an-nft-marketplace-with-aggregated-order-books#9-cancelling-listings--offers-with-your-nft-marketplace
Congratulations!
Now you have created your own NFT marketplace with full capabilities. Start trading NFTs on your marketplace and enjoy the NFT journey!