Local Icp - On-chain Peer-to-Peer Trading Platform

Project highlights

Local ICP is an On-chain Peer-to-Peer to Cryptocurrency Trading Platform enabling you to directly buy and sell ICP and native assets with fiat currency. Eliminate the need for centralized exchanges and experience the transparency and security of on-chain settlement.

Architecture

Local ICP is built on the innovative ICP blockchain, leveraging its speed, scalability, and security features to facilitate fast and secure on-chain transactions.

The Stack:

  • Frontend: Svelte, Typescript
  • Authentication Tool: Internet Identity
  • Backend: Canisters written in Rust

Currently, with our architecture design, we will be having 3 canisters in total: LocalicpCore canister, Escrow canister and Trade Moderation Canister.

Each of the canisters are interlinked and connected with each other.

  1. LocalicpCore:
    This is the core canister that handles user management, balance management and trade management. Whenever a trade is created localicpCore canister interacts with Escrow canister to hold the tokens and lock it. Whenever a dispute arises a case is filed on trade moderation canister.
  2. Escrow:
    This canister is used for holding the tokens for trade. Only interaction made from localicpCore and Trade Moderation Canister will be validated. So tokens will be released only from the action provided by one of the canisters.
  3. Trade Moderation:
    This canister is used for handling the dispute that occurs during the trade. Moderator and disputed parties communicate with each other to agree on a decision based on the communication and proofs submitted.

Use of IC-Websocket

Real time data is crucial for users. We can’t expect users to refresh their page. Seeing non refreshed data and performing action against it, receiving errors. Not a good thing for users. For providing real time data, we’re using websocket wherever real time data is needed.

  1. Serving the List of Open Offers


List of offers needs to serve the users with constantly refreshing data. Same time when one user is seeing an offer, another user might make a trade with the same open offer, or the user who created the offer would like to close the offer, and so on. If we don’t refresh the list, the user might think the offer is available and then when the user makes a trade, the user receives an error. Not a good thing! To avoid this and provide updates that we’re making use of websocket. Whenever user logins and visit the offer page, firstly list of offers if served through a http call, and then a websocket connection is established for the user, whenever any update takes place, websocket notifies the frontend about the changes, and then the changes takes place on the frontend.

  1. Providing Real Time Communication

We’ll be IC-Websocket for providing real time communication between traders. This will make things easier, whenever one user sends a message another user is automatically notified about the new message. Users won’t need to refresh the page manually for checking if they have received any new message from the other party. This makes the communication and trade flow muster.

Monetization

Our plan is to charge fee per successful trade.

Status of the project

We’ve completed the first MVP of our project which will be available for Beta users.

Resources

x
discord

Future Plans

For the moment, in our first MVP, we’re lacking Trade Moderation System which helps to solve the issue of the users when there is any problem during the trade flow.
For the moment, our application is requires user to manually refresh the page, in the next release we will be working on making use of Ic-Websocket as described in the architecture above.

6 Likes