Liquidity Provisioning
Boost
Boost RPCs

Boost RPCs

RPC Parameters

Fee Tier

A 16-bit integer representing the fee in basis points charged by a boost pool.

RPC Methods

cf_boost_pools_depth

Returns a list of available (i.e. ready to be used) amounts for each boost pool.

Parameters:

  • at: Block Hash (Optional) - rpc will be executed against the state of the blockchain at this block; defaults to the hash of the most recent block.

Returns:

A list of items for all existing boost pools, each with the following fields:

  • chain: Chain
  • asset: Asset
  • tier: Fee Tier
  • available_amount: Amount - max amount of asset that the pool can boost at the moment

Example

Requesting available amounts in all boost pools at latest block.

Request:

curl -H "Content-Type: application/json" -d '{
    "id":1,
    "jsonrpc":"2.0",
    "method": "cf_boost_pools_depth",
    "params": []
}' http://localhost:9944

Response:

[
  {
    "chain": "Ethereum",
    "asset": "FLIP",
    "tier": 10,
    "available_amount": "0x33b2e3c9fd0803ce8000000"
  },
  {
    "chain": "Ethereum",
    "asset": "FLIP",
    "tier": 30,
    "available_amount": "0x0"
  }
]
 

cf_boost_pool_details

Provides a more detailed (compared to cf_boost_pools_depth) information about boost pools. Specifically, in addition to the available amounts (that are broken down by accounts that contributed to it), it exposes a list of all pending (i.e. awaiting deposit's finalisation) boosts that the pool participated in, along with the amounts owed to each individual account (the amount they contributed plus fee) from these boosts. Additionally, the response exposes the accounts that no longer wish to continue boosting and the ids of pending deposits boosted by each of them.

Parameters:

  • asset: Asset (Optional): allows filtering the response by pool's asset; returns results for every asset if not provided.
  • at: Block Hash (Optional): rpc will be executed against the state of the blockchain at this block; defaults to the hash of the most recent block.

Returns:

A list of items for each of the queried pools, each containing the following fields:

  • chain: Chain
  • asset: Asset
  • fee_tier: Fee Tier
  • available_amounts - funds contributed by each account that are available for boosting (i.e. not currently used in a pending boost), represented by a list of items containing:
    • account_id: account - identifies boost pool's contributor
    • amount: Amount - account_id's available funds in the pool
  • deposits_pending_finalization - a list of deposits currently awaiting finalisation that the pool contributed to, each containing:
    • deposit_id: number - identifies the boosted deposit
    • owed_amounts: funds that each account is expecting to receive upon the deposit's finalisation, represented by a list of items containing:
      • account_id: account identifies boost pool's contributor
      • amount: Amount - amount to be received by account_id
  • pending_withdrawals - accounts that have requested to "stop boosting", along with the deposits awaiting finalisation they have contributed to, represented by a list of items containing:
    • account_id: account - identifies boost pool's contributor
    • pending_deposits: a list of ids of pending deposits (each represented by number) that account_id contributed to.

Example

Requesting detailed state of each Bitcoin boost pool as of the latest block.

Request:

curl -H "Content-Type: application/json" -d '{
    "id":1,
    "jsonrpc":"2.0",
    "method": "cf_boost_pool_details",
    "params": ["BTC"]
}' http://localhost:9944

Response:

[
  {
    "fee_tier": 10,
    "chain": "Bitcoin",
    "asset": "BTC",
    "available_amounts": [
      {
        "account_id": "5C62Ck4UrFPiBtoCmeSrgF7x9yv9mn38446dhCpsi2mLHiFT",
        "amount": "0x2710"
      }
    ],
    "deposits_pending_finalization": [
      {
        "deposit_id": 0,
        "owed_amounts": [
          {
            "account_id": "5C62Ck4UrFPiBtoCmeSrgF7x9yv9mn38446dhCpsi2mLHiFT",
            "amount": "0xc8"
          },
          {
            "account_id": "5C7LYpP2ZH3tpKbvVvwiVe54AapxErdPBbvkYhe6y9ZBkqWt",
            "amount": "0x7d0"
          }
        ]
      },
      {
        "deposit_id": 1,
        "owed_amounts": [
          {
            "account_id": "5C62Ck4UrFPiBtoCmeSrgF7x9yv9mn38446dhCpsi2mLHiFT",
            "amount": "0x3e8"
          }
        ]
      }
    ],
    "pending_withdrawals": []
  },
  {
    "fee_tier": 30,
    "chain": "Bitcoin",
    "asset": "BTC",
    "available_amounts": [],
    "deposits_pending_finalization": [
      {
        "deposit_id": 0,
        "owed_amounts": [
          {
            "account_id": "5C62Ck4UrFPiBtoCmeSrgF7x9yv9mn38446dhCpsi2mLHiFT",
            "amount": "0x3e8"
          },
          {
            "account_id": "5C7LYpP2ZH3tpKbvVvwiVe54AapxErdPBbvkYhe6y9ZBkqWt",
            "amount": "0x7d0"
          }
        ]
      }
    ],
    "pending_withdrawals": [
      {
        "account_id": "5C62Ck4UrFPiBtoCmeSrgF7x9yv9mn38446dhCpsi2mLHiFT",
        "pending_deposits": [
          0
        ]
      },
      {
        "account_id": "5C7LYpP2ZH3tpKbvVvwiVe54AapxErdPBbvkYhe6y9ZBkqWt",
        "pending_deposits": [
          0
        ]
      }
    ]
  }
]

cf_boost_pool_pending_fees

Provides the amounts that each account will earn in fees from each of the currently pending boosts provided the corresponding deposits get finalised.

Parameters:

  • asset: Asset (Optional): allows filtering the response by pool's asset; returns results for every asset if not provided.
  • at: Block Hash (Optional): rpc will be executed against the state of the blockchain at this block; defaults to the hash of the most recent block.

Returns:

A list of items each containing the following fields:

  • chain: Chain
  • asset: Asset
  • fee_tier: Fee Tier
  • pending_fees - a list of items, each containing:
    • deposit_id: number
    • fees - a list of items, each containing:
      • account_id: account - identifies boost pool's contributor
      • amount: Amount - amount in fees to be credited to account_id upon deposit_id's finalisation

Example

Requesting fees of pending boosts from all pools as of the latest block.

Request:

curl -H "Content-Type: application/json" -d '{
    "id":1,
    "jsonrpc":"2.0",
    "method": "cf_boost_pool_pending_fees",
    "params": []
}' http://localhost:9944

Response:

[
  {
    "fee_tier": 10,
    "chain": "Bitcoin",
    "asset": "BTC",
    "pending_fees": [
      {
        "deposit_id": 0,
        "fees": [
          {
            "account_id": "5C62Ck4UrFPiBtoCmeSrgF7x9yv9mn38446dhCpsi2mLHiFT",
            "amount": "0xa"
          },
          {
            "account_id": "5C7LYpP2ZH3tpKbvVvwiVe54AapxErdPBbvkYhe6y9ZBkqWt",
            "amount": "0x64"
          }
        ]
      },
      {
        "deposit_id": 1,
        "fees": [
          {
            "account_id": "5C62Ck4UrFPiBtoCmeSrgF7x9yv9mn38446dhCpsi2mLHiFT",
            "amount": "0x32"
          }
        ]
      }
    ]
  }
]