Inspiration
We came up with this idea to solve the issues below:
- Although you can sell your NFTs on metaplex platrforms, it's sometimes cumbersome to take extra steps to list items on the platform when you know who you want to sell.
- Currently there's no way for buyers to make an offer when NFTs are not listed.
- Techinically you can directly send your SOL or NFTs to others from your wallet, but it is not secure at all, you might end up losing your assets.
What it does
- Hayama allows you to explore NFTs that other people own and make an offer with super simple steps
- All transactions(deposit, escrows) happen on Hayama are decentralized on Solana block-chain so your trade is always safe and transparent.
How we built it
Hayama consists of three components.
On-chain program
- Built an escrow program that handles making offers, trade NFT and Sol, cancel offers
- Source code can be found in https://github.com/tomoima525/escrow-program
Frontend
- The frontend is built with Next.js and deployed with AWS Amplify. TailwindCSS is used for Styling.
@solana/web3.js
,@solana/wallet-adapter
and@solana/spl-token
are heavily used for signing transactions and connecting wallets.
Backend
For the performance purpose, Hayama caches transaction history in a database(DynamoDB). GraphQL built on AWS AppSync is used for API access.
The frontend and the backend code are composed in one repository: https://github.com/tomoima525/sol-hayama
Challenges we ran into
Understanding Solana block-chain concept
How transactions work on Solana is different from that of Ethereum. Luckily there are a lot of projects like spl-token-library
maintained by Solana team, so we were able to learn architecture and design from the codebase.
Token Accounts management
Generating and closing Token Accounts correctly was something hard to manage. In the first version of the program, there were always Token Accounts with no holding tokens(Aux accounts) left after a transaction. After a careful inspection, we found that Token Accounts should be closed to return rent fees to Sellers and Buyers.
Accomplishments that we're proud of
We have created a fully functional decentralized application on Solana!
What we learned
- Decentralized application development. This includes running the local network, deploying programs, testing. We are amazed by how tools are developed and organized by Solana team!
What's next for Hayama
- Seller listing functionality. Seller can deposit their NFTs on Solana block-chain to sell them
- Add functionality to send fees to creators based on royalties percentage on metadata
- Add functionality to generate a referral link that opens Sell confirmation page
Log in or sign up for Devpost to join the conversation.