Skip to main content

Bitcoin.me DeFi API (1.0.0)

Download OpenAPI specification:Download

REST API for integration with the Bitcoin.me DeFi platform on KleverChain.

This API provides endpoints for:

  • Pools: Query liquidity pools and their details
  • Quotation: Get swap and liquidity quotes
  • Tokens: List available tokens
  • Token Factory: Manage created tokens
  • Portfolio: View wallet balances and positions
  • Rewards: Check reward status
  • Energy: Manage energy positions and KFI locking

Health

API health check

Health Check

Checks the API status.

Responses

Response samples

Content type
application/json
{
  • "status": "OK"
}

Router

Router configuration

Get Router Configuration

Returns the swap router configuration.

Responses

Response samples

Content type
application/json
{
  • "lockedTokenId": "string",
  • "minLockedTokenValue": "string",
  • "minLockPeriodEpochs": "string"
}

Pools

Liquidity pools operations

List All Pools

Lists all available liquidity pools.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Pool Details

Returns the details of a specific pool.

path Parameters
scAddress
required
string

Smart contract address of the pool

Responses

Response samples

Content type
application/json
{
  • "scAddress": "string",
  • "name": "string",
  • "value": "string",
  • "apr": "string",
  • "baseName": "string",
  • "quoteName": "string",
  • "baseAssetId": "string",
  • "quoteAssetId": "string",
  • "baseIconUrl": "string",
  • "quoteIconUrl": "string",
  • "baseTotalStaked": "string",
  • "quoteTotalStaked": "string",
  • "baseTokenPrice": "string",
  • "quoteTokenPrice": "string",
  • "basePriceVariation": "string",
  • "quotePriceVariation": "string",
  • "baseVolume": "string",
  • "quoteVolume": "string",
  • "fees": "string"
}

Get Pool Transactions

Returns the latest swap transactions of a pool.

path Parameters
scAddress
required
string

Smart contract address of the pool

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Quotation

Swap and liquidity quotations

Get Swap Quotation

Gets the swap quotation between two tokens.

Request Body schema: application/json
required
amountIn
required
number

Input token amount

tokenIn
required
string

Input token asset ID

tokenOut
required
string

Output token asset ID

Responses

Request samples

Content type
application/json
{
  • "amountIn": 0,
  • "tokenIn": "string",
  • "tokenOut": "string"
}

Response samples

Content type
application/json
{
  • "tokenIn": "string",
  • "amountIn": "string",
  • "amountInUsd": "string",
  • "tokenOut": "string",
  • "amountOut": "string",
  • "amountOutUsd": "string",
  • "tokenInPrice": "string",
  • "tokenOutPrice": "string",
  • "tokenInPriceUsd": "string",
  • "tokenOutPriceUsd": "string",
  • "tokenInPrecision": 0,
  • "tokenOutPrecision": 0
}

Get Add Liquidity Quotation

Gets the quotation for adding liquidity to a pool.

Request Body schema: application/json
required
amountIn
required
number

Input token amount

tokenIn
required
string

Input token asset ID

tokenOut
required
string

Output token asset ID

Responses

Request samples

Content type
application/json
{
  • "amountIn": 0,
  • "tokenIn": "string",
  • "tokenOut": "string"
}

Response samples

Content type
application/json
{
  • "tokenIn": "string",
  • "amountIn": "string",
  • "amountInUsd": "string",
  • "tokenOut": "string",
  • "amountOut": "string",
  • "amountOutUsd": "string",
  • "tokenInPrice": "string",
  • "tokenOutPrice": "string",
  • "tokenInPriceUsd": "string",
  • "tokenOutPriceUsd": "string",
  • "tokenInPrecision": 0,
  • "tokenOutPrecision": 0
}

Tokens

Token listing

List All Tokens

Lists all tokens available in pools.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Token Factory

Token creation and management

List Factory Tokens

Lists all tokens created in the factory.

Responses

Response samples

Content type
application/json
{
  • "tokens": [
    ]
}

List Tokens by Creator

Lists tokens created by a specific address.

path Parameters
address
required
string

Bech32 address of the creator

Responses

Response samples

Content type
application/json
{
  • "tokens": [
    ]
}

KFI Stats

KFI token statistics

Get KFI Statistics

Returns KFI token statistics.

Responses

Response samples

Content type
application/json
{
  • "iconUrl": "string",
  • "kfiPrice": "string",
  • "abbr": "KFI",
  • "assetId": "KFI"
}

Portfolio

Wallet portfolio and balances

Get Token Balances

Returns the token balances of an address.

path Parameters
address
required
string

Bech32 wallet address

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Full Portfolio

Returns the complete portfolio of an address, including pool positions and token balances.

path Parameters
address
required
string

Bech32 wallet address

Responses

Response samples

Content type
application/json
{
  • "portfolioOverview": {
    },
  • "positions": {
    },
  • "tokenBalances": {
    }
}

Get Close Position Data

Returns the data to close an LP position.

path Parameters
address
required
string

Bech32 wallet address

assetId
required
string

LP token Asset ID

Responses

Response samples

Content type
application/json
{
  • "poolName": "string",
  • "scAddress": "string",
  • "firstTokenAmount": "string",
  • "secondTokenAmount": "string",
  • "firstTokenAmountInUSD": "string",
  • "secondTokenAmountInUSD": "string",
  • "firstTokenIconURL": "string",
  • "secondTokenIconURL": "string",
  • "amount": "string",
  • "amountInUSD": "string"
}

Rewards

Rewards status

Get Rewards Status

Returns the rewards status of an address.

path Parameters
address
required
string

Bech32 wallet address

Responses

Response samples

Content type
application/json
{
  • "isActive": true,
  • "isUpdated": true,
  • "isClaimEnabled": true
}

Energy

Energy management and positions

Get Energy and KFI Balances

Returns the energy and KFI balances of an address.

path Parameters
address
required
string

Bech32 wallet address

Responses

Response samples

Content type
application/json
{
  • "amount": "string",
  • "kfiLocked": "string",
  • "kfiAvailable": "string"
}

Get Energy Removal Penalty

Returns the penalty data for removing energy from a specific asset.

path Parameters
address
required
string

Bech32 wallet address

assetId
required
string

xKFI Asset ID

nonce
required
string

SFT nonce

Responses

Response samples

Content type
application/json
{
  • "removalFee": "string",
  • "removalFeeInUSD": "string"
}

Get Multiple Energy Removal Penalties

Returns the penalty data for removing energy from multiple assets.

Request Body schema: application/json
required
address
required
string

Bech32 wallet address

assetIds
required
Array of strings

List of xKFI asset IDs

Responses

Request samples

Content type
application/json
{
  • "address": "string",
  • "assetIds": [
    ]
}

Response samples

Content type
application/json
{
  • "penaltyEnergyData": [
    ],
  • "energyPositions": [
    ]
}

Get Energy Positions

Returns the user's energy positions.

path Parameters
address
required
string

Bech32 wallet address

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get Unlocked Tokens

Returns the user's unlocked tokens.

path Parameters
address
required
string

Bech32 wallet address

Responses

Response samples

Content type
application/json
[
  • {
    }
]