Relayer strategy
@posgnu ya está trabajando en esto.
Desde el 7/12/2018.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 17
- Forks
- 4
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CodeChain-io/codechain-exchange
-
I cannot run tests Abiertohelp wanted test
Dificultad 2/5 1-3 horas Aptitud para principiantes 30/100
CodeChain-io/codechain-exchange#28 · 3 comentarios ·
-
design
Dificultad 5/5 Más de una semana Aptitud para principiantes 15/100
-
design
Dificultad 5/5 Más de una semana Aptitud para principiantes 10/100
-
layout- responsive web Abiertodesign
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
-
Matcher :m: orderwatcher :eyes:
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
CodeChain-io/codechain-exchange#13 · 1 comentario ·
Todos los issues de CodeChain-io/codechain-exchange
Issues similares
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Crush Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
ElementsProject/cln-application#167 · 1 comentario · 1 reacción ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Quantco/pnpm-licenses#17 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100