- Notifications
You must be signed in to change notification settings - Fork113
A peer-to-peer network for sharing 0x orders
License
0xProject/0x-mesh
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
This repository is no longer being maintained. 0x Labs isn’t keeping it aligned with future 0x protocol versions, nor is updating its dependencies with other blockchain protocols. We welcome other team’s contributions to do that if they find value in it.If you’re looking to integrate orderbook-like capabilities in your application, we encourage you to try0x API /orderbook service instead
We intend to keep 0x-mesh bootstrap nodes up for the foreseeable future, however you can always set up your ownmesh-bootstrap nodes and configure the 0x-mesh nodes via theBOOTSTRAP_LIST
environment variable.
0x Mesh is a peer-to-peer network for sharing orders that adhere to the0x order message format.
We have reached the point where Mesh is being used by some teams in production. We feel that for many use cases, Mesh is stable enough for production. However, we caution that there are some issues and shortcomings in its current state, which generally fall into two categories:
- Order sharing: We have recently made significant improvements to our order sharing algorithm, including reducing bandwidth usage and CPU usage by at least an order of magnitude on average. See#692 and#732. However, we are still working on accurately testing and measuring the speed at which orders propagate through the network with different network sizes and topologies. In some circumstances, it may take longer than we would like for orders to reach the majority of nodes in the network. This is an area we will continue to focus on and improve.
- Browser usage: Mesh can run directly in the browser via the@0x/mesh-browser package. We have supported this for a while and have examples and integration tests in this repository. While we have made recent improvements to stability and performance (see#703,#697, and#694), there are still someimportant missing features and issues to address before
@0x/mesh-browser
is feasible for most production use cases.
0x Mesh has a lot of different use cases for different categories of users:
- Relayers can use Mesh to share orders with one another and to receive ordersfrom market makers. This allows them to increase the depth of their orderbooks and provide a better user experience.
- Market makers can use Mesh to reach a broader audience. Their orders will besent throughout the network and picked up by many trading venues and are therefore more likely to be filled.
- Mesh allows for a new type of relayer called a "serverless relayer". In theserverless relayer model, each user runs Mesh in their browser and there isno backend server or database. Instead, peers share orders directly with oneanother. (There are pros and cons to this approach and it is probably notsuitable for all markets).
Both Relayers and Market makers can use Mesh to watch a set of 0x orders for changes in fillability (e.g., cancellations, fills, expirations, etc...).
0x Mesh is intended to be entirely automatic. It takes care of all the work ofreceiving, sharing, and validating orders so that you can focus on building yourapplication. When you run a 0x Mesh node, it will automatically discover peersin the network and begin receiving orders from and sending orders to them. Youdo not need to know the identities (e.g., IP address or domain name) of anypeers in the network ahead of time and they do not need to know about you.
Developers can use the GraphQL API to interact with a Mesh node that theycontrol. The API allows you to send orders into the network, query for existingorders, and get notified when an order is added or the status of an existingorder changes (e.g. when it is filled, canceled, or expired). Under the hood,Mesh performs efficient order validation and order book pruning, which takes outa lot of the hard work for developers.
You can find documentation and guides for 0x Mesh athttps://0x-org.gitbook.io/mesh.
We love receiving contributions from the community 😄 If you are interestedin helping develop 0x Mesh, please read theDevelopment Guide.If you are looking for a place to start, take a look at theissues page and don't hesitate toreach out to us on Discord.
About
A peer-to-peer network for sharing 0x orders