⚡Earn feature API
Chainge Finance Earn is a feature rewarding users who deposit certain assets as liquidity.
Base url : https://api2.chainge.finance
GET /v1/getRewardConfig
This API retrieves some basic configuration information for the EARN module, primarily including the APY (Annual Percentage Yield) for EARN on FSN, KOINOS and ROLLUX, as well as the reward distribution account addresses.
Header
Fields
Description
Query Params
Fields
Description
Response
Fields
Description
apys
List of APYs that support tokens
koin_reward_valut
KOIN reward pool address
rollux_reward_vault
ROLLUX reward pool address
apys:
token
Token Symbol
apy
Annual Percentage Yield
blocknumber
Block Height
startbn
Starting Block Height
chain
Target Chain Name
extra
Reserved field on FSN. rate;rewardAmount on Koinos, Rollux
total_income
Total Injection Amount of the Reward Pool
total_reward
Total Rewards Claimed
GET /v1/queryFSNReward
This API returns reward information for the current user's current token on fusion chain
*The returned result needs to be processed using the appropriate token decimals
Header
Fields
Description
Query Params
Fields
Description
token
Required. Token contract address
address
Required. User address
Response
Fields
Description
balance
Token balance, which is inaccurate because of the cache, is not recommended to use this field directly
claimable
Number of rewards available to claim
extraAmount
Reserved field
totalCliamed
Total amount of rewards claimed
totalCliamedExtra
Reserved field
GET /v1/queryKoinReward
This API returns reward information for the current user's current token on koinos chain
*The returned result needs to be processed using the appropriate token decimals
Header
Fields
Description
Query Params
Fields
Description
token
Required. Token contract address
address
Required. User address
Response
Fields
Description
balance
Token balance, which is inaccurate because of the cache, is not recommended to use this field directly
claimable
Number of rewards available to claim
extraAmount
Number of KOIN rewards available to claim
totalCliamed
Total amount of rewards claimed
totalCliamedExtra
Total amount of rewards claimed for koin
GET /v1/queryFSNRewardAll
This API returns reward information for the current user on fusion chain
*The returned result needs to be processed using the appropriate token decimals
Header
Fields
Description
Query Params
Fields
Description
address
Required. User address
Response
Fields
Description
[symbol]
Supported token symbols. Example:
{
…
"BTC": {
"balance": "0",
"totalCliamed": "0",
"totalCliamedExtra": "0",
"claimable": "0",
"extraAmount": "0"
},
…
}
[symbol]
balance
Token balance, which is inaccurate because of the cache, is not recommended to use this field directly
claimable
Number of rewards available to claim
extraAmount
Number of KOIN rewards available to claim
totalCliamed
Total amount of rewards claimed
totalCliamedExtra
Reserved field
GET /v1/queryKoinRewardAll
This API returns reward information for the current user on koinos chain
*The returned result needs to be processed using the appropriate token decimals
Header
Fields
Description
Query Params
Fields
Description
address
Required. User address
Response
Fields
Description
[symbol]
Supported token symbols. Example:
{
…
"BTC": {
"balance": "0",
"totalCliamed": "0",
"totalCliamedExtra": "0",
"claimable": "0",
"extraAmount": "0"
},
…
}
[symbol]
balance
Token balance, which is inaccurate because of the cache, is not recommended to use this field directly
claimable
Number of rewards available to claim
extraAmount
Number of KOIN rewards available to claim
totalCliamed
Total amount of rewards claimed
totalCliamedExtra
Total amount of rewards claimed for koin
GET /v1/queryRolluxRewardAll
This API returns reward information for the current user on Syscoin Rollux chain
*The returned result needs to be processed using the appropriate token decimals
Header
Fields
Description
Query Params
Fields
Description
address
Required. User address
Response
Fields
Description
[symbol]
Supported token symbols. Example:
{
…
"BTC": {
"balance": "0",
"totalCliamed": "0",
"totalCliamedExtra": "0,0",
"claimable": "0",
"extraAmount": "0,0"
},
…
}
[symbol]
balance
Token balance, which is inaccurate because of the cache, is not recommended to use this field directly
claimable
Number of rewards available to claim
extraAmount
Number SYS,SUPR of rewards available to claim. This field describes the number of token types you can choose from, formatted as SYS,SUPR, separated by a comma (’,’). You can only select one to claim.
totalCliamed
Total amount of rewards claimed
totalCliamedExtra
Total amount of rewards claimed. The format is SYS,SUPR, separated by a comma (’,’), and please ensure that the token type is the same as the one selected for extraAmount.
*Note that when you call queryFSNReward or queryFSNRewardAll in FSN, queryRolluxRewardAll in Rollux, or queryKoinReward or queryKoinRewardAll in Koinos, rewards can only be claimed when the claimable amount in the results is greater than 0."
Claim Reward
On Fusion:
On the Fusion chain, claiming rewards is done by invoking a contract. The contract address is: 0x0985d161a36730ef0315ead01ad3ad644c56d035, and the claim method is: claimRewards. The parameter for the claimRewards method is the contract address of the token to be claimed.
example: https://github.com/codedfi/dappApiDemo/blob/main/src/earn/claimFsn.js
On Koinos:
On the Koinos chain, claiming rewards is done by sending a transaction to the official address. The official address is: 19fmPgUGbTwXVUfP24wnYNsra7JDDNSHMC.
You need to send a transaction of 0 VHP to the official address and include a memo. The memo contains details about the claimable tokens. An example of the memo is: USDT_10000:KOIN_200000. The format is [claimable symbol]_[claimable amount (BigInt)].
vhp address: 18tWNU7E4yuQzz7hMVpceb9ixmaWLVyQsr
When performing a claim on the KOIN chain, you need to pay attention to the following information:
When the main token(BTC, ETH, DAI on koinos) in the vault is NOT enough to claim, claiming is prohibited.
When the partner token(KOIN) in the vault is NOT enough to claim, claiming is possible, but KOIN will be lost.
example: https://github.com/codedfi/dappApiDemo/blob/main/src/earn/claimKoin.js
On Syscoin Rollux:
On the Syscoin Rollux chain, claiming rewards is done by sending a transaction to the official address. The official address is: 0x127e7766F65C7A35E73177AA104999A189048E9D.
You need to send a transaction of 0 SYS to the official address and include a memo. The memo contains details about the claimable tokens. An example of the memo is: USDT_10000:SYS_200000 or USDT_10000:SUPR_200000. The format is [claimable symbol]_[claimable amount (BigInt)].
When performing a claim on the Rollux chain, you need to pay attention to the following information:
When the main token(BTC, ETH, USDT, USDC on Rollux) in the vault is NOT enough to claim, claiming is prohibited.
When the partner token(SYS or SUPR) in the vault is NOT enough to claim, claiming is possible, but SYS or SUPR will be lost.
example: https://github.com/codedfi/dappApiDemo/blob/main/src/earn/claimRollux.js
Last updated