API Standard
API Example
GET
https://devopen.sixpencer.com/v1/defi/getcommpound
Path Parameters
lang
string
language of return data, eg: en,cn
chain
string
blockchain, eg:eth,bsc,eos,wax...
addr
string
user address
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".
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
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.
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.
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.
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.
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
Last updated
Was this helpful?