Maker order

Bend exchange is built on a hybrid system (off-chain/on-chain), which incorporates off-chain signatures (these are called Maker Orders) and on-chain orders (called Taker Orders). This design is similar to other NFT marketplaces (e.g., OpenSea, Rarible) running on the Ethereum blockchain.

However, unlike some of these platforms, BendDAO uses exclusively EIP-712 signatures, which provide key benefits for users such as greater readability for humans in the message they sign.

A maker order is a passive order, which can be executed (if not cancelled!) against a taker order after it is signed. Since the execution of a maker order is done once a taker order matches on-chain, network gas fees are never paid by the maker user.

Signatures for the Bend exchange all contain a set of parameters that are defined in a Solidity struct named MakerOrder.

The MakerOrder struct contains 13 distinct parameters and 3 signature parameters:

  • isOrderAsk — Whether the order is an ask (sending a passive order to sell a NFT) or a bid (sending a passive order to buy an NFT).

  • signer — The address of the signer of the maker order.

  • collection — The specific collection address.

  • price — The price of the order. The price is expressed in BigNumber based on the number of decimals of the “currency”. For Dutch auction, it is the minimum price at the end of the auction.

  • tokenId — The id of the token for the order, For collection orders, this field is not used in the execution and set it at 0.

  • amount — The amount of tokens transferred. It is only used for ERC-1155 tokens (e.g., “2 items for a given tokenId”). For ERC-721 tokens, it is set at 1.

  • strategy — The execution strategy address for the trade execution for this order.

  • currency — The currency address for this order.

  • nonce — The order nonce of the sender.

  • startTime — The start time for the order (in epoch format).

  • endTime — The end time for the order (in epoch format).

  • minPercentageToAsk — The minimum percentage required to be transferred to the ask or the trade is rejected (e.g., 8500 = 85% of the trade price).

  • params — Can contain additional parameters that are not used for standard orders (e.g., maximum price for a Dutch auction, recipient address for a private sale, or a Merkle root... for future advanced order types!). If it doesn't, it is displayed "0x"

  • interceptor

    This field is only avaiable for ask order and used to execute specific logic before transferring the collection, For BNFT, it is used to repay the debt and redeeming the original NFT.

  • interceptorExtra

    Additional parameters when executing interceptor.

  • v, r, and s — Cryptographic parameters generated by the web3 provider. These parameters are used to verify cryptographically that the signer address did sign the order.

isOrderAsk

Like most exchange marketplaces & protocols (including non-NFT marketplaces), an order can be of two distinct types: Ask or Bid.

In the exchange protocol, Ask means the user is selling a NFT whereas Bid means the user is buying a NFT (with a fungible currency like WETH).

signer

The address signing the message.

collection

The address of the collection to trade.

price

The price for the order. It is a uint256 value, which doesn't contain any decimal. Ethereum does not support float numbers. Price must be displayed as a number in "BigNumber" formatting.

Converters can be useful to convert WETH (or other assets with 18 decimals) to wei.

Never sign a message with a price displayed as "10" if you are looking to sell an item for 10 WETH, you would end up selling your item for 100 wei!

tokenId

The tokenId, part of the collection, that the signer is looking to purchase/sell.

For collection orders, this field is not used in the execution and set it at 0.

amount

The amount of tokens to transfer for the tokenId. While this is currently only relevant for ERC-1155 tokens (e.g., “2 items for a given tokenId”), for ERC-721 tokens, it is set at 1.

strategy

The address of the execution strategy to execute the trade. Strategies can only be valid in the Bend exchange if they are whitelisted by the ExecutionManager contract. If the execution strategy is not whitelisted, the trade cannot occur (it reverts).

currency

The address of the currency to execute the trade. Currencies can only be valid in the Bend exchange if they are whitelisted by the CurrencyManager contract. If the currency is not whitelisted, the trade cannot occur (it reverts).

nonce

The nonce represents the user order nonce that is marked on-chain as executed if the trade is matched by a taker order or if the user cancels her order. Two orders can exist off-chain with the same nonce. If one of them is executed, the other is cancelled. Nonces are specific to each distinct signer address. For instance, if Alice signs a maker order with nonce = 3 and Bob also signs a maker order with nonce = 3. If Alice's order is executed against a taker order, Bob's order remains valid.

It is recommended to verify (and write down for a sizeable order) the order nonce when you submit a trade, especially if using a third-party service. This allows you to cancel this trade easily directly by interacting against the contract.

startTime

The startTime represents the epoch timestamp of a maker order from where its execution can be valid.

endTime

The endTime represents the epoch timestamp of a maker order from where its execution stops being valid.

minPercentageToAsk

The minPercentageToAsk protects ask users from potential unexpected changes in royalty fees. It acts as a protection that the trade would revert if a specific percentage of the platform gross price does not go to the ask users when the trade is executed on-chain.

For instance, if Alice signs an order for her collection with minPercentageToAsk = 8500. If the protocol fee for the strategy is 2% and the royalty fee is updated to 16%, the trade would not be executable on-chain since 18% > 15%.

params

This field is used for additional parameters specific to complex orders that are less frequent (e.g., private sale, Dutch auctions, and more complex order types). The set of additional parameters is represented as bytes, where parameters are concatenated.

interceptor

This field is only avaiable for ask order and used to execute specific logic before transferring the collection, For BNFT, it is used to repay the debt and redeeming the original NFT.

interceptorExtra

Additional parameters when executing interceptor.

cryptographic parameters (v, r, and s)

Ethereum uses ECDSA signatures. These signatures consist of two numbers (integers): r and s with the addition of a v parameters ("recovery identifier") variable, which is always equal to 27 or 28.

For more details, please visit this website to read more about digital signatures.

Last updated