Introduction
Tokens in the swap.coffee platform can have associated staking pools. The staking pool information is represented by thestakingPool
object, which contains details about the staking pool, such as the address, name, APY, and other relevant information.
Currently, we collect staking information for the following tokens:
- hTON (Hipo Staked TON) - https://hipo.finance
- tsTON (Tonstakers) - https://tonstakers.com
- stTON (Bemo) - https://bemo.fi
Fields Description
Field | Type | Required | Description |
---|---|---|---|
id | integer | Yes | Unique identifier of the staking pool |
address | string | Yes | The blockchain address of the staking pool contract |
name | string | Yes | The name of the staking pool |
url | string | No | URL to the staking pool’s website or documentation |
description | string | No | A description of the staking pool, its features, and benefits |
minimum_deposit_ton | number | No | The minimum amount of TON that can be staked in this pool |
apy | number | No | Annual Percentage Yield - the expected yearly return from staking in this pool |
exchange_rate | number | Yes | The exchange rate between the staked token and the received token (e.g., TON to liquid staking token) |
cycle_end | integer | No | Unix timestamp indicating when the current staking cycle ends |
Transaction Builder API
swap.coffee provides API endpoints for building stake and unstake transactions for staked tokens. These functionality eliminate the need for users to manually construct transactions.Stake Transactions
To build a transaction for staking TON tokens, use the following endpoint:Request Parameters
The stake transaction endpoint requires a JSON request body with the following parameters:Field | Type | Required | Description |
---|---|---|---|
sender_address | string | Yes | The address of the sender who will sign and send the transaction |
amount | number | Yes | The amount of TON tokens to stake |
token_address | string | Yes | The address of the staking pool token (e.g., stTON, hTON, tsTON) |
referral_name | string | No | Optional referral name for tracking purposes |
Example Request
Response Structure
The endpoint returns a response with the following structure:Field | Type | Required | Description |
---|---|---|---|
payload_cell | string (base64) | Yes | Base64-encoded cell that is treated as a payload field in TonConnect transaction |
address | string | Yes | The address of the contract to interact with |
value | string (int128) | Yes | Amount of nanotons to be sent with the transaction |
state_init | string (base64) | No | Optional base64-encoded cell that is treated as a stateInit field in TonConnect transaction |
Example Response
Unstake Transactions
To build a transaction for unstaking TON tokens, use the following endpoint:Request Parameters
The unstake transaction endpoint requires a JSON request body with the following parameters:Field | Type | Required | Description |
---|---|---|---|
sender_address | string | Yes | The address of the sender who will sign and send the transaction |
amount | number | Yes | The amount of staked tokens to unstake |
token_address | string | Yes | The address of the staking pool token (e.g., stTON, hTON, tsTON) |
referral_name | string | No | Optional referral name for tracking purposes |
Example Request
Response Structure
The endpoint returns a response with the following structure:Field | Type | Required | Description |
---|---|---|---|
payload_cell | string (base64) | Yes | Base64-encoded cell that is treated as a payload field in TonConnect transaction |
address | string | Yes | The address of the contract to interact with |
value | string (int128) | Yes | Amount of nanotons to be sent with the transaction |
state_init | string (base64) | No | Optional base64-encoded cell that is treated as a stateInit field in TonConnect transaction |