Skip to content

spiritclawd/infiniyield

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

INFINIYIELD โ™พ๏ธ

Entry fees compound into infinite yield for top players

INFINIYIELD is a gaming platform where every entry fee flows into BTC-backed vaults that generate perpetual yield. Top players earn their share of the accumulated rewards.


๐ŸŽฎ How It Works

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    THE INFINIYIELD FLYWHEEL                      โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚                                                                   โ”‚
โ”‚   Player pays entry fee (e.g., 0.001 BTC)                        โ”‚
โ”‚                     โ”‚                                             โ”‚
โ”‚                     โ–ผ                                             โ”‚
โ”‚          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                 โ”‚
โ”‚          โ”‚    FEE SPLITTER     โ”‚                                 โ”‚
โ”‚          โ”‚   90% / 10% split   โ”‚                                 โ”‚
โ”‚          โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                 โ”‚
โ”‚                     โ”‚                                             โ”‚
โ”‚          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                 โ”‚
โ”‚          โ–ผ                     โ–ผ                                 โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                         โ”‚
โ”‚   โ”‚  90% VAULT  โ”‚      โ”‚ 10% Platform โ”‚                         โ”‚
โ”‚   โ”‚  (BTC Pool) โ”‚      โ”‚  (Treasury)  โ”‚                         โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                         โ”‚
โ”‚          โ”‚                                                        โ”‚
โ”‚          โ–ผ                                                        โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”‚
โ”‚   โ”‚           ENDURANCE BTC STAKING                        โ”‚      โ”‚
โ”‚   โ”‚           ~5% APY on Starknet                          โ”‚      โ”‚
โ”‚   โ”‚           (via starkzap integration)                   โ”‚      โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚
โ”‚                             โ”‚                                     โ”‚
โ”‚                             โ–ผ                                     โ”‚
โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”‚
โ”‚   โ”‚           ACCUMULATED YIELD                           โ”‚      โ”‚
โ”‚   โ”‚           Distributed to top 50% of players           โ”‚      โ”‚
โ”‚   โ”‚                                                        โ”‚      โ”‚
โ”‚   โ”‚   Top 1     โ†’ 30% of yield                            โ”‚      โ”‚
โ”‚   โ”‚   Top 2-5   โ†’ 25% of yield                            โ”‚      โ”‚
โ”‚   โ”‚   Top 6-10  โ†’ 20% of yield                            โ”‚      โ”‚
โ”‚   โ”‚   Top 11-25 โ†’ 15% of yield                            โ”‚      โ”‚
โ”‚   โ”‚   Top 26-50 โ†’ 10% of yield                            โ”‚      โ”‚
โ”‚   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚
โ”‚                                                                   โ”‚
โ”‚   ๐Ÿ’ก KEY INSIGHT: Principal NEVER decreases, only grows.          โ”‚
โ”‚      More games = bigger vault = more yield = more players.      โ”‚
โ”‚                                                                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm, yarn, or bun

Installation

# Clone the repository
git clone https://github.com/spiritclawd/infiniyield.git
cd infiniyield

# Install dependencies
npm install

# Start development server
npm run dev

Open http://localhost:3000 in your browser.


๐Ÿ“ฆ Tech Stack

Layer Technology Purpose
Frontend Next.js 15 React framework for Vercel deployment
Styling Tailwind CSS 4 Utility-first CSS
State Zustand Lightweight state management
Wallet starkzap + Cartridge Starknet wallet integration
Yield Endurance BTC staking on Starknet
Network Starknet Layer 2 for low fees

๐Ÿ’ฐ Money Flow

Entry Fee Split

import { calculateFeeSplit, formatBTC } from '@/lib/money-flow';

// Calculate fee split for 0.001 BTC entry
const split = calculateFeeSplit(100000n); // 100,000 satoshis = 0.001 BTC

console.log(`Vault receives: ${formatBTC(split.vaultAmount)}`);    // 0.0009 BTC (90%)
console.log(`Platform receives: ${formatBTC(split.platformAmount)}`); // 0.0001 BTC (10%)

Yield Distribution

import { calculateYieldDistribution, getYieldShareForRank } from '@/lib/money-flow';

// Total yield to distribute: 0.05 BTC
const distributions = calculateYieldDistribution(5000000n);

// Get yield share for rank 1
const rank1Share = getYieldShareForRank(1, 5000000n);
console.log(`Rank 1 earns: ${formatBTC(rank1Share.amountSatoshis)}`);

โšก starkzap Integration

starkzap is the official SDK for Starknet wallet and staking operations.

Installation

npm install starkzap

Wallet Connection

import { StarkZap, OnboardStrategy } from 'starkzap';

const sdk = new StarkZap({ network: 'mainnet' });

// Connect with Cartridge Controller (recommended)
const { wallet } = await sdk.onboard({
  strategy: OnboardStrategy.Cartridge,
  deploy: 'if_needed',
});

console.log('Connected:', wallet.address);

BTC Balance & Transfers

import { mainnetTokens, Amount, fromAddress } from 'starkzap';

const BTC = mainnetTokens.BTC;

// Get balance
const balance = await wallet.balanceOf(BTC);
console.log(balance.toFormatted()); // "0.005 BTC"

// Transfer BTC
const tx = await wallet.transfer(BTC, [
  { to: fromAddress('0x123...'), amount: Amount.parse('0.001', BTC) },
]);
await tx.wait();

BTC Staking (Endurance)

// Stake BTC via Endurance validator (~5% APY)
const stakeTx = await sdk.stake(
  Amount.parse('0.01', BTC).toBigInt(),
  { validator: 'ENDURANCE' }
);

// Unstake
const unstakeTx = await sdk.unstake(
  Amount.parse('0.01', BTC).toBigInt(),
  { validator: 'ENDURANCE' }
);

Full Integration Example

// src/lib/starkzap-client.ts
import { 
  StarkZap, 
  OnboardStrategy, 
  StarkSigner, 
  Amount, 
  fromAddress,
  mainnetTokens 
} from 'starkzap';

export class InfiniYieldSDK {
  private starkzap: StarkZap;
  private wallet: Wallet | null = null;

  constructor(network: 'mainnet' | 'sepolia' = 'mainnet') {
    this.starkzap = new StarkZap({ network });
  }

  async connectWallet() {
    const result = await this.starkzap.onboard({
      strategy: OnboardStrategy.Cartridge,
      deploy: 'if_needed',
    });
    this.wallet = result.wallet;
    return this.wallet;
  }

  async payEntryFee(
    vaultAddress: string,
    platformAddress: string,
    amountBTC: string,
  ) {
    if (!this.wallet) throw new Error('Not connected');
    
    const BTC = mainnetTokens.BTC;
    const total = Amount.parse(amountBTC, BTC);
    
    // 90/10 split
    const vaultAmount = total.toBigInt() * 90n / 100n;
    const platformAmount = total.toBigInt() * 10n / 100n;

    const tx = await this.wallet.transfer(BTC, [
      { to: fromAddress(vaultAddress), amount: Amount.fromBigInt(vaultAmount, BTC) },
      { to: fromAddress(platformAddress), amount: Amount.fromBigInt(platformAmount, BTC) },
    ]);

    await tx.wait();
    return tx.transactionHash;
  }

  async stakeVaultBTC(amountBTC: string) {
    const amount = Amount.parse(amountBTC, mainnetTokens.BTC);
    const tx = await this.starkzap.stake(amount.toBigInt(), {
      validator: 'ENDURANCE',
    });
    return tx.transactionHash;
  }
}

๐Ÿ”ง Configuration

Environment Variables

Create .env.local:

# Network: mainnet or sepolia
NEXT_PUBLIC_NETWORK=mainnet

# Platform fee recipient (10%)
NEXT_PUBLIC_PLATFORM_FEE_RECIPIENT=0xYOUR_ADDRESS

# Vault contract (after deployment)
NEXT_PUBLIC_VAULT_CONTRACT=0xYOUR_VAULT

# Cartridge namespace
NEXT_PUBLIC_CARTRIDGE_NAMESPACE=infiniyield

Vercel Deployment

  1. Push to GitHub
  2. Import project in Vercel
  3. Set environment variables
  4. Deploy!

Deploy with Vercel


๐Ÿ“ Project Structure

infiniyield/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ page.tsx          # Main dashboard
โ”‚   โ”‚   โ”œโ”€โ”€ layout.tsx        # Root layout
โ”‚   โ”‚   โ””โ”€โ”€ globals.css       # Styles
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ starkzap-client.ts  # starkzap integration
โ”‚   โ”‚   โ””โ”€โ”€ money-flow.ts       # Fee/yield calculations
โ”‚   โ””โ”€โ”€ store/
โ”‚       โ””โ”€โ”€ game-store.ts       # Zustand state
โ”œโ”€โ”€ public/
โ”œโ”€โ”€ .env.example
โ”œโ”€โ”€ next.config.ts
โ”œโ”€โ”€ tailwind.config.ts
โ”œโ”€โ”€ tsconfig.json
โ””โ”€โ”€ package.json

๐ŸŽฏ Key Features

Feature Description
Infinite Vault Principal never decreases, only grows
BTC Native Primary vault asset is Bitcoin
90/10 Split Fair fee distribution
Tiered Rewards Top 50% share yield
Time-Weighted Maintain position for bonus
Gasless UX Via Cartridge Controller

๐Ÿ“Š Yield Tiers

Tier Rank Share Example (1 BTC yield)
๐Ÿฅ‡ Gold Top 1 30% 0.3 BTC
๐Ÿฅˆ Silver Top 2-5 25% 0.0625 BTC each
๐Ÿฅ‰ Bronze Top 6-10 20% 0.04 BTC each
๐Ÿ’œ Purple Top 11-25 15% 0.01 BTC each
๐Ÿ’™ Blue Top 26-50 10% 0.004 BTC each

๐ŸŽฎ Supported Games

Game Status Entry Fee
Loot Survivor โœ… Live 0.001-0.01 BTC
Axis Arena ๐Ÿ”„ Coming Soon TBD
Custom EGS Games ๐Ÿ”„ Integration TBD

๐Ÿ›ก๏ธ Security

  • No private keys stored - All wallet ops via Cartridge Controller
  • Audited contracts - Endurance staking is battle-tested
  • Transparent fees - All splits visible on-chain
  • Non-custodial - Players control their funds

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing)
  5. Open Pull Request

๐Ÿ“„ License

MIT License - see LICENSE


๐Ÿ”— Links


๐Ÿ† Dojo Game Jam VIII

INFINIYIELD is a submission for the Dojo Game Jam VIII. It demonstrates:

  • โœ… EGS (Embeddable Game Standard) compatibility
  • โœ… On-chain state management
  • โœ… Real yield generation
  • โœ… Player incentive alignment
  • โœ… Sustainable tokenomics (no inflation)

Built with โšก by spiritclawd | Powered by Starknet + starkzap

About

๐ŸŽฎ INFINIYIELD - Infinite Yield Gaming Platform | Entry fees โ†’ Vault โ†’ Yield โ†’ Top Players

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors