Calculate Score
Calculate tournament score based on raw game points and NFT drop counts.
Endpoint
POST /api/v2/tournament/{id}/calculateScore
Authentication
This endpoint is public and does not require authentication.
Description
This endpoint calculates a tournament score based on raw game points and owned NFT drops. The system applies multipliers based on the player's NFT holdings to determine the final tournament score.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique identifier for the tournament |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
rawGamePoint | number | Yes | Raw game points before multipliers |
drops | array | Yes | Array of owned NFT drop count objects |
Drop Count Object Fields
| Field | Type | Required | Description |
|---|---|---|---|
dropId | string | Yes | Unique identifier for the NFT drop |
counts | number[] | Yes | Array of counts for different rarities |
Request Example
{
"rawGamePoint": 1500,
"drops": [
{
"dropId": "drop-123",
"counts": [5, 2, 1]
},
{
"dropId": "drop-456",
"counts": [10, 0, 0]
}
]
}
Response
Success Response (200)
{
"multiplier": 2.5,
"score": 3750
}
Error Response (404)
{
"message": "Tournament not found",
"status": 404
}
Error Response (400)
{
"message": "Invalid request payload",
"status": 400
}
Response Fields
| Field | Type | Description |
|---|---|---|
multiplier | number | Applied multiplier based on NFT holdings |
score | number | Final calculated score (rawGamePoint * multiplier) |
Usage Example
const response = await fetch("https://api.intraverse.io/api/v2/tournament/tournament-123/calculateScore", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
rawGamePoint: 1500,
drops: [
{
dropId: "drop-123",
counts: [5, 2, 1], // 5 common, 2 rare, 1 legendary
},
{
dropId: "drop-456",
counts: [10, 0, 0], // 10 common, 0 rare, 0 legendary
},
],
}),
});
const result = await response.json();
console.log(`Applied multiplier: ${result.multiplier}`);
console.log(`Raw game points: 1500`);
console.log(`Final tournament score: ${result.score}`);
// Example calculation: 1500 * 2.5 = 3750
Request Examples
Player with Multiple Drops
{
"rawGamePoint": 2000,
"drops": [
{
"dropId": "legendary-weapons",
"counts": [2, 1, 1] // 2 common, 1 rare, 1 legendary
},
{
"dropId": "character-skins",
"counts": [5, 0, 0] // 5 common skins only
},
{
"dropId": "power-ups",
"counts": [0, 3, 2] // 0 common, 3 rare, 2 legendary
}
]
}
Player with No NFTs
{
"rawGamePoint": 1000,
"drops": []
}
Player with Single Drop Type
{
"rawGamePoint": 1500,
"drops": [
{
"dropId": "starter-pack",
"counts": [10] // 10 NFTs from a single-rarity drop
}
]
}
Score Calculation
The tournament score calculation works as follows:
- Raw Game Points: The base points earned from gameplay
- NFT Multipliers: Each owned NFT drop contributes to a multiplier based on:
- Number of NFTs owned from each drop
- Rarity of the owned NFTs (represented by the counts array)
- Tournament-specific multiplier rules
- Final Score:
rawGamePoint × multiplier = score
How Drop Counts Work
The counts array represents the number of NFTs owned for each rarity level:
counts[0]: Number of common NFTs ownedcounts[1]: Number of rare NFTs ownedcounts[2]: Number of legendary NFTs owned- etc. (based on the drop's rarity structure)
Error Handling
| Error | Description | Solution |
|---|---|---|
| Tournament not found | Tournament ID doesn't exist | Check tournament ID |
| Invalid request | Request payload is malformed | Verify request body structure |
| Invalid rawGamePoint | Game points are negative/NaN | Use valid positive numbers |
| Invalid drop counts | Counts array contains NaN | Ensure all counts are numbers |