Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Antoine/test new landing page #193

Merged
merged 39 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6c78533
remove Kandel infobox + draft Kandel param. recommendation
frkralj Sep 4, 2023
2534bfd
Return definition + guide typo
frkralj Sep 13, 2023
c82295d
test mangrove sidebar and colors
frkralj Sep 25, 2023
d7bf046
test mangrove sidebar and colors
frkralj Sep 25, 2023
e3d94ad
bug fix homepage
frkralj Sep 25, 2023
f292837
more tweaks
frkralj Sep 26, 2023
3a07094
editing menu
frkralj Sep 26, 2023
9f9ee92
Adding /developers slug
frkralj Sep 27, 2023
16eab57
Removing /developers slug since it breaks all links
frkralj Sep 27, 2023
960f67d
modifying sidebar for FAQ and Glossary pages
frkralj Sep 29, 2023
af81cac
adding a developers.md landing page for the Dev section
frkralj Sep 29, 2023
ca7fb55
adding /general and /developers slugs
frkralj Sep 29, 2023
eef0107
correcting broken link
frkralj Sep 29, 2023
a143d41
correcting broken links again
frkralj Sep 29, 2023
9c0ac44
updates
dontrolle Oct 12, 2023
6892c30
restructure developers into folder
dontrolle Oct 13, 2023
2b52242
fix broken links and move glossary
dontrolle Oct 13, 2023
7cae8d0
typo
dontrolle Oct 13, 2023
fbfa464
fix sidebars link
dontrolle Oct 13, 2023
06817ae
temp remove developers/README link
dontrolle Oct 13, 2023
7a6a476
fix links
dontrolle Oct 13, 2023
d176ce9
term links
dontrolle Oct 13, 2023
f5d1be9
Glossary file moved
dontrolle Oct 13, 2023
4f432ee
Developers links
dontrolle Oct 13, 2023
5687853
terms sidebar
dontrolle Oct 13, 2023
a11e7dd
link fix
dontrolle Oct 13, 2023
6a3ca85
fix link
dontrolle Oct 13, 2023
4a79d7b
Removing some Kandel file + adding color changes to info bubbles
frkralj Oct 13, 2023
f13ee6b
Merge branch 'antoine/test-new-landing-page' of https://github.com/ma…
frkralj Oct 13, 2023
2ed92fb
adding /general folder + other tweaks
frkralj Oct 16, 2023
9ce4b09
adding new home page + table of content
frkralj Oct 16, 2023
36bd9af
fixing link
frkralj Oct 16, 2023
90ceaa6
adding justified text on home page
frkralj Oct 16, 2023
b90500c
adding Kandel parameters + home page + dev page modif
frkralj Oct 16, 2023
dc24b03
fix buttons home page
frkralj Oct 16, 2023
5b60e18
fix buttons home page
frkralj Oct 16, 2023
a8bb982
test color change light mode
frkralj Oct 16, 2023
3e26605
test color 2
frkralj Oct 16, 2023
d591dec
tweaks FAQ light mode
frkralj Oct 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
115 changes: 115 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
---
title: General
sidebar_position: 0
---

# Overview

<div class="text--justify">

Mangrove is an on-chain order book DEX that allows liquidity providers to post arbitrary smart contracts as offers.

</div>


import useBaseUrl from '@docusaurus/useBaseUrl';

<img src={useBaseUrl('img/assets/home_page.png')} width="100%"/>

## Total control over your offers

<div class="text--justify">

Mangrove's order book-based DEX [lists promises instead of locked commitments](./general/high-level/concepts/makers-takers-keepers/README.md). Liquidity can be shared, borrowed, lent somewhere and at the same time displayed on Mangrove, ready to be sourced when (and only when) an offer is taken.

</div>


## Smart offers

<div class="text--justify">

Smart contracts [can be attached to offers](./general/high-level/concepts/smart-offers.md), which gives the Maker total freedom in setting his sourcing trade parameters.

</div>

#### Powerful applications of smart offers

<div class="text--justify">

* [**Reactive liquidity:**](./developers/terms/reactive-liquidity.md) liquidity on offer is not locked on the Mangrove order book. As long as an offer posted on Mangrove is not taken, it can generate yield elsewhere on the chain.

* [**Last look:**](./developers/terms/last-look.md) smart offers allow you to code defensive mechanisms that adjust for market condition changes between offer posting and execution.

* [**Bounty:**](./general/high-level/concepts/bounty.md) every single failed offer is compensated with a bounty,; Keeper bots can make money, and Takers don't lose any.

* **<font color="#47d77d">Permissionless:</font>** everyone can interact with the core protocol without having to ask permission nor risking to be censored.

* **<font color="#47d77d">Non-custodial:</font>** Mangrove users retain full control over their funds - the exchange does not hold custody of their assets.

</div>

<div>
<a class="button button--primary" href="../developers/strat-lib/getting-started/smart-offer">Post a smart offer</a>
</div>

## Deploy your own composable strategy

<div class="text--justify">

Mangrove enables liquidity providers to incorporate defensive code, post unprovisioned offers, and redisplay liquidity after their offers are taken.
</div>


#### Full control over your strategy parameters

<div class="text--justify">

* [**Amplified liquidity:**](./developers/terms/amplified-liquidity.md) optimize your trading potential by leveraging your liquidity across multiple pairs. For instance, you can create offers on WETH/USDC, WMATIC/USDC and WBTC/USDC pairs with an equal amount of USDC liquidity.

* [**Multi-liquidity sourcing:**](./developers/terms/reactive-liquidity.md) your smart offer on Mangrove can take advantage of liquidity sourcing from other sources and offering it to the taker, allowing for profitable arbitrage opportunities.

* [**Run AMMs strategies:**](./developers/strat-lib/README.md) provide liquidity on Mangrove’s order book in order to maximize your liquidity potential.

</div>

<div>
<a class="button button--primary" href="./developers/strat-lib">Create your strategy</a>
</div>

## Kandel strategy

<div class="text--justify">


[Kandel](./general/kandel/README.md) is an on-chain Automated Market Making strategy that focuses on order flow rather than price. It automatically posts Bids and Asks within your chosen market and price range to buy low and sell high, making a profit through the spread.

</div>

#### Features

<div class="text--justify">

* **<font color="#47d77d">On-chain market making bot</font>** Kandel is a market-making bot equivalent that operates solely on the blockchain. Unlike off-chain market making bots that experience delays, Kandel uses on-chain order flow to repost offers instantly, without any latency.

* **<font color="#47d77d">Profit from the spread:</font>** Kandel follows your configuration parameters to populate Bids and Asks offers. When those are taken, the profits are generated from the difference between the two, known as the spread.”

* **<font color="#47d77d">Compounding:</font>** you have the opportunity to accumulate profits generated from spreads and reinvest them back into your offers, a process commonly known as compounding. On Kandel strategy, you can set the compounding rate.

* **<font color="#47d77d">Price range:</font>** since Kandel is an automated market-making strategy, the price range needs to be set. It consists of the lowest and highest prices in the price grid at which the market maker is willing to post its bids and asks on Mangrove DEX.

* **<font color="#47d77d">Earn extra yield on AAVE:</font>** since the liquidity on offer is not locked on the Mangrove order book, it can generate yield elsewhere on the chain. With Kandel, when an offer is taken, your liquidity can be sourced and redeposited on AAVE.

</div>

<div>
<a class="button button--primary" href="./general/kandel">Deploy your Kandel</a>
</div>

## Mangrove is a secure protocol

<div class="text--justify">

Mangrove is an open-source protocol that has been rigorously [audited](./general/high-level/audits.md) by the highly reputable and expert firm, ChainSec, ensuring the utmost security and reliability.

</div>
17 changes: 17 additions & 0 deletions docs/developers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Developers
sidebar_position: 1
---

# Welcome to the Developers doc

The purpose of the Mangrove Developers doc is to:

* learn about Mangrove [core protocol](./contracts/README.md),
* understand how trading [strategies](./strat-lib/README.md) can be created and plugged in,
* use and integrate our [SDK](./SDK/README.md),
* set up [Keeper and Cleaning bots](./keeper-bots/README.md).


We suggest you start by reading [this introduction](./contracts/README.md).
If there's anything that is missing, or if you have questions, feel free to reach out to us via [Discord](https://discord.gg/rk9Qthz5YE).
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Background",
"position": 5,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Getting Started",
"position": 2,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_position: 2

# Deploy Kandel strategy

This tutorial covers how to deploy a Kandel strategy from a developer standpoint. For more information about Kandel, see the [Kandel documentation](../../kandel/README.md).
This tutorial covers how to deploy a Kandel strategy from a developer standpoint. For more information about Kandel, see the [Kandel documentation](../../../general/kandel/README.md).

## Prerequisites

Expand Down Expand Up @@ -44,12 +44,12 @@ Next, create an instance to manage Kandel strategies (`kandelStrategies`), and l
https://github.com/mangrovedao/mangrove.js/blob/2753b3148231a2541d0055a77a169f8f1381dcd1/examples/tutorials/deploy-kandel.js#L21-L25
```

With this, you can generate a [distribution](../../kandel/how-does-kandel-work/step-by-step-visual-explanation.md#price-distribution) with the minimum recommended amount of liquidity to avoid %%density|density%% issues by:
With this, you can generate a [distribution](../../../general/kandel/how-does-kandel-work/step-by-step-visual-explanation.md#price-distribution) with the minimum recommended amount of liquidity to avoid %%density|density%% issues by:
* Creating a generator
* Calculating minimums per offer
* Calculating the distribution for the given price parameters of `minPrice: 900`, `maxPrice: 1100`, and default ratio

See the API documentation for [calculateMinimumDistribution](../technical-references/code/classes/KandelDistributionGenerator.md#calculateminimumdistribution) for more details on other `priceParams`. In our example here, `midPrice: 1100` is used to set the [current price](../../kandel/how-does-kandel-work/parameters.md), and decide which offers become bids and which become asks.
See the API documentation for [calculateMinimumDistribution](../technical-references/code/classes/KandelDistributionGenerator.md#calculateminimumdistribution) for more details on other `priceParams`. In our example here, `midPrice: 1100` is used to set the [current price](../../../general/kandel/how-does-kandel-work/parameters.md), and decide which offers become bids and which become asks.

```javascript reference
https://github.com/mangrovedao/mangrove.js/blob/2753b3148231a2541d0055a77a169f8f1381dcd1/examples/tutorials/deploy-kandel.js#L27-L58
Expand Down Expand Up @@ -87,10 +87,10 @@ https://github.com/mangrovedao/mangrove.js/blob/2753b3148231a2541d0055a77a169f8f
A brief explanation on the above `seed` parameters:
* `onAave` indicates whether or not the liquidity to be used by Kandel is sitting on AAVE - here, it is not the case (it will be fetched from a wallet)
* `market`: this is the WETH/USDC pair that we previously chose
* `liquiditySharing` indicates whether you are using shared liquidity or not (SDK only, not available via the UI). This refers to the concept [amplified liquidity](../../terms/amplified-liquidity.md).
* `liquiditySharing` indicates whether you are using shared liquidity or not (SDK only, not available via the UI). This refers to the concept [amplified liquidity](/docs/developers/terms/amplified-liquidity.md).
* `gaspriceFactor`:
* By using the `recommendedConfig.gaspriceFactor`, we make sure to select the right amount of gas for our Kandel strategy
* This is also connected to the amount of [bounty](../../terms/bounty.md) to be paid in case of a failure to deliver
* This is also connected to the amount of [bounty](/docs/developers/terms/bounty.md) to be paid in case of a failure to deliver


### Approve transfers
Expand All @@ -103,7 +103,7 @@ https://github.com/mangrovedao/mangrove.js/blob/2753b3148231a2541d0055a77a169f8f

### Populate offers for the distribution

Now that our Kandel instance is deployed, we can [populate the offers](../../kandel/how-does-kandel-work/step-by-step-visual-explanation.md#populating-bids-and-asks) for the distribution.
Now that our Kandel instance is deployed, we can [populate the offers](../../../general/kandel/how-does-kandel-work/step-by-step-visual-explanation.md#populating-bids-and-asks) for the distribution.
This will create offers for the base and quote tokens, and deposit the required amounts of tokens into the Kandel instance.

The offers also need a %%provision|provision%%, hence here the default that we are using can be inspected.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Guides",
"position": 3,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Technical Reference",
"position": 4,
"collapsed": false
"collapsed": true
}
15 changes: 6 additions & 9 deletions docs/contracts/README.md → docs/developers/contracts/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
---
description: The Mangrove DEX is an on-chain, order book-based exchange where offers are code.
title: Introduction
sidebar_position: 1
---


# Introduction

The Mangrove is an [EVM-compatible](https://ethereum.org/en/developers/docs/scaling/sidechains/#evm-compatibility) order book-based exchange protocol (a [DEX](https://ethereum.org/en/defi/)), in which offers can be bound to a [smart contract](https://ethereum.org/en/smart-contracts/).

The order book of Mangrove lists promises to trade, instead of locked commitments.

* Offer makers add [liquidity promises](./background/offer-maker.md) to Mangrove. They own offers in %%offer lists|offer-list%% and manage contracts that react to [offer execution](technical-references/taking-and-making-offers/reactive-offer/executing-offers.md).
* Takers go to Mangrove to [find liquidity](background/offer-taker.md) by executing offers already in Mangrove.
* [Governance](technical-references/governance-parameters/README.md) adjusts Mangrove parameters, sets fees, and opens and closes new markets.
* Offer makers add [liquidity promises](./background/offer-maker.md) to Mangrove. They own offers in %%offer lists|offer-list%% and manage contracts that react to [offer execution](./technical-references/taking-and-making-offers/reactive-offer/executing-offers.md).
* Takers go to Mangrove to [find liquidity](./background/offer-maker.md) by executing offers already in Mangrove.
* [Governance](./technical-references/governance-parameters/README.md) adjusts Mangrove parameters, sets fees, and opens and closes new markets.

> 💡
> For non technical information about Mangrove, check out the [Concepts](../high-level/README.md) section.
> For non technical information about Mangrove, check out the [Concepts](../) section.
## Where do I start?

A good entry-point to the developer documentation for Mangrove protocol is the [Overview of Mangrove](./technical-references/overview.md) in the Technical Reference section.

## Where can I join the community?

The Mangrove project is open source. Follow and contribute on [GitHub](https://github.com/mangrovedao/), and join the [Mangrove Discord](https://discord.gg/rk9Qthz5YE).


The Mangrove project is open source. Follow and contribute on [GitHub](https://github.com/mangrovedao/), and join the [Mangrove Discord](https://discord.gg/rk9Qthz5YE).
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Background",
"position": 5,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar_position: 2

An offer on Mangrove usually points to a contract containing the [offer logic](../technical-references/taking-and-making-offers/reactive-offer/maker-contract.md) and specifies what it is ready to deliver and its price. Offer are stored in [offer lists](../technical-references//taking-and-making-offers/offer-list.md).

![When a reactive Offer is matched, the contract implementing its logic is called by Mangrove](../../../static/img/assets/MakerOffer.png)
![When a reactive Offer is matched, the contract implementing its logic is called by Mangrove](/img/assets/MakerOffer.png)

### Creating & Updating offers

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Getting Started",
"position": 2,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Guides",
"position": 3,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Technical Reference",
"position": 4,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sidebar_position: 1

The illustration below depicts a bird's-eye view of the Mangrove ecosystem. The main actors are depicted as well as their most important interactions.

![A bird's-eye view of Mangrove ecosystem.](../../../static/img/assets/contactMap.png)
![A bird's-eye view of Mangrove ecosystem.](/img/assets/contactMap.png)

The Mangrove contract is depicted in the middle, with the three most important actors interacting with Mangrove around it:

Expand Down Expand Up @@ -55,7 +55,7 @@ This allows makers, for instance, to post another offer to redisplay their liqui

The diagram below summarizes the call sequence induced by a taker order. Notice that first the `makerExecute` functions is executed for all offers, and only subsequently are the `makerPosthook` functions of the offers executed.

![Mangrove call sequence induced by a taker order](../../../static/img/assets/execution.png)
![Mangrove call sequence induced by a taker order](/img/assets/execution.png)

## Where can I read more?

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The `MgvCleaner` contract is provided as part of the periphery contracts. Its pu

It has a single function `collect`, with the same signature as as the function for [sniping offers](../taking-and-making-offers/taker-order/README.md#offer-sniping); please refer to that page for a detailed account of the arguments. In brief, for a given pair `(outbound_tkn, inbound_tkn)`, it takes an array of offers `targets` and expects all offers to fail or not to execute. If an offer did not fail, `MgvCleaner` will revert.

This contract may be deployed and used as part of running your own [cleaner keeper bot](/docs/keeper-bots/getting-started/run-a-simple-cleaning-bot.md).
This contract may be deployed and used as part of running your own [cleaner keeper bot](../../../keeper-bots/getting-started/run-a-simple-cleaning-bot.md).

```solidity
function collect(
Expand Down
2 changes: 1 addition & 1 deletion docs/glossary.md → docs/developers/glossary.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Glossary
sidebar_position: 0
sidebar_position: 1
---

THIS FILE IS AUTOGENERATED
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Background",
"position": 5,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 2

# The role of gas price updater bots in Mangrove

Mangrove needs the gas price to [determine the remuneration](/contracts/technical-references/taking-and-making-offers/reactive-offer/offer-provision.md#bounty) of takers for removing a failing offer from a list. On chains where the gas price varies, Mangrove [uses](/contracts/technical-references/governance-parameters/global-variables) an [oracle](/contracts/technical-references/periphery/oracle) to get the gas price.
Mangrove needs the gas price to [determine the remuneration](../../contracts/technical-references/taking-and-making-offers/reactive-offer/offer-provision.md#bounty) of takers for removing a failing offer from a list. On chains where the gas price varies, Mangrove [uses](../../contracts/technical-references/governance-parameters/global-variables) an [oracle](../../contracts/technical-references/periphery/oracle) to get the gas price.

The role of the gas price updater bot is simply to push up-to-date gas prices to the oracle contract whenever the gas price changes significantly.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Getting Started",
"position": 2,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"label": "Guides",
"position": 3,
"collapsed": false
"collapsed": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sidebar_position: 2

# Using borrowed funds for cleaning via Mangrove's delegation mechanism

Cleaners can use Mangrove's [delegation mechanism](/docs/contracts/technical-references/taking-and-making-offers/taker-order/delegate-takers.md) to borrow funds for cleaning: Mangrove will allow an account to call `snipesFor` on behalf of a taker that has not approved that account, as long as all sniped offers fail. This enables borrowing of funds from any taker that has approved Mangrove for some token.
Cleaners can use Mangrove's [delegation mechanism](../../contracts/technical-references/taking-and-making-offers/taker-order/delegate-takers.md) to borrow funds for cleaning: Mangrove will allow an account to call `snipesFor` on behalf of a taker that has not approved that account, as long as all sniped offers fail. This enables borrowing of funds from any taker that has approved Mangrove for some token.

The Mangrove periphery contract `MgvCleaner` provides a utility method to make this easy: `collectByImpersonation`. The method is identical to the `collect` method except it takes an extra argument, which is the taker to impersonate/borrow funds from.

Expand Down
Loading