πŸ‘¨β€πŸ’»Developer Integration

This guide provides the contract addresses, interfaces, and API endpoints needed to integrate with Stimpak Duels programmatically.

Contract Addresses

Arbitrum Mainnet (Chain ID: 42161)

Contract Source Code: github.com/stimpak-io/stimpak-duels-contractsarrow-up-right

Supported Markets


Core Interfaces

Creating a Duel

Duels are created through the CompetitionHub contract. There are two types:

1. Head-to-Head (H2H) Duel

2. Deathmatch (Multi-player)


Joining a Duel

Note: Before joining, users must approve the CompetitionHub to spend their USDC:


Trading in a Duel

Once joined, each participant gets a Trader contract deployed for them. Trading is done through this contract.

Open a Position

Close a Position

Cancel an Order

Note: Trading functions require ETH for GMX execution fees (typically 0.0001-0.001 ETH).


Reading Duel Data

Get Competition Data

Get Participant's Trader Contract


Competition Status Codes

Status
Value
Description

Awaiting Opponent

0

H2H waiting for opponent

Registration Open

1

Deathmatch accepting entries

Active

2

Trading is live

Ended

3

Trading complete, awaiting finalization

Finalized

4

Winner determined, prizes distributed

Cancelled

5

Duel cancelled, refunds available

Elapsed

6

Expired without sufficient participants

No Contest

7

Ended with no valid trades


Example Integration (ethers.js v6)


REST API

Stimpak Duels provides a REST API for querying duel data programmatically. API keys are available by request - contact the Stimpak team to get access.

Base URL

Production: https://api-duels.stimpak.io/api/v1

Authentication

All API requests require an API key passed in the Authorization header:

Endpoints

Get All Duels

Returns a paginated list of all duels.

Query Parameters:

Parameter
Type
Default
Description

page

number

1

Page number

limit

number

20

Items per page (max 100)


Get Open Duels

Returns duels that are currently open for registration (status: Awaiting Opponent or Registration Open).


Get Active Duels

Returns duels that are currently in progress (status: Active or Ended).


Get Finalized Duels

Returns completed duels (status: Finalized).


Get Duel Details

Returns detailed information about a specific duel.

Response:


Get Your Position

Returns your entry and current position in a specific duel.

Response:


Get Leaderboard

Returns the current leaderboard for a duel.

Query Parameters:

Parameter
Type
Default
Description

include_positions

boolean

false

Include open position details

limit

number

20

Number of entries to return

Response:


Error Responses

All errors follow this format:

Status Code
Error
Description

401

unauthorized

Invalid or missing API key

404

not_found

Duel not found

429

rate_limited

Too many requests


Signature Requirements

Backend signatures are required for:

  • Finalization of competitions

  • Joining private (protected) competitions

Public competitions can be created and joined without a signature. Contact the Stimpak team for API access to obtain signatures programmatically.

Signature Format

The signature validates:

  • User address

  • Competition parameters

  • Nonce (to prevent replay attacks)

  • Expiration timestamp


Resources


Events to Listen For

Last updated