A decentralized investment platform that democratizes access to verified investment pools. Connect with Google, get an instant Web3 wallet, and start investing with as little as 0.1 ETH. Built with Chronicle oracles for price feeds and Sign Protocol for verifiable attestations.
MicroVest is a decentralized investment platform that bridges the gap between traditional investors and Web3 opportunities. By combining Web3Auth's seamless onboarding, Chronicle's reliable price feeds, and Sign Protocol's verifiable attestations, we've created a platform that makes Web3 investing accessible, secure, and transparent.
MicroVest aims to democratize access to Web3 investments by:
By combining these elements, MicroVest creates a secure, accessible, and user-friendly platform for Web3 investments, bridging the gap between traditional finance and decentralized opportunities.
// Web3Auth Integration for Seamless Onboarding
- Implemented Single Factor Auth using Web3Auth
- Firebase for authentication backend
- Custom implementation with ethers.js for Web3 interactions
// Key Integration
const web3auth = new Web3Auth({
clientId: process.env.WEB3AUTH_CLIENT_ID,
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
privateKeyProvider: new EthereumPrivateKeyProvider({
config: { chainConfig }
})
});
// Google Authentication Flow
const signInWithGoogle = async () => {
const auth = getAuth(firebaseApp);
const provider = new GoogleAuthProvider();
const result = await signInWithPopup(auth, provider);
const idToken = await result.user.getIdToken();
return web3authProvider.connect({
verifier: "microvest-auth",
verifierId: result.user.uid,
idToken
});
};
// Chronicle Protocol Integration for Real-time Price Feeds
contract MicroVestPool {
IChronicle public immutable oracle;
function getAssetPrice(string memory symbol) public view returns (uint256) {
(uint256 price, uint256 timestamp) = oracle.readWithAge();
require(block.timestamp - timestamp <= MAX_PRICE_AGE, "Stale price");
return price;
}
}
// Sign Protocol Integration for Pool Verification
contract PoolAttestation {
ISP public signProtocol;
function createPoolAttestation(
address creator,
uint256 poolId,
string memory symbol,
uint256 targetAmount
) external returns (uint64) {
bytes[] memory recipients = new bytes[](1);
recipients[0] = abi.encode(creator);
bytes memory data = abi.encode(
poolId,
symbol,
targetAmount,
block.timestamp
);
Attestation memory attestation = Attestation({
schemaId: poolSchemaId,
attestTimestamp: uint64(block.timestamp),
data: data,
// ... other attestation fields
});
return signProtocol.attest(attestation, "", "", "");
}
}
// Pool Factory Pattern for Scalability
contract MicroVestFactory {
mapping(uint256 => address) public pools;
uint256 public poolCounter;
event PoolCreated(uint256 indexed poolId, address pool);
function createPool(
string memory symbol,
uint256 targetAmount,
uint256 minInvestment
) external returns (uint256 poolId) {
poolId = ++poolCounter;
address pool = address(new MicroVestPool(
msg.sender,
symbol,
targetAmount,
minInvestment
));
pools[poolId] = pool;
emit PoolCreated(poolId, pool);
}
}
// Innovative Investment Distribution
contract MicroVestPool {
struct Investment {
uint256 amount;
uint256 shares;
uint256 entryPrice;
uint64 attestationId;
}
mapping(address => Investment) public investments;
function invest() external payable {
require(msg.value >= minInvestment, "Below min");
uint256 price = getAssetPrice(symbol);
uint256 shares = calculateShares(msg.value, price);
investments[msg.sender] = Investment({
amount: msg.value,
shares: shares,
entryPrice: price,
attestationId: createInvestmentAttestation(
msg.sender,
msg.value
)
});
}
}
// Custom Hook for Web3 Integration
const useWeb3 = () => {
const [provider, setProvider] = useState<any>(null);
const [address, setAddress] = useState<string>('');
const connect = async () => {
const web3authProvider = await login();
const ethersProvider = new ethers.BrowserProvider(web3authProvider);
const signer = await ethersProvider.getSigner();
const userAddress = await signer.getAddress();
setProvider(ethersProvider);
setAddress(userAddress);
};
return { provider, address, connect };
};
// Pool Component with Real-time Updates
const PoolCard = ({ pool }) => {
const { provider } = useWeb3();
const [currentPrice, setCurrentPrice] = useState<number>(0);
useEffect(() => {
const fetchPrice = async () => {
const price = await getAssetPrice(pool.symbol);
setCurrentPrice(price);
};
const interval = setInterval(fetchPrice, 30000);
return () => clearInterval(interval);
}, [pool.symbol]);
return (
<div className="bg-white rounded-xl shadow-sm p-6">
{/* Pool UI */}
</div>
);
};
This project showcases the power of combining multiple Web3 technologies to create a user-friendly investment platform. The integration of Web3Auth, Chronicle Protocol, and Sign Protocol allowed us to solve key challenges in authentication, price feeds, and verification respectively, while maintaining a seamless user experience.