Inspiration

The primary challenge in P2P Trading is trust. Traditionally, one side must send their assets first, trusting the other to do the same. This exposes traders to potential risks. Our platform is inspired by the P2P trading system in MMO RPG games. We aim to bring a similar secure and immersive experience to DeFi users for trading their NFTs and tokens.

What it does

TradeLink is a platform for trading NFTs and tokens. With Chainlink's CCIP technology, users can trade assets across different EVM blockchains. For example, take Alice and Bob: Bob has 1 BNB on BSC and wants to swap it for Alice's Ethereum-based Bored Ape NFT. Our platform acts as the middleman, ensuring Alice gets 1 BNB on BSC while Bob receives the NFT on Ethereum.

Here's how TradeLink works:

  1. User A creates a trade offer by selecting the item they want to trade and the item they want in return. This trade offer is posted off-chain on our platform. User A must approve all the items they are offering to the TradeLink Smart Contract.
  2. User B accepts the trade offer off-chain by approving all the trade items User A wants within the TradeLink smart contract.
  3. User A confirms the order by calling 'createOffer' on the TradeLink Smart Contract. In this process, all items from User A are transferred and locked within the smart contract.
  4. User B completes the trade by calling 'fullFillOffer' on the TradeLink Smart Contract. All items from User B are also transferred and locked within the smart contract. The smart contract then transfers all items from User A's vault to User B's, and vice versa.

How we built it

  • Frontend:
    • Next.js with TypeScript for developing the user interface.
    • NextUi with TailwindCSS for building stylesheet.
    • Wagmi/Viem for connecting frontend to the smart contract.
    • RainbowKit for wallet connection on the frontend.
    • Ethereum Name Service (ENS) for displaying username instead of walletAddresses.
  • Backend:
    • NestJS with TypeScript as our backend for off-chain supporting service.
    • MongoDB as our database for storing users created off-chain offers.
  • Indexer:
    • Subgraph for indexing NFTs ownership and TradeLink Offer Statuses.
  • Contract:
    • Solidity & Hardhat for developing and testing the Smart Contract.
    • Chainlink CCIP for Corss-Chain message passing.

Challenges we ran into

During the hackathon, we encountered a challenge while testing our smart contract. The extended duration of cross-chain transactions, which ranged from 15 to 30 minutes per transaction using Chainlink CCIP, made the debugging and testing of our smart contract functions more difficult.

Even though the cross-chain transactions took a long time with Chainlink CCIP during the hackathon, our team kept going. We faced challenges, found new ways, and improved our smart contract functions. These obstacles helped us grow and create a stronger final product in the future.

Accomplishments that we're proud of

We're proud to have developed a platform enabling users to seamlessly trade their NFTs and tokens across various EVM blockchains.

What we learned

We've acquired significant knowledge in developing cross-chain products by utilizing Chainlink's CCIP technology for message passing.

What's next for TradeLink

Moving forward, here are our planned developments for TradeLink:

  • AutoSwap Token: For example, if Bob wants 1 ETH for his trade, and Alice prefers to trade with USDT, Alice can make her trade using USDT. Our platform will then seamlessly swap it on the AMM for the users.
  • Expansion of Tradable Items: Our goal is to introduce a broader range of tradable items on our platform. This includes various asset standards that possess ownership and transfer systems, such as memberships. This will improve the diversity of trade options available.

Built With

Share this project:

Updates