CodeChain-io / CodeChain-io/codechain-exchange

Implement an order watcher deamon

Đang mở
#13 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Matcher :m: orderwatcher :eyes:
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

Mô tả

CODEX order watcher is similar to [0x order watcher](https://0xproject.com/wiki#0x-OrderWatcher)
* The `OrderWatcher` is a daemon. ~~You can start and stop it from subscribing to order state changes, add orders you would like to track and remove orders that are no longer relevant.~~ Just can add order and get an event if the status of the order is changed.
* Once the `OrderWatcher` is started and an order has been added to it, it will emit events once, if there is a change in the state backing an order's fillability. If orderWatcher gets an event than it removes an order from the order book.
* There are two kinds of watchers in the order watcher. One is `invalidWatcher` which check the validity of orders except for expiration time. Another one is `expirationWatcher` which check an expiration time of order. The difference between them is the length of the checking time interval. The `expirationWatcher`'s time interval will be much shorter than the `orderWatcher`.
* The `orderWatcher` will be managed by just list and the `expirationWatcher` will be managed by a min-heap. Therefore the `expirationWatcher` only need to monitor one order, which has a minimum expiration time.

## API
```
// orderWatcher
addOrder(order): void
// expirationWatcher
addOrder(order, expiration): void

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

Đánh giá

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

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.