Skip to main content

Staking API

Endpoints for retrieving QSN protocol staking information, staking pool listings, and user staking positions.

QSN Protocol Staking Info

GET /api/staking/qsn

Returns global staking metrics for the QSN token.

Query Parameters:

ParameterTypeDescription
chain_idintegerTarget chain ID

Response:

{
"success": true,
"data": {
"total_staked": "15000000.00",
"tvl_usd": 4500000.00,
"apy": 24.5,
"reward_rate": "0.0685",
"reward_token": "QSN",
"stakers_count": 1240
}
}

User QSN Staking Position

GET /api/staking/qsn/{wallet}

Returns the staking position for a specific wallet in the QSN protocol staking contract.

Path Parameters:

ParameterTypeDescription
walletstringUser wallet address

Query Parameters:

ParameterTypeDescription
chain_idintegerTarget chain ID

Response:

{
"success": true,
"data": {
"wallet": "0x...",
"staked_amount": "50000.00",
"staked_value_usd": 15000.00,
"pending_rewards": "342.56",
"pending_rewards_usd": 102.77,
"staked_at": 1700000000
}
}

List Staking Pools

GET /api/staking/pools

Returns all open staking pools created through the staking factory.

Query Parameters:

ParameterTypeDescription
chain_idintegerTarget chain ID

Response:

{
"success": true,
"data": [
{
"address": "0x...",
"stake_token": { "address": "0x...", "symbol": "WETH" },
"reward_token": { "address": "0x...", "symbol": "QSN" },
"tvl_usd": 850000.00,
"apy": 32.1,
"reward_rate": "0.105",
"duration_days": 90,
"ends_at": 1710000000
}
]
}

Staking Pool Detail

GET /api/staking/pools/{address}

Returns detailed information for a specific staking pool.

Path Parameters:

ParameterTypeDescription
addressstringStaking pool contract address

Response:

{
"success": true,
"data": {
"address": "0x...",
"stake_token": { "address": "0x...", "symbol": "WETH", "decimals": 18 },
"reward_token": { "address": "0x...", "symbol": "QSN", "decimals": 18 },
"tvl_usd": 850000.00,
"total_staked": "262.45",
"apy": 32.1,
"reward_rate": "0.105",
"duration_days": 90,
"starts_at": 1702000000,
"ends_at": 1710000000,
"stakers_count": 87
}
}

User Position in Staking Pool

GET /api/staking/pools/{address}/user/{wallet}

Returns a user's position in a specific staking pool.

Path Parameters:

ParameterTypeDescription
addressstringStaking pool contract address
walletstringUser wallet address

Response:

{
"success": true,
"data": {
"pool_address": "0x...",
"wallet": "0x...",
"staked_amount": "5.25",
"staked_value_usd": 17039.77,
"pending_rewards": "1250.00",
"pending_rewards_usd": 375.00,
"staked_at": 1703000000
}
}