Relayer strategy
@posgnu がすでに取り組んでいます。
2018年12月7日 から。
評価
この issue はまだ評価されていません。
説明
Strategy:
As a client submit its order, the relayer checks if there is a matching order stored in the order book. Before this, the relayer also checks if the order conforms with fee policy regulated by the DEX. Only the relayer can fill the orders so that there is no primary race condition from the matching process. The relayer also knows when orders are matched before anyone else and can update the order book as soon as the transaction is submitted.
Rest API
submit(inputs: assetTransferInput[], order: Order, marketId: number, makerAddress: string)
Check if the transaction is valid
Before relaying transactions, they have to be checked validity. First, the DEX have to verify that the transaction 's unlock script is valid. It means that the transaction has to provide a correct signature over order. After the validity checking is finished, the transaction will be relayed on the DEX so that other clients can fill the transaction.
Matching
When the transaction arrives at the DEX, there may or may not be combinable orders. If there are not, the transaction will directly go into the order book as order. The case becomes more complicated if there are orders which are combinable with the incoming transaction. It can be divided into three situations.
- There is an order which has exactly the same rate and amount with the incoming transaction - In this case, the order is filled and transmitted to a Codechain node
- There is an order which has the same rate but less amount than an incoming transaction - Fill the order and relay the remainder.
- There is an order which has the same rate but more amount than an incoming transaction - Do the partial fill
Matching priority
First In, Frist Match rule
Sync
All of the operations with DB have to be atomic. In addition, the matching processes have to be synchronized since matching only occurs in the DEX.
- 主要言語
- TypeScript
- スター
- 17
- フォーク
- 4
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeChain-io/codechain-exchange のほかの issue
-
I cannot run tests オープンhelp wanted test
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
CodeChain-io/codechain-exchange#28 · コメント 3 件 ·
-
design
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
-
design
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
-
design
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
Matcher :m: orderwatcher :eyes:
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
CodeChain-io/codechain-exchange#13 · コメント 1 件 ·
CodeChain-io/codechain-exchange の issue をすべて見る
似ている issue
-
blocklist removal
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
MetaMask/eth-phishing-detect#296544 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
pastelsky/bundlephobia#1122 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100