Mangrove
Mangrove
Mangrove
  • START HERE
    • What is Mangrove?
      • Smart offers
      • Bounty
      • Makers, Takers, Keepers
        • Makers
        • Takers
        • Keepers
    • Why Mangrove?
    • Who is the Mangrove dApp for?
    • Audits
    • FAQ
    • Glossary
    • Terms & Conditions
  • Strategies
    • Kandel
      • What is Kandel?
      • How does Kandel Work?
        • Step-by-step visual explanation
        • Parameters
        • Choosing Kandel parameters
        • Published Liquidity
        • More on failing offers
      • Potential risks
  • DAPP GUIDE
    • Swap
    • Trade
      • How to make an order
        • Market Order
        • Limit Order
        • Amplified Order
        • More on order types
      • Approvals
      • Minimum Volume
      • How to Track and Manage Orders
    • Earn
    • Rewards
    • Bridge
    • Wrap
  • MGV INCENTIVES
    • Fee Rewards
      • How the programs Work
      • Current programs
    • Vault LP programs
      • How the Programs Work
      • Current programs
      • Earning rewards
      • Example
      • Previous programs
    • MS2 Program (closed)
      • How Rewards Are Calculated
        • Reward Rate ρ
        • Takers Rewards
        • Adjusted Volume for Makers
        • How to Maximize Your Score
      • MGV Token Allocation per User Type
        • Specific Allocation for Kandel users and vault managers
        • Community Contributors
        • Incentives with a custom strategy
      • Epochs and Updates
    • MS1 Program (closed)
      • Intro
      • Trading Points
      • Boost
      • Referral Points
      • Community Points
      • Parameters
      • Technical Insights
      • MS1 FAQ
      • Disclaimer
  • Governance
    • General Governance
      • Key Stakeholders
        • Token Holders
          • Builders
        • Builders
        • Pods
      • Guardians
      • Governance Process
        • Initial Discussions
        • Proposals
        • Voting
        • Execution
    • Councils
      • Responsibilities
      • Elections
      • Budgets
    • Guides and resources
      • How to vote on a governance proposal
      • How to delegate my voting power
      • How to access the Builders’ directory
      • How to access the Pods’ directory
      • Snapshot configuration & membership
      • Links and adresses
  • QUICK LINKS
    • Whitepaper
    • Website
    • Feedback
    • Blog
    • GitHub
    • X
    • Discord
    • Telegram
    • Deployment adresses
Powered by GitBook
On this page
  • Setting things up
  • Populating Bids and Asks
  • Bid is taken
  • Reposting liquidity as an Ask
  • Ask is taken
  • Reposting liquidity as an Bid
  • Another Ask is taken
  • Reposting liquidity as a Bid #2
  1. Strategies
  2. Kandel
  3. How does Kandel Work?

Step-by-step visual explanation

PreviousHow does Kandel Work?NextParameters

Last updated 23 days ago

Setting things up

Before launching your customized Kandel strategy, you will be asked to set specific input parameters. For more information, you can refer to the Parameters description table, as well as the Choosing parameters section.

Based on the selected price range and either the number of offers or ratio, the price grid is constructed using a geometric progression. The min and max prices of the user inputs are the limits of the grid.

The increments are calculated using a key metric called ratio (of the geometric progression). Kandel starts from the min price, all the way up to the max price. By default, the ratio is ~1% (due to ticks it will not be exactly 1%).

Note : In this example, the user selected an ETH/USDC trading pair.

Based on the selected amount of initial liquidity to be deposited, Kandel draws the volume distribution (i.e. the initial volume at each price point). In the example of a uniform volume distribution, the user's liquidity is spread evenly throughout the price grid.

Note : For this explanation, we are conveniently using a 1 ETH allocation for each increment. If based on our parameters, our Kandel would create a price grid of 10 points, for example, then we would use 10 ETH in total (1 ETH * 10 price points).

Populating Bids and Asks

Afterwards, the Kandel strategy contract populates the price grid by posting offers:

  • Bids are posted from min price to mid price (current price)

  • Asks are on the other side of the book, from mid price to max price

Bid is taken

When a bid is taken, the Kandel strategy contract sends the corresponding amount of quote tokens (USDC) and receives a corresponding amount of base tokens (ETH).

Reposting liquidity as an Ask

The received amount of base tokens (ETH) is used to post a dual offer at a step size k=1 above. This is automatically handled by Kandel, it is part of its trading behaviour.

Note : Since the volume objective at the relevant index is 1 ETH, all the received liquidity is used to populate corresponding ask. Our Kandel just received 1 ETH (previous Bid), and is using it all to repost an offer, an Ask (called dual offer).

Ask is taken

Inversely to the bid example, when an ask is taken, the Kandel strategy contract sends the corresponding amount of base tokens (ETH) and receives a corresponding amount of quote tokens (USDC).

Reposting liquidity as an Bid

The received amount of quote tokens (USDC) is used to post a dual offer step size k=1 below.

In our example:

  • We just received 1,300 USDC for sending 1 ETH through our ask

  • Previously, we sent 1,287 USDC and received 1 ETH through our bid

Therefore, 13 USDC is reinvested into the strategy. A new bid at k=1 steps below is reposted, and offers 1,300 USDC for 1.01 ETH.

Calculation

  • Profit = 1,300 USDC - 1,287 USDC = 13 USDC

  • 13 / 1300 = 0.01 = 1%

    • i.e. we made a 1% profit on the spread

  • Kandel will repost our bid to offer 1,287+13 USDC for 1*1.01 ETH, reinvesting the 1% profit we just made

Another Ask is taken

When another ask is taken, once again Kandel sends the corresponding amount of base tokens (ETH) and receives a corresponding amount of quote tokens (USDC).

Reposting liquidity as a Bid #2

Similarly to our previous bid, the received amount of quote tokens (USDC) is used to post a dual offer step size k=1 below.

Note :

If an ask was to be taken next, the profit from the spread would be reinvested into the strategy.