Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Relayer strategy

Đang mở
#7 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

@posgnu đang làm issue này rồi.

Từ ngày 7/12/2018.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

Matcher :m:

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.

Ngôn ngữ chính
TypeScript
Star
17
Fork
4
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của CodeChain-io/codechain-exchange

Tất cả issue của CodeChain-io/codechain-exchange

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.