Skip to content

Commit

Permalink
Merge pull request #8 from ergolabs/concurrency-update
Browse files Browse the repository at this point in the history
Concurrency update
  • Loading branch information
oskin1 authored Sep 9, 2021
2 parents 76ffbe6 + 7c5f5f1 commit 851de98
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .bsp/sbt.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"sbt","version":"1.5.2","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/Users/oskin/.sdkman/candidates/java/11.0.8.hs-adpt/bin/java","-Xms100m","-Xmx100m","-classpath","/Users/oskin/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7142.45/IntelliJ IDEA.app.plugins/Scala/launcher/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/Users/oskin/Library/Application%20Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7142.45/IntelliJ%20IDEA.app.plugins/Scala/launcher/sbt-launch.jar"]}
{"name":"sbt","version":"1.5.2","bspVersion":"2.0.0-M5","languages":["scala"],"argv":["/Users/oskin/.sdkman/candidates/java/11.0.8.hs-adpt/bin/java","-Xms100m","-Xmx100m","-classpath","/Users/oskin/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7628.21/IntelliJ IDEA.app.plugins/Scala/launcher/sbt-launch.jar","xsbt.boot.Boot","-bsp","--sbt-launch-jar=/Users/oskin/Library/Application%20Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/211.7628.21/IntelliJ%20IDEA.app.plugins/Scala/launcher/sbt-launch.jar"]}
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,31 @@ While in CFMMs liquidity is uniformly distributed along the reserve curve, which

![CLP](img/CLP.png)

## Off-chain execution

For the sake of efficiency most of the DEX actions are split into two stages: 1. order creation 2. execution. Once an order is submitted to the network it can be executed by off-chain bots. Off-chain bot is a piece of software that tracks orders and makes transactions from them performing all the necessary state transitions. Legitimacy of all transitions is checked on-chian by validation scripts. Off-chain bot can be run by anyone who is willing to support ErgoDEX and earn execution fees.

![OffChainExecution](img/OffChainExec.jpg)

## Tokenomics

In the ErgoDEX each actor is incentivized to fulfill his role as well as possible.

There are four types of economic agents in the ErgoDEX ecosystem:
There are five types of economic agents in the ErgoDEX ecosystem:

* Miners - need to be incentivized in order to process transactions
* DEXes (Parties which run DEX bots and UI) - need to be incentivized in order to provide best services.
* Liquidity providers (LPs) - need to be incentivized in order to provide liquidity.
* Traders
| Type of agent | Goal of incentives |
| ------------------------- | -------------------------- |
| Miners | Process transactions |
| UI providers | Provide better UI |
| Off-chain executors | Execute orders |
| Liquidity providers (LPs) | Provide liquidity |
| Traders | Use DEX |

Each type of agents benefits from using DEX in his own way:

* Miners are earning miner fees paid in ERGs
* DEXes are earning fees paid in ERGs from both OrderBook and AMM services
* Miners are earning miner fees paid in native tokens
* UI providers are earning fees paid in native tokens charged for each operation done via UI
* Off-chain executors are earning fees paid in native tokens from both OrderBook and AMM services
* In AMM: fees are charged for every operation on a liquidity pool
* An amount of native tokens defined by a user for deposit|redeem operations
* An amount of native tokens defined by a user for each unit of quote asset exchanged
Expand Down
11 changes: 6 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ name := "ergo-dex"

version := "0.1"

scalaVersion := "2.12.13"
scalaVersion := "2.13.6"

libraryDependencies ++= Seq(
"org.scalactic" %% "scalactic" % "3.2.9" % "test",
"org.scalatest" %% "scalatest" % "3.2.9" % "test",
"org.scalatestplus" %% "scalacheck-1-15" % "3.2.9.0" % "test",
"org.scalacheck" %% "scalacheck" % "1.15.4" % "test"
"org.scalactic" %% "scalactic" % "3.2.9" % Test,
"org.scalatest" %% "scalatest" % "3.2.9" % Test,
"org.scalatestplus" %% "scalacheck-1-15" % "3.2.9.0" % Test,
"org.scalacheck" %% "scalacheck" % "1.15.4" % Test,
"org.typelevel" %% "cats-effect" % "3.2.8" % Test
)
Binary file added img/OffChainExec.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 851de98

Please sign in to comment.