DolphinSwap LP Integration
This document aims to introduce the contract table structure of DolphinSwap, to make it easier to be integrated by 3rd parties.
Contract account
DolphinSwap contract:dolphinsswap
Check details on bloks:view
Basic Type
pooltoken
Parameter
Type
Comment
weight
uint32_t
Weight
symbol
extended_symbol
Token, includes contract, symbol and precision
reserve
asset
Token's total amount
Liquidity Pool
Statements
pool table is used to store all trading pairs, it is the core of the contract.
Table Structure
Table: pools
Scope: dolphinsswap
Parameter
Type
Comment
id
uint64_t
Liquidity Pool ID
code
symbol_code
LP token's name,for an example: DOPA
swap_fee
uint16_t
trading fee rate, need to divide by 10000
total_lptoken
uint64_t
total LP token amount
create_time
uint32_t
LP pool created time
last_update_time
uint32_t
last updated time
tokens
std::vector
trading pair list, includes 2 and more tokens
Request Demo:
Lptoken Table
Statements
lptoken table is used to store users' LP
LP Naming Rules
Dolphin Swap LP Tokens all start with DOP, and then add the pool_id of the liquidity pool to convert to a 26 hexadecimal (letter). For example, the liquidity pool ID is 1, and the converted is DOPA. If it is 27, it corresponds to DOPAA, and so on. Code method for converting pool_id into lp code:
Table Structrue
Table: lptokens
Scope: LP token's name,like DOPA
Parameter
Type
Comment
owner
name
Liquidity Provider
token
uint64_t
LP token amount
Request Demo:
Deposit Table
Statements
The deposit table is used to store temporary market-making deposits. The user needs to recharge multiple assets for market-making. This table is used to temporarily record the user's single market-making deposit. The record will be automatically cleared after successful market making.
Table Structrue
Table: deposits
Scope: pool_id
Parameter
Type
Comment
owner
name
liquidity provider
quantities
std::vector
deposited token list
Request Demo:
Last updated
Was this helpful?