Git Product home page Git Product logo

limit-order-protocol's Introduction

1inch Limit Order Protocol Smart Contract

Build Status Coverage Status

Version warning

The master branch contains the latest work-in-progress version of limit orders. It hasn't been audited and may contain severe security issues or may not work at all.

Please, use the commit tagged v2 (here) to get the latest production version that has passed through a series of security audits.

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:

Ethereum mainnet: 0x119c71D3BbAC22029622cbaEc24854d3D32D2828

BSC mainnet: 0x1e38Eff998DF9d3669E32f4ff400031385Bf6362

Polygon mainnet: 0x94Bc2a1C732BcAd7343B25af48385Fe76E08734f

Optimism Mainnet: 0x11431a89893025D2a48dCA4EddC396f8C8117187

Arbitrum One: 0x7F069df72b7A39bCE9806e3AfaF579E54D8CF2b9

Gnosis Chain: 0x54431918cEC22932fCF97E54769F4E00f646690F

Avalanche: 0x0F85A912448279111694F4Ba4F85dC641c54b594

Kovan Testnet: 0xa218543cc21ee9388Fa1E509F950FD127Ca82155

Fantom Opera: 0x11DEE30E710B8d4a8630392781Cc3c0046365d4c

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:

limit-order-protocol's People

Contributors

zumzoom avatar k06a avatar zzomrot avatar sevenswen avatar galekseev avatar typicalbuster avatar pzixel avatar artall64 avatar krboktv avatar shoom3301 avatar pavelkurmacheff avatar tradersnow222 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.