BentoSDK

Enter a tournament

Deposit, enter a bracket tournament, stake match chips, and claim payouts.

By the end: you'll have deposited into a tournament, entered, placed chip picks on match markets, and know how claims work.

Prerequisites

  • tournamentsBaseUrl and tournamentsAuth (JWT from markets eoaLogin)
  • Funded managed account for the buy-in (testnet: auto-mint faucet)
  • Optional onchain for vault deposit

HTTP enter (with tx hash)

const tournament = await sdk.tournaments!.tournaments.getById('tournament-id');

// After on-chain vault deposit for this tournament id
await sdk.tournaments!.tournaments.enter('tournament-id', {
  depositTxHash: '0x…',
  stakeAsset: 'credits', // or 'usdc'
});

On-chain deposit + enter

import { waitForTournamentEntry } from '@bento.fun/sdk';

const res = await sdk.onchain!.depositAndEnterTournament(
  'tournament-id',
  { amountUsdc: '100' }, // body object, not a bare string
);
if (!res.success) throw new Error(res.error);

// `walletAddress` is the wallet you deposited from — my-status is keyed by wallet
await waitForTournamentEntry(() =>
  sdk.tournaments!.tournaments.getMyStatus('tournament-id', walletAddress),
);

Confirm entry and your chip budget:

const status = await sdk.tournaments!.tournaments.getMyStatus('tournament-id', walletAddress);
// status.hasEntry === true
// status.chipsSummary — e.g. { startChips: 1000, chipsStaked, chipsRemaining, … }

After enter: bet on matches with chips

Entering spends credits/USDC into the tournament vault (the buy-in). Playing the bracket uses a separate, virtual chip balance per stage (typically 1000 chips when the stage starts). Chips are not USDC and are not placed with sdk.user.placeBet.

Use submitPicks on a LIVE stage that has OPEN match markets:

const detail = await sdk.tournaments!.tournaments.getById(tournamentId);
const stage = detail.stages.find((s) => s.stageIndex === 1); // or current LIVE stage
const stageId = stage.id;
const markets = stage.markets; // need OPEN markets on the stage

// Default chip rules (tournament config can override):
// - max ~50 chips per pick
// - min ~60 chips total staked across the request
// So you usually need at least two markets (e.g. 30 + 30).
await sdk.tournaments!.tournaments.submitPicks(tournamentId, stageId, {
  picks: [
    { marketId: markets[0].id, side: 0, stakeChips: 30 },
    { marketId: markets[1].id, side: 0, stakeChips: 30 },
  ],
});

const { picks, chipsSummary } =
  await sdk.tournaments!.tournaments.getPicks(tournamentId, stageId);
ConceptDetail
Buy-inCredits/USDC vault deposit + enter
ChipsIn-tournament stake units for match picks (stakeChips)
APIsubmitPicks / getPicks / deletePick
StageMust be LIVE; markets must be OPEN
Not the same asMarkets-host placeBet on a duel

If the stage has no markets yet, the creator/admin adds them (POST /api/tournaments/admin/stages/:stageId/markets) before players can pick. Picks fail with structured errors such as STAGE_NOT_LIVE, TOTAL_STAKE_TOO_LOW, or STAKE_TOO_HIGH.

Claims

// Claim via the orchestrator (getClaimProof -> on-chain claim -> confirmClaim):
await sdk.onchain!.claimTournamentPayout('tournament-id');

// There is no tournaments.claim(); the explicit REST path is getClaimProof + confirmClaim:
// const proof = await sdk.tournaments!.tournaments.getClaimProof('tournament-id');
// ...submit the vault claim tx... then sdk.tournaments!.tournaments.confirmClaim('tournament-id', { wallet, txHash });

On this page