LemonJet is a Sui-based game of chance where players stake SUI (or any supported coin type) against configurable payout coefficients. The Move contracts in this repository keep the full game loop on-chain: player registration, vault liquidity management, game execution, referral rewards, and points-based loyalty incentives.
- Language: Move
- Target Network: Sui Devnet/Testnet/Mainnet
- Key Features:
- Deterministic and auditable
playflow driven by Sui randomness. - Vault share system with fees, admin dividends, and referral rewards.
- Player registry that supports optional referrer names.
- Points program that mints an on-chain loyalty token and tracks campaign volume.
- Deterministic and auditable
Install the Sui CLI toolchain (includes Move compiler and simulator). Follow the official setup guide:
curl -fsSL https://install.sui.io | sh
sui client active-address # verify installationEnsure your environment is configured for the target network (Devnet/Testnet/Mainnet) by running sui client switch --env <ENV>.
From the repository root:
sui move build # type checking and bytecode generation
sui move test # run Move unit testsThe tests include coverage for referral reward bookkeeping in the points module.
- Publish the package on the desired network:
sui client publish --gas-budget <BUDGET>
- Record the published package ID. You will need it to invoke entry functions.
- Run initial setup (see the flow below) using
sui client call.
💡 These contracts are generic over the staked coin type
T. When deploying to mainnet, publish an instance per supported asset or wrap the vault in a front-end router.
| Module | Purpose |
|---|---|
admin |
Mints an AdminCap that authorises vault/points configuration. |
player |
Maintains player objects, optional referrers, and name registry. |
lemonjet |
Implements the game loop, fee logic, and outcome events. |
vault |
Manages liquidity, share minting/burning, admin dividends, and payouts. |
points |
Sets up the loyalty program, tracks play volume, and mints POINTS tokens. |
The relevant source files live under sources/. Move.toml defines package metadata and dependencies.
-
Admin initialisation
- Call
admin::initto create theAdminCap. - With the cap, invoke
vault::create<T>to deploy a vault for the chosen coin type. - With the cap, run
points::setup<T>to configure loyalty caps and cadence.
- Call
-
Player onboarding
- Share objects
player::PlayerRegistryandplayer::NameRegistryby callingplayer::initonce after publish. - Players register via
player::create(optionally referencing an existing player address) orplayer::create_by_name.
- Share objects
-
Game play
- Players fund the vault using
vault::deposit<T>to mint vault shares. - A front end requests randomness and calls
lemonjet::play_and_earn_points_(...)with the desired coefficient. - The function records stake volume, awards referral shares, deducts house fees, and emits an
Outcomeevent.
- Players fund the vault using
-
Rewards and exits
- Players redeem liquidity with
vault::redeem<T>(exit fees fund rewards). - Referral accounts claim accumulated vault shares through
vault::claim*. - Volume rewards are collected with
points::claim_ref_volumefollowed bypoints::claimto mint POINTS tokens. - Admins harvest dividends with
vault::admin_claim*and rotate points cycles usingpoints::next_cycle.
- Players redeem liquidity with
- House edge in
lemonjet::HOUSE_EDGEdefaults to 1%. - Coefficient bounds are enforced between
1.01xand50x(coefis expressed in basis points with two decimals). - Vault limits:
vault::max_payoutcaps single-win exposure using the stored liquidity and a golden-ratio heuristic. - Referral rewards: 30% of the house fee is allocated to the referrer; 20% mints admin shares; remaining fees stay in the vault.
- Points cycle: Controlled by
points::Config(point capacity and interval). Completed cycles snapshot volumes intoRateRegistry.
.
├── Move.toml # Package manifest and dependency declarations
├── Move.lock # Locked dependency versions
├── README.md # Project documentation (this file)
├── build/ # Build artifacts (generated by Sui CLI)
└── sources/ # Move modules
- Use
sui client call --function ... --module ...for manual testing against a local sandbox or testnet. - Enable verbose test output with
sui move test --verbose 2when debugging complex scenarios. - When adding new modules, register them in
Move.tomland ensure entry functions validate versioning like existing modules.
These contracts are unaudited and are provided for research and experimentation only. Deploy to production at your own risk.