1inch limit order protocol is a set of smart contracts, that can work on any EVM based blockchains (Ethereum, Binance Smart Chain, Polygon, Arbitrum, Optimism, Gnosis chain, Avalanche). Key features of the protocol is extreme flexibility and high gas efficiency that achieved by using two different order types - regular Limit Order and RFQ Order.
Smart Contract allows users to place limit orders and RFQ Orders, that later could be filled on-chain. Both type of orders is a data structure created off-chain and signed according to EIP-712.
A limit order is a financial instrument with which you can put up an ERC-20 token for sale at a fixed price.
For example, you can put up 2 WBTC tokens for sale at the price of 82415 DAI tokens.
1inch limit orders protocol has many tools for flexible trade management:
- Partial fill
- Single cancellation
- Bunch cancellation
- Fullness check
Note: For market making, there are RFQ orders that have special optimization that does not require a large amount of gas for execution.
- 1inch users can place their limit orders throught the 1inch dApp.
- The signed orders placed by the users can be fetched by anyone using the 1inch Limit Orders Liquidity Source API to execute trades by filling the order on-chain.
- To fill a limit order on-chain, you need to pass the signed order to the
fillOrdermethod on the contract. You can find the latest contract addresses here.
Note: Both the buyer and seller of the assets being traded must approve their assets to be used by the 1inch limit order contract.
- The Pathfinder algorithm uses the limit orders placed via the 1inch
dAppand REST API as a liquidity source, making them available for any 1inch user to fill. This integration ensures that 1inch limit orders are available on the DeFi ecosystem from day one.
Limit orders are highly flexible and can be configured with the following features:
- Order execution predicate: This feature allows you to specify certain conditions to be met before the order can be executed.
- For example, you can set an expiration time based on a certain timestamp or block number.
- You can also construct any predicate you want, such as checking that a certain price is higher than the oracle price, to implement stop loss or take profit strategies.
- Helper function for asset price evaluation.
- Function that will allow to extract assets price from arbitrary on-chain source
- Callback: For notifying the maker of the order execution.
A request for quotation (RFQ) is a business process in which a customer requests a quote from a supplier (market maker) for the purchase of some tokens.
RFQ orders have different use cases, and are dedicated to market makers in the first place. The typical scenario is following: Market maker creates a bunch of RFQ Orders, and exposes it via the API. Trader or the platform algorithm ask for market maker quotes. If the quotes match traders' needs, the trader receives signed RFQ order from the market maker.
Gas optimized order with restricted capabilities suitable for market makers
- Supports expiration time
- Supports cancelation by order id
- RFQ Order could be filled only once
- Partial Fill is possible (once)
- ERC 20
- ERC 721
- ERC 1155
- Other token standards could be supported via external extension