OXE is a Solana-based token staking/locking protocol built using the Anchor framework. It enables users to create staking pools for tokens, deposit them for a specified lock period, and potentially earn rewards.
- Pool Creation: Create token staking pools with configurable parameters
- Flexible Lock Periods: Configure minimum and maximum lock durations
- Optional Rewards: Pools can optionally provide rewards in a different token
- Secure Vault Storage: All deposited tokens are stored in secure program-derived vaults
- Permissionless: Anyone can create pools and users can freely participate
The protocol follows a modular design with the following key components:
-
Pool: Central state account that stores:
- Creator's public key
- Minimum and maximum lock durations (in seconds)
- Optional reward mint
- Bump seed for PDA derivation
-
Ticket: (Planned) Represents a user's deposit into a pool, including:
- Amount of tokens deposited
- Lock end time
- User information
-
Reward: (Planned) Represents reward distribution parameters and tracking
-
Initialize
- Creates a new staking pool with configured parameters
- Sets up token vaults for deposits and optional rewards
- Allows creators to fund the reward vault during creation
-
Deposit (Planned)
- Allows users to deposit tokens into a pool
- Creates a ticket representing the user's stake
- Calculates lock period and expected rewards
-
Withdraw (Planned)
- Allows users to withdraw their tokens after the lock period
- Distributes earned rewards
- Closes the ticket account
The protocol uses Solana's Program Derived Addresses (PDAs) to create and manage various accounts:
- Pool Account:
["pool", creator, mint] - Pool Vault: Stores the staked tokens
- Reward Vault: Stores tokens for rewards (if enabled)
- Ticket Account: (Planned)
["ticket", pool, owner]
- Solana CLI
- Anchor Framework
- Node.js and Yarn/npm
- Solana wallet with SOL for deployment and testing
-
Clone the repository:
git clone https://github.com/yourusername/oxe.git cd oxe -
Install dependencies:
yarn install # or bun install -
Build the program:
anchor build
-
Deploy to localnet for testing:
anchor deploy
-
Run tests:
anchor test # or bun run test
-
For mainnet deployment, update your
Anchor.tomlwith the appropriate cluster and wallet.
const tx = await program.methods.initialize({
rewardAmount: new BN(1000000), // Optional, omit if no rewards
minDuration: new BN(86400), // 1 day in seconds
maxDuration: new BN(2592000), // 30 days in seconds
})
.accounts({
creator: wallet.publicKey,
mint: tokenMint,
rewardMint: rewardTokenMint, // Optional
// Other accounts will be derived by the program
})
.rpc();// Coming soon// Coming soon- The protocol uses Solana's PDA mechanism for secure account derivation
- Token accounts are properly validated to prevent unauthorized access
- Amount validation ensures reasonable reward parameters
- Pool creation and initialization
- Ticket creation and deposit functionality
- Withdrawal and reward distribution
- Enhanced reward mechanisms
- DAO governance integration
- UI/Dashboard for easy interaction
ISC
- Solana - High-performance blockchain
- Anchor Framework - Solana development framework
- SPL Token - Solana token standard
- Bun - JavaScript runtime for development
Note: This project is under active development. Deposit and withdrawal features are planned but not yet implemented.