Build Your Own Protocol (YOP)
Guide for building custom protocols on AAStar infrastructure.
Overview
AAStar SDK provides infrastructure to build Your Own Protocol with:
- Account Abstraction
- Gas sponsorship
- Community management
- Reputation systems
Architecture
Your Protocol
├── Smart Contracts
│ └── Custom logic
├── AAStar SDK
│ ├── Account Abstraction
│ ├── SuperPaymaster
│ └── Community Management
└── Frontend DApp
└── React + @aastar/dappExample: Custom DeFi Protocol
typescript
import { createEndUserClient, createCommunityClient } from '@aastar/core';
// 1. Set up community
const community = createCommunityClient({...});
await community.registerCommunity({ name: 'MyDeFi' });
// 2. Deploy community token
const tokenAddress = await community.deployXPNTs({
name: 'MyDeFi Points',
symbol: 'MDP',
initialSupply: parseEther('1000000'),
});
// 3. Enable gasless transactions for users
const user = createEndUserClient({...});
const eligible = await user.checkEligibility(communityAddress);
// 4. Users can interact without gas fees
if (eligible) {
await sendGaslessTransaction();
}Key Features
- Gasless UX: Users don't need ETH
- Community Tokens: Custom reward systems
- Reputation: On-chain reputation tracking
- Flexible: Build any protocol logic
