KyberSwap Docs
  • Introduction to KyberSwap
  • Getting Started
    • Quickstart
      • FAQ
    • Supported Exchanges And Networks
    • Foundational Topics
      • Decentralized Finance
        • Tokens
        • Stablecoins
        • DEX/DeFi Aggregator
        • Slippage
        • Price Impact
        • Zap
        • Maximal Extractable Value (MEV)
      • Decentralized Technologies
        • Wallets
        • Dapps
        • RPC
        • Oracles
        • On-Chain vs Off-Chain Data
      • Other Valuable Resources
  • KyberSwap Solutions
    • KyberSwap Interface
      • User Guides
        • Connect Your Wallet
        • Switching Networks
        • Instantly Swap At Superior Rates
        • Swap At Your Preferred Rates
        • Cross-chain Swap
        • Add Your Favourite Tokens
        • Get Crypto With Fiat
        • Bridge Your Assets Across Multiple Chains
      • Profiles
        • Profile Creation
        • Profile Customization
        • Sync Profile Across Devices
      • Notifications
        • Notification Center
    • KyberSwap Aggregator
      • Concepts
        • Dynamic Trade Routing
      • User Guides
        • Instantly Swap At Superior Rates
      • Developer Guides
        • Execute A Swap With The Aggregator API
        • Upgrading To APIv1
      • Aggregator API Specification
        • EVM Swaps
        • Permit
      • Contracts
        • Aggregator Contract Addresses
      • DEX IDs
      • Subgraphs
      • FAQ
    • KyberSwap Zap as a Service
      • KyberSwap Zap as a Service (ZaaS) API
        • ZaaS HTTP API
        • ZaaS GRPC API
      • KyberSwap Zap Liquidity Widget
      • Zap Fee Model
      • Zap's Supported Chains/Dexes
      • Zap's Deployed Contract Addresses
      • Zap's DEX IDs
    • KyberSwap Widget
      • Developer Guides
        • Integrating The KyberSwap Widget
        • Customizing The KyberSwap Widget
      • iFrame Alternative
      • Widget/iFrame Fee
    • KyberSwap Liquidity Widget
      • Integrating The KyberSwap Liquidity Widget
    • Limit Order
      • Concepts
        • Off-Chain Relay, On-Chain Settlement
        • Gasless Cancellation
      • User Guides
        • Swap At Your Preferred Rates
        • Update Limit Orders
        • Cancel Limit Orders
      • Developer Guides
        • Create Limit Order
        • Gasless Cancel
        • Hard Cancel
        • Fill Limit Order
      • Contracts
        • Limit Order Contract Addresses
      • Limit Order API Specification
        • General APIs
        • Maker APIs
        • Taker APIs
      • FAQ
    • KyberSwap OnChain Price Service
    • Fee Schedule
  • Governance
    • KyberDAO
      • User Guides
        • Participating in KyberDAO
        • Staking
        • Voting
        • Stake KNC And Enjoy Gas Savings
      • Fees to KyberDAO
      • KyberDAO Operator MultiSig
      • Contracts
        • KyberDAO Contract Repo
        • KyberDAO Contract Addresses
      • FAQ - Others
    • KNC Token
      • KNC Tokenomics & Utility
      • Gas Refund Program
      • KNC Contract Addresses
  • Security
    • Audits
  • Reference
    • Legacy
      • KyberSwap Classic
        • Concepts
          • Programmable Pricing Curves
          • Dynamic Auto-Adjusting Fees
          • Virtual Balances
          • Protocol Fees
        • Contracts
          • Classic Contract Repo
          • Classic Contract Addresses
          • Classic Contract Farming Addresses
      • KyberSwap Elastic
        • Concepts
          • Concentrated Liquidity
          • Reinvestment Curve
          • Tick-Range Mechanism
          • Pool Process Flows
          • Anti-Sniping Mechanism
          • Tick-Based Farming
          • Elastic Zap
          • TWAP Oracle
          • Elastic APR Calculations
        • Contracts
          • Elastic Contract Repo
          • Elastic Contract Addresses
          • Elastic Farming Contract Addresses
          • Elastic Zap Contract Addresses
          • Elastic Core Contracts
          • Elastic Core Libraries
          • Elastic Periphery Core Contracts
          • Elastic Peripheral Library Contracts
          • Elastic Peripheral Base Contracts
        • Subgraphs
      • Whitepapers
      • Audits
      • KyberAI
        • KyberScore
        • Concepts
        • On-Chain Indicators
          • Number Of Trades
          • Trading Volume
          • Netflow To Whale Wallets
          • Netflow To CEX
          • Number Of Transfers
          • Volume Of Transfers
          • Number Of Holders
          • Top Holders
        • Technical Indicators
          • Live Charts
          • Support & Resistance Levels
          • Live Trades
          • Funding Rate On CEX
          • Liquidations On CEX
        • Liquidity Analysis
      • Elastic Legacy
        • Elastic Legacy Contract Repo
        • Elastic Legacy Contract Addresses
        • Elastic Legacy Farming Contract Addresses
        • Remove Elastic Legacy Liquidity
      • Protocol
        • Overview
        • Smart Contract Architecture
        • Trust and Security Model
      • Integrations
        • Getting Started
        • Use Cases
        • Integration Types
        • Smart Contracts
        • Ethers JS
        • RESTful API
        • Slippage Rate Protection
        • Price Feed Security
        • Contract Events
        • Platform Fees
      • Reserves
        • Getting Started
          • Overview
          • Why Develop On Kyber
          • Create New Reserve
          • Existing Reserves
          • Customising Existing Reserves
        • Development Guides
          • Fed Price Reserve
          • Automated Price Reserve
          • Reserves with Ganache
          • Orderbook Reserve
        • Operations
          • Listing Policies
          • Reserve IDs
          • Reserve Rebates
          • Sanity Rates
      • Addresses
        • Introduction
        • Mainnet
        • Kovan
        • Rinkeby
        • Ropsten
      • API/ABI
        • Introduction
        • RESTful API
          • RESTful API Overview
          • RESTful API
        • Core Smart Contracts
          • IKyberNetworkProxy
          • KyberNetworkProxy
          • IKyberNetwork
          • ISimpleKyberProxy
          • IKyberMatchingEngine
          • KyberMatchingEngine
          • IKyberHint
          • KyberHintHandler
          • IKyberHintHandler
          • IKyberFeeHandler
          • IKyberStaking
          • KyberStaking
          • IKyberDao
          • KyberDao
          • IKyberStorage
          • KyberStorage
          • IKyberHistory
          • KyberHistory
          • IKyberReserve
          • KyberReserve
          • ConversionRates
          • LiquidityConversionRates
          • EpochUtils
          • IEpochUtils
          • KyberFeeHandler
        • Contract ABIs
          • ABIs
        • Code Snippets
          • Token Quantity Conversion
        • Misc Contracts
          • KyberNetwork
          • ConversionRatesInterface
          • PermissionGroups
          • SanityRates
          • Withdrawable
          • OrderbookReserveInterface
          • OrderbookReserveLister
    • KyberSwap Operator MultiSig
    • Permitable Tokens
    • Third-Party Integrations
    • KyberSwap Analytics
    • KyberSwap App
    • GitHub
    • KyberSwap Analytics
    • KyberSwap Blog
    • Kyber Network Press Kit
  • Socials
    • X
    • Discord
    • Telegram
    • LinkedIn
    • Reddit
    • Instagram
    • Tik Tok
  • Support
    • KyberSwap Help Center
    • Complaints Handling Process
Powered by GitBook
On this page
  • Overview
  • Decentralized Limit Orders
  • Hard Cancel
  • Gasless Cancel
  • Choose your trading journey

Was this helpful?

  1. KyberSwap Solutions
  2. Limit Order
  3. Concepts

Gasless Cancellation

Decentralized Trading Without The Gas Fees

PreviousOff-Chain Relay, On-Chain SettlementNextUser Guides

Last updated 2 months ago

Was this helpful?

Overview

In an effort to provide the same fee-less experience which traders are used to with CEX limit orders, KyberSwap Limit Order has been enhanced with gasless cancellation functionality:

  • Gasless Cancel: Cancel your limit order without incurring gas fees. Upon triggering gasless cancel, users might need to wait up to 90 seconds for the cancellation to be confirmed.

  • Hard Cancel: Instantly cancel your limit order by incurring a small prioritization gas fee. Upon triggering hard cancel, users will need to confirm the gas fee whereupon cancellation is confirmed once the transaction has been mined.

With gasless cancellation, traders can now create, modify, and cancel limit orders without ever incurring gas fees with KyberSwap Limit Orders.

Decentralized Limit Orders

KyberSwap Limit Orders adopts a hybrid off-chain matching and on-chain settlement model as described . While this design ensures that such limit orders can continue to be open and permissionless, one of the key tradeoffs is that the limit order protocol does not have control over the ordering of transactions.

The KyberSwap Limit Order protocol is only able to define the trade logic with transaction ordering being determined by the underlying chain. Once a limit order is created, the signed maker transaction is distributed to our network of off-chain takers.

Hard Cancel

As all potential takers now have a copy of the maker transaction, the only way to guarantee cancellation is to send a cancellation transaction to the chain before an order is filled. Consequently, if any of the takers match and execute the maker transaction on-chain, the limit order will fail.

The first-come, first-serve approach above describes the Hard Cancel option whereby makers with an open limit order pay a gas fee to ensure that their order is immediately nullified on-chain. This gas fee essentially incentivizes miners to prioritize the cancellation transaction over any taker order which has a lower gas fee. As such, cancellation is confirmed once the Hard Cancel order has been included into a mined block.

Gasless Cancel

While the Hard Cancel mechanism above practically guarantees cancellation, the transaction costs accrued can quickly accumulate especially for traders who constantly make adjustments to their limit orders. In addition, the cost of a single cancellation on chains such as Ethereum Mainnet (ChainID: 1) can be prohibitively expensive especially when order sizes are small or if a wrong parameter was entered. To address these issues, a Gasless Cancel option was introduced.

In contrast to the Hard Cancel option which cancels orders on-chain, the Gasless Cancel option cancels the order off-chain by introducing an operator timed signature requirement. For a limit order to be valid, it must be signed by both the maker and a KyberSwap Operator, each with their own signature validity period:

  • Maker signature: Defines the expiry for the LO. This is set by the Maker at the point of LO creation. Maker order is automatically expired after this date.

As a result of the aforementioned design, maker limit orders will have a maximum 90 seconds validity period upon which another Operator signature is required. Consequently, maker's have the option to instruct the KyberSwap Operator not to renew their signature by submitting a Gasless Cancel order prior to the next Operator signature (i.e. when the maker order is requested in a quote).

This means that, in the majority of cases, makers are able to gaslessly cancel their transactions immediately unless their maker order was previously included in a quote. In the latter case, there is a maximum 90 seconds waiting period for the limit order to be cancelled off-chain.

Choose your trading journey

KyberSwap Limit Order makers now have the option to cancel their orders depending on their specific trading requirements. For makers where gas costs are a top priority, the Gasless Cancel option enables limit order to be cancelled as long as they are willing to wait up till a maximum of 90 seconds for cancellation. For makers who prioritize instant cancellation, the Hard Cancel option enables their orders to be cancelled immediately for a small fee.

Operator signature: Valid for 60-90 seconds and is only created when an operator unsigned maker order is included in a quote (via or APIs).

here
LO Taker
Aggregator