Skip to main content

Overview

The Syra Staking System allows users to stake SYRA tokens to participate in the prediction game. Staking unlocks various tiers with different benefits, including the ability to create prediction events and earn rewards.

Staking Tiers

The system features multiple staking tiers, each with unique benefits:

Tier Structure

const response = await fetch('https://api.syraa.fun/v1/prediction-game/staking/tiers');
const { tiers } = await response.json();
Tier Benefits:
TierMin StakeDaily EventsUnlock Period
Bronze100 SYRA1 event7 days
Silver500 SYRA3 events14 days
Gold2,000 SYRA7 events30 days
Platinum10,000 SYRA20 events60 days
Diamond50,000 SYRAUnlimited90 days
Higher tiers unlock more daily event creation limits and better reward multipliers.

Staking Operations

Get Staking Info

Retrieve staking information for a wallet:
const response = await fetch(
  `https://api.syraa.fun/v1/prediction-game/staking/${walletAddress}`
);

const stakingInfo = await response.json();
Response Structure:
{
  "walletAddress": "9xQe...",
  "stakedAmount": 2500,
  "tier": "gold",
  "tierInfo": {
    "name": "Gold",
    "minStake": 2000,
    "dailyEvents": 7,
    "unlockPeriod": 30
  },
  "stakedAt": "2026-02-15T10:00:00Z",
  "unlocksAt": "2026-03-17T10:00:00Z",
  "eventsCreatedToday": 2,
  "totalEventsCreated": 45,
  "totalSlashed": 0,
  "canCreate": {
    "canCreate": true,
    "reason": null
  },
  "canUnstake": {
    "canUnstake": false,
    "reason": "Tokens are still locked",
    "unlocksAt": "2026-03-17T10:00:00Z"
  },
  "stakingHistory": []
}

Stake Tokens

Stake SYRA tokens to unlock tiers:
const response = await fetch(
  `https://api.syraa.fun/v1/prediction-game/staking/${walletAddress}/stake`,
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      amount: 2500,
      txSignature: 'transaction_signature_here'
    })
  }
);

const result = await response.json();
Successful Stake Response:
{
  "message": "Staked successfully! You've upgraded to Gold tier!",
  "walletAddress": "9xQe...",
  "stakedAmount": 2500,
  "tier": "gold",
  "tierInfo": {
    "name": "Gold",
    "minStake": 2000,
    "dailyEvents": 7,
    "unlockPeriod": 30
  },
  "previousTier": "bronze",
  "tierChanged": true,
  "unlocksAt": "2026-03-17T10:00:00Z",
  "canCreate": {
    "canCreate": true
  }
}

Unstake Tokens

Withdraw staked tokens after the unlock period:
const response = await fetch(
  `https://api.syraa.fun/v1/prediction-game/staking/${walletAddress}/unstake`,
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      amount: 500,
      txSignature: 'transaction_signature_here'
    })
  }
);

const result = await response.json();
Unstaking is only allowed after the unlock period expires. Early unstaking is not permitted.

Event Creation Limits

Check Event Creation Permission

const response = await fetch(
  `https://api.syraa.fun/v1/prediction-game/staking/${walletAddress}/can-create`
);

const { canCreate, reason, tier, tierInfo, stakedAmount } = await response.json();
Can Create Response:
{
  "canCreate": true,
  "reason": null,
  "tier": "gold",
  "tierInfo": {
    "name": "Gold",
    "dailyEvents": 7
  },
  "stakedAmount": 2500
}
Cannot Create Response:
{
  "canCreate": false,
  "reason": "Daily event limit reached (7/7)",
  "tier": "gold",
  "tierInfo": {
    "name": "Gold",
    "dailyEvents": 7
  },
  "stakedAmount": 2500
}

Record Event Creation

After creating an event, record it against the staking limit:
const response = await fetch(
  `https://api.syraa.fun/v1/prediction-game/staking/${walletAddress}/record-event`,
  {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' }
  }
);

const { message, eventsCreatedToday, remainingToday } = await response.json();

Staking Statistics

Platform Statistics

Get overall staking statistics:
const response = await fetch(
  'https://api.syraa.fun/v1/prediction-game/staking/admin/stats'
);

const stats = await response.json();
Stats Response:
{
  "totalStakers": 1234,
  "totalStaked": 5678900,
  "averageStake": 4603,
  "tierDistribution": {
    "bronze": 500,
    "silver": 400,
    "gold": 250,
    "platinum": 70,
    "diamond": 14
  },
  "totalEventsCreated": 12450,
  "totalSlashed": 1200
}

Staking Leaderboard

View top stakers:
const response = await fetch(
  'https://api.syraa.fun/v1/prediction-game/staking/leaderboard/top?limit=10'
);

const { leaderboard } = await response.json();
Leaderboard Response:
{
  "leaderboard": [
    {
      "walletAddress": "9xQe...",
      "stakedAmount": 100000,
      "tier": "diamond",
      "totalEventsCreated": 234
    },
    {
      "walletAddress": "8yRd...",
      "stakedAmount": 75000,
      "tier": "diamond",
      "totalEventsCreated": 189
    }
  ]
}

Slashing

What is Slashing?

Staked tokens can be slashed for:
  • Creating fraudulent events
  • Manipulating prediction outcomes
  • Violating platform rules
  • Abandoning events without resolution
Slashed tokens are permanently removed from your stake and cannot be recovered.

Slash Protection

Avoid slashing by:
  1. Honest Event Creation: Create legitimate prediction events
  2. Timely Resolution: Resolve events promptly after conclusion
  3. Fair Pricing: Set reasonable entry fees and rewards
  4. Community Standards: Follow platform guidelines

Staking History

Track your staking activity:
const response = await fetch(
  `https://api.syraa.fun/v1/prediction-game/staking/${walletAddress}`
);

const { stakingHistory } = await response.json();
History Entry Structure:
[
  {
    "type": "stake",
    "amount": 2500,
    "timestamp": "2026-02-15T10:00:00Z",
    "txSignature": "5xQw...",
    "tierBefore": "bronze",
    "tierAfter": "gold"
  },
  {
    "type": "event_created",
    "timestamp": "2026-02-16T14:30:00Z",
    "eventId": "evt_123"
  },
  {
    "type": "slash",
    "amount": 100,
    "reason": "Event manipulation",
    "timestamp": "2026-02-20T09:00:00Z"
  }
]

Integration Example

import { Connection, PublicKey } from '@solana/web3.js';

class StakingManager {
  constructor(connection, wallet) {
    this.connection = connection;
    this.wallet = wallet;
    this.baseUrl = 'https://api.syraa.fun/v1/prediction-game/staking';
  }

  async getStakingInfo() {
    const response = await fetch(
      `${this.baseUrl}/${this.wallet.publicKey.toString()}`
    );
    return await response.json();
  }

  async stake(amount) {
    // 1. Create and send stake transaction
    const tx = await this.createStakeTransaction(amount);
    const signature = await this.wallet.sendTransaction(tx, this.connection);
    await this.connection.confirmTransaction(signature);

    // 2. Record stake on backend
    const response = await fetch(
      `${this.baseUrl}/${this.wallet.publicKey.toString()}/stake`,
      {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          amount,
          txSignature: signature
        })
      }
    );

    return await response.json();
  }

  async unstake(amount) {
    // 1. Check if unstaking is allowed
    const info = await this.getStakingInfo();
    if (!info.canUnstake.canUnstake) {
      throw new Error(info.canUnstake.reason);
    }

    // 2. Create and send unstake transaction
    const tx = await this.createUnstakeTransaction(amount);
    const signature = await this.wallet.sendTransaction(tx, this.connection);
    await this.connection.confirmTransaction(signature);

    // 3. Record unstake on backend
    const response = await fetch(
      `${this.baseUrl}/${this.wallet.publicKey.toString()}/unstake`,
      {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({
          amount,
          txSignature: signature
        })
      }
    );

    return await response.json();
  }

  async canCreateEvent() {
    const response = await fetch(
      `${this.baseUrl}/${this.wallet.publicKey.toString()}/can-create`
    );
    return await response.json();
  }

  async getTiers() {
    const response = await fetch(`${this.baseUrl}/tiers`);
    return await response.json();
  }

  // Helper methods
  async createStakeTransaction(amount) {
    // Implementation depends on your staking contract
    throw new Error('Implement staking transaction creation');
  }

  async createUnstakeTransaction(amount) {
    // Implementation depends on your staking contract
    throw new Error('Implement unstaking transaction creation');
  }
}

// Usage
const manager = new StakingManager(connection, wallet);

// Check current staking status
const info = await manager.getStakingInfo();
console.log(`Staked: ${info.stakedAmount} SYRA`);
console.log(`Tier: ${info.tier}`);
console.log(`Events today: ${info.eventsCreatedToday}/${info.tierInfo.dailyEvents}`);

// Stake more tokens
if (info.tier !== 'diamond') {
  const result = await manager.stake(10000);
  console.log(result.message);
}

// Check if can create event
const canCreate = await manager.canCreateEvent();
if (canCreate.canCreate) {
  console.log('Ready to create prediction event!');
} else {
  console.log(`Cannot create: ${canCreate.reason}`);
}

Best Practices

Stake in increments to gradually unlock higher tiers while testing the prediction game features.
  1. Start Small: Begin with Bronze tier to learn the system
  2. Plan Ahead: Consider unlock periods before staking large amounts
  3. Daily Limits: Monitor your daily event creation count
  4. Track History: Review staking history for insights
  5. Avoid Slashing: Follow all platform rules to protect your stake

Build docs developers (and LLMs) love