Staking

Get stakeholders data

POST https://api.octusbridge.io/v1/staking/search/stakeholders

{
  "stakeholders": [
    {
      "userAddress": "0:2e6d5fcecfcdd36c748de15d1dd7102728b528a3538582aa5a093e6088d79e28",
      "userType": "Relay",
      "stakeBalance": "100000",
      "frozenStakeBalance": "100000",
      "lastReward": "0",
      "totalReward": "0",
      "createdAt": 1654255227000
    },
    ...
     {
      "userAddress": "0:e75a9cdc1058e59d4ceb52f4cb276ee1d7e7f6180aad66e38ee607f9c8ca46d7",
      "userType": "Relay",
      "stakeBalance": "100001",
      "frozenStakeBalance": "100001",
      "lastReward": "1084.475546937000",
      "totalReward": "1084.475546937000",
      "createdAt": 1650297478000
    }
  ],
  "totalCount": 3
}

This function returns stakeholders data based on their addresses, type, time of creation, stake, balance, rewards etc.

It can be used for filtering stakeholders based on required parameters and displaying information about the filtered stakeholders such as time of creation, frozen stake, reward, address, type etc.

Request parameters

Required body parameters:

Response fields explanation

Example

app.post('/staking/search/stakeholders', (req, res) => {
    axios({
        method: 'post',
        url: `${apiUrl}/staking/search/stakeholders`,
        data: {
            createdAtGe: req.body.createdAtGe,
            createdAtLe: req.body.createdAtLe,
            frozenStakeGe: req.body.frozenStakeGe,
            frozenStakeLe: req.body.frozenStakeLe,
            lastRewardGe: req.body.lastRewardGe,
            lastRewardLe: req.body.lastRewardLe,
            limit: req.body.limit,
            offset: req.body.offset,
            ordering: req.body.ordering,
            relayCreatedAtGe: req.body.relayCreatedAtGe,
            relayCreatedAtLe: req.body.relayCreatedAtLe,
            stakeholderAddresses: req.body.stakeholderAddresses,
            stakeholderKind: req.body.stakeholderKind,
            totalRewardGe: req.body.totalRewardGe,
            totalRewardLe: req.body.totalRewardLe,
            untilFrozenGe: req.body.untilFrozenGe,
            untilFrozenLe: req.body.untilFrozenLe,
            userBalanceGe: req.body.userBalanceGe,
            userBalanceLe: req.body.userBalanceLe,
        }
      })
    .then(function (response) {
        res.send(response.data)
    })
    .catch(function(error){
        console.error(error)
        res.send('Error')
    })
})

Get transactions data

POST https://api.octusbridge.io/v1/staking/search/transactions

{
  "transactions": [
    {
      "transactionHash": "1a56f0984d31f42bc29ba4968fe9176eef6183a9e301cf9f942c562eb8dc1046",
      "transactionKind": "Deposit",
      "amountExec": "39.17627067",
      "timestampBlock": 1654509651000
    }
  ],
  "totalCount": 1
}

This function returns list of transactions based on their amount, kind, time of transaction, user that initiated transaction.

It can be used for filtering all transactions from a certain user based on the required parameters and displaying them with data such as total number of transactions, time of transaction, kind, amount, for each one of them.

Request parameters

Required body parameters:

Response fields explanation

Example

app.post('/staking/search/transactions', (req, res) => {
    axios({
        method: 'post',
        url: `${apiUrl}/staking/search/transactions`,
        data: {
            amountGe: req.body.amountGe,
            amountLe: req.body.amountLe,
            limit: req.body.limit,
            offset: req.body.offset,
            ordering: req.body.ordering,
            timestampBlockGe: req.body.timestampBlockGe,
            timestampBlockLe: req.body.timestampBlockLe,
            transactionKind: req.body.transactionKind,
            userAddress: req.body.userAddress,
        }
      })
    .then(function (response) {
        res.send(response.data)
    })
    .catch(function(error){
        console.error(error)
        res.send('Error')
    })
})

Get main page data

GET https://api.octusbridge.io/v1/staking/main

{
  "tvl": "2941620.097043126000",
  "tvlChange": "0.0500",
  "reward30d": "0",
  "reward30dChange": "0",
  "averageApr": "0",
  "stakeholders": 127
}

This function returns all the data necessary for staking.

It can be used for displaying information interesting for stakeholders, such as average annual percentage rate, monthly reward, monthly reward change, total value locked and it’s change and number of stakeholders.

Request parameters

No required parameters

Response fields explanation

Example

app.get('/staking/main', (req, res) => {
    axios({
        method: 'get',
        url: `${apiUrl}/staking/main`
      })
    .then(function (response) {
        res.send(response.data)
    })
    .catch(function(error){
        console.error(error)
        res.send('Error')
    })
})

Post user page data

POST https://api.octusbridge.io/v1/staking

{
  "userTvl": "100",
  "userTvlChange": "0",
  "userFrozenStake": "0",
  "user30dReward": "0.534055306000",
  "user30dRewardChange": "0",
  "averageApr": "0"
}

This function returns staking data unique for a user based on its address.

It can be used for showing to a user his personal staking page with information about average percentage rate, his reward for the last month and monthly reward change, frozen stake, user’s tvl and tvl change.

Request parameters

Required body parameters:

Response fields explanation

Example

app.post('/staking', (req, res) => {
    axios({
        method: 'post',
        url: `${apiUrl}/staking`,
        data: {
            userAddress: req.body.userAddress
        }
      })
    .then(function (response) {
        res.send(response.data)
    })
    .catch(function(error){
        console.error(error)
        res.send('Error')
    })
})

Last updated