Inspiration

I was just thinking about the fact there are no easy Stock exchange app. I know it's because of those contract and stuff but what if we made it to digital, like how everything is becoming. So on seeing this hackathon, I decided to build a Stock exchange app especially with blockchain as it is more secure and I can learn something new. The idea is simple, it's what a normal company would do, which is issue its shares for sale and get the money. In the app the company can ask for a company account or ask shall to mint its shares, once the shares are sold, the company will get its money from shall as simple as this.

What it does

Stock exchange. You can buy and sell shares peer to peer. To mint a share you must be company, there is currently only one company and it's called company-shall. This account can mint shares. All shares are identified by its symbol or ticker. Once shares are minted a listed for sale, users can now start to buy shares. The App even contains graph and statistics to help you buy and sell shares. The user chooses the amount of share he wants to buy and pay the other user. If payment is successful the shares are transferred. And both user are notified by the use of a notification screen.

How we built it

By using React as frontend and using Near and its smart-contracts. For storage on the blockhain we use a persistentUnorderedMap along with models for storing (you will see in the code). We used yahoo finance api, alphavantage and binance to get the price of the shares.

Challenges we ran into

It was a lot of research and tries as this was the first blockchain app I was building. The hardest one was the payment feature. I had to use a function call, which I literally knew nothing about, but it wasn't the end. There was a bigger problem, the API was allowing a maximum number of 5 requests per second but we were calling 2 times in one card. But some searches could give result of 5 cards so that is 10 calls we have to do, but the API would just reject the calls. So I had to use set interval to call the API and clear the interval once request was successful.

Accomplishments that we're proud of

The fact that this was my first blockchain app and also my first app where there was crypto payments involved, additionally I am proud of how the UI turned out as it was my first time using tailwind css.

What we learned

Blockchain, NEAR protocol and it's smart contracts and also I can now use tailwind without any difficulty.

What's next for Shall

We have to really improve it's security as you can literally call smart contracts via console which is something I still haven't figure out how to get rid of, and some other things such as better notifications and APIs. Also we need to add better statistics and better graphs. We also need to implement a way to sell shares instantly which would be groundbreaking and change how the stock market works AND fun fact if there are enough users it's 100% possible.

Built With

Share this project:

Updates