Skip to content

pavelkurmacheff/limit-order-protocol

 
 

Repository files navigation

1inch network

1inch Limit Order Protocol Smart Contract

Build Status Coverage Status

About

You can find general overview and docs on 1inch limit orders protocol here.

This repository contains a smart contract for EVM based blockchains (Ethereum, Binance Smart Chain, etc.), this contract is core part of 1inch limit order protocol.

Contract allows users to place limit orders, that later could be filled on-chain. Limit order itself is a data structure created off-chain and signed according to EIP-712.

Key features of the protocol is extreme flexibility and high gas efficiency that achieved by using following order types.

Limit Order

Extremely flexible limit order, can be configured with:

  1. Order execution predicate.
    • Typical usage is checking that certain time stamp or block number. With this you can set certain expiration time.
    • You can specify construct any predicate that you want, for example check that certain price is higher than oracle price, to implement stop loss or take profit strategies
  2. Helper function for asset price evaluation.
    • Function that will allow to extract assets price from arbitrary on-chain source
  3. Callback, for to notify maker on order execution.

RFQ order

Gas optimized order with restricted capabilities suitable for market makers

  • Support expiration time
  • Support cancellation by order id
  • RFQ Order could be filled only once
  • Partial Fill is possible (once)

Supported tokens

  • ERC 20
  • ERC 721
  • ERC 1155
  • Other token standards could be supported via external extension

Deployments & audits:

You can find 1inch limit order protocol deployments here:

You can find audit reports on etherscan and in the separate audit repository.

Utils library

Plenty of utils that helps create & sign orders are available in our typescript utils library:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 59.4%
  • Solidity 40.6%