API Standard

get
API Example

https://devopen.sixpencer.com/v1/defi/getcommpound
Request
Response
Request
Path Parameters
lang
optional
string
language of return data, eg: en,cn
chain
required
string
blockchain, eg:eth,bsc,eos,wax...
addr
required
string
user address
Response
200: OK
{
"code": 0,
"data": {
"projectName": "Compound",
"projectLogo": "https://sixpencer.com/Compound.png",
"Borrow": [
{
"symbol": "ETH",
"amount": 7.332935638164213e-10,
"valuation": 8.626172167310852e-7,
"logo": "https://sixpencer.com/1027.png",
"price": 1176.36,
"contract": "0x0000000000000000000000000000000000000000",
"tags":"borrow eth",
"symbolName": "Ethereum"
}
],
"Deposit": [
{
"symbol": "DAI",
"amount": 2.098719990813386,
"valuation": 2.11970719072152,
"mortgage": true,
"logo": "https://sixpencer.com/4943.png",
"price": 1.01,
"tags":"deposit dai",
"contract": "0x6b175474e89094c44da98b954eedeac495271d0f",
"symbolName": "Dai Stablecoin"
}
],
"Mine": [
{
"symbol": "COMP",
"amount": 0.00006285895636280487,
"valuation": 0.012478760017144023,
"logo": "https://sixpencer.com/Compound.png",
"price": 198.52,
"tags": "fee reward",
"contract": "0xc00e94cb662c3520282e6f5717214004a7f26888",
"symbolName": "Compound"
}
],
"Pool": [
{
"poolId": 530,
"symbol0": "BASE",
"symbol1": "WETH",
"amount0": 1.1097,
"amount1": 0.0008,
"symbol0Name": "Base Protocol",
"symbol1Name": "Wrapped Ether",
"price0": 0.914147,
"price1": 1171.94,
"valuation": 2.0288578518,
"tags":"BASE-WETH pool",
"logo0": "https://sixpencer.com/7838.png",
"logo1": "https://sixpencer.com/2396.png",
"contract0": "0x07150e919b4de5fd6a63de1f9384828396f25fdc",
"contract1": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}
]
},
"message": "success"
}

Response Fields

Field

Description

code

the response status code. 0 means success.

data

main data of the api. Please see below for details.

message

a brief human-readable message explaining the error

Data Fields

Please go through the details below to determine fields that can best show a user's portfolio. To get your project integrated, you need to provide at least one field from "Deposit", "Borrow", "Mine" and "Pool".

Example:

Compound, a lending protocol, contains "Deposit", "Borrow" and "Mine" data. "Pool" data is added to the API example for demonstration purposes only.

Field

Description

Required

projectName

project name

yes

projectLogo

project logo

yes

Deposit

user's deposit data.

no

Borrow

user's loan data

no

Mine

user's yield farming data

no

Pool

user's liquidity position data

no

{
"code": 0,
"data": {
"projectName": "Compound",
"projectLogo": "https://sixpencer.com/Compound.png",
"Borrow": [
{
"symbol": "ETH",
"amount": 7.332935638164213e-10,
"valuation": 8.626172167310852e-7,
"logo": "https://sixpencer.com/1027.png",
"price": 1176.36,
"contract": "0x0000000000000000000000000000000000000000",
"tags":"borrow eth",
"symbolName": "Ethereum"
}
],
"Deposit": [
{
"symbol": "DAI",
"amount": 2.098719990813386,
"valuation": 2.11970719072152,
"mortgage": true,
"logo": "https://sixpencer.com/4943.png",
"price": 1.01,
"tags":"deposit dai",
"contract": "0x6b175474e89094c44da98b954eedeac495271d0f",
"symbolName": "Dai Stablecoin"
}
],
"Mine": [
{
"symbol": "COMP",
"amount": 0.00006285895636280487,
"valuation": 0.012478760017144023,
"logo": "https://sixpencer.com/Compound.png",
"price": 198.52,
"tags": "fee reward",
"contract": "0xc00e94cb662c3520282e6f5717214004a7f26888",
"symbolName": "Compound"
}
],
"Pool": [
{
"poolId": 530,
"symbol0": "BASE",
"symbol1": "WETH",
"amount0": 1.1097,
"amount1": 0.0008,
"symbol0Name": "Base Protocol",
"symbol1Name": "Wrapped Ether",
"price0": 0.914147,
"price1": 1171.94,
"valuation": 2.0288578518,
"tags":"BASE-WETH pool",
"logo0": "https://sixpencer.com/7838.png",
"logo1": "https://sixpencer.com/2396.png",
"contract0": "0x07150e919b4de5fd6a63de1f9384828396f25fdc",
"contract1": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}
]
},
"message": "success"
}

Pool

The Pool section shows a user's active liquidity position. At the moment, we only support liquidity pools that contain two tokens as seen in most DEX/AMMs such as Uniswap. If your protocol supports liquidity pools that contain more than two tokens, you can display active liqudity position with LP token in Deposit section instead.

"Pool": [
{
"poolId": 530,
"symbol0": "BASE",
"symbol1": "WETH",
"amount0": 1.1097,
"amount1": 0.0008,
"symbol0Name": "Base Protocol",
"symbol1Name": "Wrapped Ether",
"price0": 0.914147,
"price1": 1171.94,
"valuation": 2.0288578518,
"tags":"BASE-WETH pool",
"logo0": "https://sixpencer.com/7838.png",
"logo1": "https://sixpencer.com/2396.png",
"contract0": "0x07150e919b4de5fd6a63de1f9384828396f25fdc",
"contract1": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
}
]

Field

Type

Description

Required

poolId

Int

pool id

no

symbol0

String

token symbol0 in a pair

yes

symbol1

String

token symbol1 in a pair

yes

amount0

Float

token balance of symbol0

yes

amount1

Float

token balance of symbol1

yes

price0

Float

symbol0 token price in USD

yes

price1

Float

symbol1 token price in USD

yes

valuation

Float

liquidity value in USD (amount0*price0+amount1*price1)

yes

logo0

String

symbol0 token logo

yes

logo1

String

symbol1 token logo

yes

contract0

String

symbol0 contract address

yes

contract1

String

symbol1 contract address

yes

symbolName0

String

symbol0 token name

no

symbolName1

String

symbol1 token name

no

tags

String

additional info, such as pool share and allocation (less than 20 characters, support multiple language "lang")

no

Deposit

The Deposit section shows a user's deposit data. For lending protocols, yield optimizers, synthetic assets platforms, insurance protocols and other DeFi protocols, it is ideal to display underlying tokens supplied or LP token staked in the protocol under deposit section.

"Deposit": [
{
"symbol": "DAI",
"amount": 2.098719990813386,
"valuation": 2.11970719072152,
"mortgage": true,
"logo": "https://sixpencer.com/4943.png",
"price": 1.01,
"tags":"deposit dai",
"contract": "0x6b175474e89094c44da98b954eedeac495271d0f",
"symbolName": "Dai Stablecoin"
}
]

Field

Type

Description

Required

symbol

String

token symbol

yes

amount

Float

current token balance in the protocol(Note: interest can be included OR displayed separately)

yes

price

Float

token price in USD

yes

valuation

Float

value in USD (amount*price)

yes

mortgage

Bool

collateral status (true = token supplied as a collateral, otherwise false)

yes

logo

String

token logo

yes

contract

String

token contract address

yes

symbolName

String

token name

no

tags

String

additional info, such as APY (less than 20 characters, support multiple language"lang")

no

Borrow

The Borrow section shows a user's loan data. For lending protocols and other defi platforms with lending services, it is ideal to display all outstanding borrows with accumulated interest under this section.

"Borrow": [
{
"symbol": "ETH",
"amount": 7.332935638164213e-10,
"valuation": 8.626172167310852e-7,
"logo": "https://sixpencer.com/1027.png",
"price": 1176.36,
"tags":"borrow eth",
"contract": "0x0000000000000000000000000000000000000000",
"symbolName": "Ethereum"
}
]

Field

Type

Description

Required

symbol

String

token symbol

yes

amount

Float

current borrow balance in the protocol (Note: interest can be included Or displayed separately)

yes

price

Float

token price in USD

yes

valuation

Float

value in USD (amount*price)

yes

logo

String

token logo

yes

contract

String

token contract address

yes

symbolName

String

token name

no

tags

String

additional info, such as health factor or C-ratio (less than 20 characters, support multiple language"lang")

no

Mine

The Mine section shows a user's yield farming data. It is ideal to display all tokens earned but not yet claimed as a result of yield farming in DeFi protocols.

"Mine": [
{
"symbol": "COMP",
"amount": 0.00006285895636280487,
"valuation": 0.012478760017144023,
"logo": "https://sixpencer.com/Compound.png",
"price": 198.52,
"tags": "fee reward",
"contract": "0xc00e94cb662c3520282e6f5717214004a7f26888",
"symbolName": "Compound"
}
]

Field

Type

Description

Required

symbol

String

token symbol

yes

amount

Float

current token balance earned in the protocol

yes

valuation

Float

value in USD(amount*price)

yes

price

Float

token price in USD

yes

logo

String

token logo

yes

contract

String

token contract address

yes

symbolName

String

token name

no

tags

String

additional info, such as pool info(less than 20 characters, support multiple language"lang")

no