Our project addresses a crucial gap in the current landscape of real-world assets (RWAs) on the blockchain. Traditional synthetic RWAs only mint tokens based on price feeds, creating an abstraction layer that does not connect directly to the underlying assets. Our solution takes a more direct approach by enabling RWAs that are directly backed by real assets.
By utilizing Gelato functions, our platform executes stock purchases off-chain, ensuring that the tokens you hold are genuinely backed by real-world assets. This enhances trust, transparency, and the overall value proposition of RWAs on-chain, effectively bridging the gap between traditional finance and blockchain technology.
Currently Deployed on Lisk Sepolia and Supports the Following Stocks: AAPL AMZN NASDAQ S&P500 The flow of the Dapp is as follows:- Approve and deposit the suffcient amount of USDT to the contract. Select the stock and the correct amount. Redstone's core price feed wraps the transaction with its oracle data. After calling the buyRStock function, a BuyRequest gets emmitted. The event is picked up by Gelato's web3-function, which calls the Alpaca API to buy the respective stock in the exchange. It then excutes the mintRStock function, which mints the directly backed ERC20 of the RWA on-chain. In a similar manner, it can be sold and the USDT can be withdrawn. This repository includes the contract and Web3 functions, which need to be deployed separately for testing.
For Contract: $ forge init // Move the contract to foundry directory $ forge install redstone-finance/redstone-oracles-monorepo --no-commit $ forge install OpenZeppelin/openzeppelin-contracts@v4.9.5 --no-commit For web3-function $ git clone https://github.com/gelatodigital/web3-functions-sdk.git // Move the stocks and updates folder to web3-function $ npx hardhat w3f-deploy stocks // to get the typescript function IPFS CID For web-app $ npm i $ npm run dev Environment Variables: Environment variables are needed for Web3 functions as they use the Alpaca API for stock trading.
USDT Contract: The USDT contract used in the prototype is the most utilized USDT contract on Lisk Sepolia, deployed by HUOSTATER. Obtain USDT from the faucet.
Gelato Deployed Functions: MarketAAPL
BuyAAPL
SellAAPL
MarketAMZN
BuyAMZN
SellAMZN
MarketNASDAQ
BuyNASDAQ
SellNASDAQ
MarketSPY
BuySPY
SellSPY
Market Function: Manages pausing and unpausing of the contract based on market status.
Buy Function: Listens for BuyRequest events, interacts with the Alpaca API to purchase stock, and mints the corresponding ERC20 token to the trader.
Sell Function: Listens for SellRequest events, interacts with the Alpaca API to sell stock, and burns the corresponding ERC20 token from the trader.
Log in or sign up for Devpost to join the conversation.