Core Engine (1.0.0)

Download OpenAPI specification:Download

Core Engine

direct

Direct API for gateway

admin

Admin API

Update user

Request Body schema: application/json
required
uid
string (UserId)
levelId
string (FeeLevel)
status
string (UserStatus)
Enum: "ACTIVE" "SUSPENDED"

Responses

Request samples

Content type
application/json
{
  • "uid": "1727077698601001",
  • "levelId": "0",
  • "status": "ACTIVE"
}

Create latest snapshot

Responses

Response samples

Content type
application/json
{
  • "snapshotId": "string"
}

Create asset

Request Body schema: application/json
required
name
string (AssetName)

asset name, 大小写英文字母, 字段值要求唯一, 比如 "stETH", "WBTC"

onChainDecimal
string

必须 >= 0, 对应链上的 decimal() 方法返回, int32

decimal
string

0 <= decimal <= onChainDecimal, int32

Responses

Request samples

Content type
application/json
{
  • "name": "WBTC",
  • "onChainDecimal": "18",
  • "decimal": "3"
}

Response samples

Content type
application/json
{
  • "assetId": "3"
}

Create or update symbol

Request Body schema: application/json
required
symbolId
string (SpotSymbolId)

值要求唯一, int32

symbolName
string (SpotSymbolName)
baseAssetId
string (AssetId)

字段值要求唯一, int32

quoteAssetId
string (AssetId)

字段值要求唯一, int32

baseDecimal
string <int32>
priceDecimal
string <int32>
makerFeeDiscount
string <int32> [ 0 .. 100 ]

in range [0, 100]

takerFeeDiscount
string <int32> [ 0 .. 100 ]

in range [0, 100]

minTradingSize
string (SpotSymbolSize)
maxTradingSize
string (SpotSymbolSize)
maxPrice
string (SpotSymbolPrice)
status
string (SpotSymbolStatus)
Enum: "ACTIVE" "PAUSED"

Responses

Request samples

Content type
application/json
{
  • "symbolId": "string",
  • "symbolName": "ETHUSDT",
  • "baseAssetId": "3",
  • "quoteAssetId": "3",
  • "baseDecimal": "string",
  • "priceDecimal": "string",
  • "makerFeeDiscount": "string",
  • "takerFeeDiscount": "string",
  • "minTradingSize": "42.24",
  • "maxTradingSize": "42.24",
  • "maxPrice": "1.23",
  • "status": "ACTIVE"
}

Response samples

Content type
application/json
{
  • "symbolId": "string",
  • "symbolName": "ETHUSDT",
  • "baseAssetId": "3",
  • "quoteAssetId": "3",
  • "baseDecimal": "string",
  • "priceDecimal": "string",
  • "makerFeeDiscount": "string",
  • "takerFeeDiscount": "string",
  • "minTradingSize": "42.24",
  • "maxTradingSize": "42.24",
  • "maxPrice": "1.23",
  • "status": "ACTIVE"
}

Create pool

Request Body schema: application/json
symbolId
string (SpotSymbolId)

值要求唯一, int32

poolId
string <int32> (AmmPoolId)
minPrice
string (SpotSymbolPrice)
maxPrice
string (SpotSymbolPrice)
tickSpacing
string (SpotSymbolPrice)
operatorFeeRate
string (FeeRate) [ 0 .. 1 ]

Responses

Request samples

Content type
application/json
{
  • "symbolId": "string",
  • "poolId": "12",
  • "minPrice": "1.23",
  • "maxPrice": "1.23",
  • "tickSpacing": "1.23",
  • "operatorFeeRate": "0.0001"
}

Response samples

Content type
application/json
{
  • "poolId": "12"
}

Create Or Update Chain Info

Request Body schema: application/json
logicalChainId
string <int32> (ChainId)
chainId
string <int32> (ChainId)
vaultAddress
string (Address)
isEnable
boolean

Responses

Request samples

Content type
application/json
{
  • "logicalChainId": "31337",
  • "chainId": "31337",
  • "vaultAddress": "0xC38C2c17fC38fb8fF575BDd3b7fcF04b8274a7B5",
  • "isEnable": true
}

Create Or Update Chain Asset Info

Request Body schema: application/json
logicalChainId
string <int32> (ChainId)
assetId
string (AssetId)

字段值要求唯一, int32

isEnable
boolean

Responses

Request samples

Content type
application/json
{
  • "logicalChainId": "31337",
  • "assetId": "3",
  • "isEnable": true
}

Get Chain Balance

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create Fee Level

Request Body schema: application/json
levelId
string (FeeLevel)
takerFeeRate
string (FeeRate) [ 0 .. 1 ]
makerFeeRate
string (FeeRate) [ 0 .. 1 ]

Responses

Request samples

Content type
application/json
{
  • "levelId": "0",
  • "takerFeeRate": "0.0001",
  • "makerFeeRate": "0.0001"
}

Get Exchange Fee Report

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Collect Exchange Fee

Request Body schema: application/json
adminAddress
string (Address)

Responses

Request samples

Content type
application/json
{
  • "adminAddress": "0xC38C2c17fC38fb8fF575BDd3b7fcF04b8274a7B5"
}

user

Get me

Authorizations:
UserAuth
header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Responses

Response samples

Content type
application/json
{
  • "address": "0xC38C2c17fC38fb8fF575BDd3b7fcF04b8274a7B5",
  • "vesselKey": "0xa33c4f4d9c546b0dd1bb88e5746b3f569b8a9750bac6813875cf5edc22cf599ef8a8110ac7fec9bdea811369cb4588e14e5eec87cbd41c4c39e91b680a9fce7a",
  • "feeLevel": "0",
  • "status": "ACTIVE",
  • "registeredOnChain": false
}

User register signature

query Parameters
chainId
required
string <int32>
header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Responses

Response samples

Content type
application/json
{
  • "message": "string",
  • "signature": "string",
  • "operator": "0xC38C2c17fC38fb8fF575BDd3b7fcF04b8274a7B5"
}

Place order

header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Request Body schema: application/json
required
symbolName
required
string (SpotSymbolName)
timestamp
required
string (Timestamp)

transact time in milliseconds

side
required
string
Enum: "BUY" "SELL"
type
required
string
Enum: "LIMIT" "MARKET"
timeInForce
required
string
Enum: "GTC" "IOC" "FOK"

Required if type = LIMIT

size
required
string (SpotSymbolSize)
price
required
string (SpotSymbolPrice)

Required if type = LIMIT

nonce
required
string (UserNonce)

A unique id among user actions. Automatically generated if not sent. Actions with the same nonce can be accepted only when the previous one is finished, otherwise the action will be rejected.

signature
required
string

Poseidon hash for this order

respType
string
Default: "FULL"
Enum: "FULL" "ACK" "RESULT"

ACK - response with succeeded or not RESULT - ACK + order FULL - ACK + order + trade

Responses

Request samples

Content type
application/json
{
  • "symbolName": "ETHUSDT",
  • "timestamp": "1507725176595",
  • "side": "BUY",
  • "type": "LIMIT",
  • "timeInForce": "GTC",
  • "size": "42.24",
  • "price": "1.23",
  • "nonce": "string",
  • "signature": "string",
  • "respType": "FULL"
}

Response samples

Content type
application/json
{
  • "orderId": "1721801324586001",
  • "symbolName": "ETHUSDT",
  • "nonce": "string",
  • "transactTime": "1507725176595",
  • "price": "1.23",
  • "originSize": "42.24",
  • "type": "LIMIT",
  • "side": "BUY",
  • "timeInForce": "GTC",
  • "takerFeeRate": "0.0001",
  • "makerFeeRate": "0.0001",
  • "executedSize": "42.24",
  • "cumulativeQuoteSize": "42.24",
  • "status": "FILLED",
  • "fills": [
    ]
}

Delete order

Authorizations:
UserAuth
query Parameters
symbolName
required
string (SpotSymbolName)
Example: symbolName=ETHUSDT
orderId
required
string (SpotOrderId)
Example: orderId=1721801324586001

Order ID

header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Responses

Response samples

Content type
application/json
{
  • "orderId": "1721801324586001",
  • "symbolName": "ETHUSDT",
  • "nonce": "string",
  • "transactTime": "1507725176595",
  • "price": "1.23",
  • "originSize": "42.24",
  • "type": "LIMIT",
  • "side": "BUY",
  • "timeInForce": "GTC",
  • "takerFeeRate": "0.0001",
  • "makerFeeRate": "0.0001",
  • "executedSize": "42.24",
  • "cumulativeQuoteSize": "42.24",
  • "status": "FILLED"
}

User all open orders

Authorizations:
UserAuth
query Parameters
symbolName
string
header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Responses

Response samples

Content type
application/json
[
  • {
    }
]

replace order

Authorizations:
UserAuth
header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Request Body schema: application/json
required
symbolName
required
string (SpotSymbolName)
timestamp
required
string (Timestamp)

transact time in milliseconds

side
required
string
Enum: "BUY" "SELL"
type
required
string
Enum: "LIMIT" "MARKET"
timeInForce
string
Enum: "GTC" "IOC" "FOK"

Required if type = LIMIT

size
required
string (SpotSymbolSize)
price
string (SpotSymbolPrice)

Required if type = LIMIT

nonce
string (UserNonce)

A unique id among user actions. Automatically generated if not sent. Actions with the same nonce can be accepted only when the previous one is finished, otherwise the action will be rejected.

signature
required
string

Poseidon hash for this order

respType
required
string
Default: "FULL"
Enum: "FULL" "ACK" "RESULT"

ACK - response with succeeded or not RESULT - ACK + order FULL - ACK + order + trade

oldOrderId
required
string (SpotOrderId)

Order ID

cancelOrderRestriction
required
string
Enum: "NEW_OR_PARTIALLY_FILLED" "ONLY_PARTIALLY_FILLED" "ONLY_NEW"
replaceMode
required
string
Enum: "STOP_ON_FAILURE" "ALLOW_FAILURE"

Responses

Request samples

Content type
application/json
{
  • "symbolName": "ETHUSDT",
  • "timestamp": "1507725176595",
  • "side": "BUY",
  • "type": "LIMIT",
  • "timeInForce": "GTC",
  • "size": "42.24",
  • "price": "1.23",
  • "nonce": "string",
  • "signature": "string",
  • "respType": "FULL",
  • "oldOrderId": "1721801324586001",
  • "cancelOrderRestriction": "NEW_OR_PARTIALLY_FILLED",
  • "replaceMode": "STOP_ON_FAILURE"
}

Response samples

Content type
application/json
{
  • "orderId": "1721801324586001",
  • "symbolName": "ETHUSDT",
  • "nonce": "string",
  • "transactTime": "1507725176595",
  • "price": "1.23",
  • "originSize": "42.24",
  • "type": "LIMIT",
  • "side": "BUY",
  • "timeInForce": "GTC",
  • "takerFeeRate": "0.0001",
  • "makerFeeRate": "0.0001",
  • "executedSize": "42.24",
  • "cumulativeQuoteSize": "42.24",
  • "status": "FILLED",
  • "fills": [
    ]
}

Delete all orders

Authorizations:
UserAuth
query Parameters
symbolName
required
string (SpotSymbolName)
Example: symbolName=ETHUSDT
header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Responses

Withdraw assets

Request Body schema: application/json
required
chainId
string <int32> (ChainId)
assetId
string (AssetId)

字段值要求唯一, int32

amount
string (AssetAmount)

资产数量 in human readable

feeAmount
string (AssetAmount)

资产数量 in human readable

nonce
string (UserNonce)

A unique id among user actions. Automatically generated if not sent. Actions with the same nonce can be accepted only when the previous one is finished, otherwise the action will be rejected.

timestamp
string (Timestamp)

transact time in milliseconds

signature
string

Poseidon hash for this order

Responses

Request samples

Content type
application/json
{
  • "chainId": "31337",
  • "assetId": "3",
  • "amount": "1.23",
  • "feeAmount": "1.23",
  • "nonce": "string",
  • "timestamp": "1507725176595",
  • "signature": "string"
}

Transfer assets

Authorizations:
UserAuth
header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Request Body schema: application/json
required
signature
string
object (TransferMessage)

EIP712 签名信息,所有字段都来源于message的信息,不需要额外的精度转换!!

Responses

Request samples

Content type
application/json
{
  • "signature": "0xabcdefg",
  • "message": {
    }
}

Add liquidity in amm pool

Authorizations:
UserAuth
header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Request Body schema: application/json
required
poolId
string <int32> (AmmPoolId)
tickIndexL
string
tickIndexR
string
baseAssetAmount
string
quoteAssetAmount
string
nonce
string (UserNonce)

A unique id among user actions. Automatically generated if not sent. Actions with the same nonce can be accepted only when the previous one is finished, otherwise the action will be rejected.

timestamp
string (Timestamp)

transact time in milliseconds

signature
string

Responses

Request samples

Content type
application/json
{
  • "poolId": "12",
  • "tickIndexL": "12",
  • "tickIndexR": "20",
  • "baseAssetAmount": "string",
  • "quoteAssetAmount": "string",
  • "nonce": "string",
  • "timestamp": "1507725176595",
  • "signature": "string"
}

Response samples

Content type
application/json
{
  • "baseAssetAmount": "1.23",
  • "quoteAssetAmount": "1.23"
}

Remove liquidity in amm pool

Authorizations:
UserAuth
header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Request Body schema: application/json
required
poolId
string <int32> (AmmPoolId)
tickIndexL
string
tickIndexR
string
baseAssetAmount
string
quoteAssetAmount
string
nonce
string (UserNonce)

A unique id among user actions. Automatically generated if not sent. Actions with the same nonce can be accepted only when the previous one is finished, otherwise the action will be rejected.

timestamp
string (Timestamp)

transact time in milliseconds

signature
string

Responses

Request samples

Content type
application/json
{
  • "poolId": "12",
  • "tickIndexL": "12",
  • "tickIndexR": "20",
  • "baseAssetAmount": "string",
  • "quoteAssetAmount": "string",
  • "nonce": "string",
  • "timestamp": "1507725176595",
  • "signature": "string"
}

Response samples

Content type
application/json
{
  • "baseAssetAmount": "1.23",
  • "quoteAssetAmount": "1.23",
  • "baseAssetFeeAmount": "1.23",
  • "quoteAssetFeeAmount": "1.23"
}

Get user amm positions

Authorizations:
UserAuth
query Parameters
poolId
string
tickL
string

Not necessary, but needs to coexist with tickR

tickR
string

Not necessary, but needs to coexist with tickL

header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Responses

Response samples

Content type
application/json
[
  • {
    }
]

User assets detail

header Parameters
X-VESSEL-UID
required
string

User ID passed from gateway

Responses

Response samples

Content type
application/json
[
  • {
    }
]

public

Spot all symbol price

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Spot symbol price

path Parameters
id
required
string

Responses

Response samples

Content type
application/json
{
  • "symbolId": "string",
  • "symbolName": "ETHUSDT",
  • "lastPrice": "1.23",
  • "bestBidPrice": "1.23",
  • "bestAskPrice": "1.23"
}

Get all symbols

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get symbol by id

path Parameters
symbolId
required
string

Responses

Response samples

Content type
application/json
{
  • "symbolId": "string",
  • "symbolName": "ETHUSDT",
  • "baseAssetId": "3",
  • "quoteAssetId": "3",
  • "baseDecimal": "string",
  • "priceDecimal": "string",
  • "makerFeeDiscount": "string",
  • "takerFeeDiscount": "string",
  • "minTradingSize": "42.24",
  • "maxTradingSize": "42.24",
  • "maxPrice": "1.23",
  • "status": "ACTIVE"
}

Get symbol by name

path Parameters
symbolName
required
string

Responses

Response samples

Content type
application/json
{
  • "symbolId": "string",
  • "symbolName": "ETHUSDT",
  • "baseAssetId": "3",
  • "quoteAssetId": "3",
  • "baseDecimal": "string",
  • "priceDecimal": "string",
  • "makerFeeDiscount": "string",
  • "takerFeeDiscount": "string",
  • "minTradingSize": "42.24",
  • "maxTradingSize": "42.24",
  • "maxPrice": "1.23",
  • "status": "ACTIVE"
}

Get all assets

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get asset by id

path Parameters
assetId
required
string

Responses

Response samples

Content type
application/json
{
  • "assetId": "3",
  • "assetName": "WBTC",
  • "onChainDecimal": "string",
  • "decimal": "3"
}

Get asset by name

path Parameters
assetName
required
string

Responses

Response samples

Content type
application/json
{
  • "assetId": "3",
  • "assetName": "WBTC",
  • "onChainDecimal": "string",
  • "decimal": "3"
}

Get fee levels

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get amm pools

query Parameters
symbolId
string
poolId
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get order book depth

path Parameters
symbolName
required
string
query Parameters
limit
integer [ 1 .. 5000 ]
Default: 100

Responses

Response samples

Content type
application/json
{
  • "timestamp": "1507725176595",
  • "asks": [
    ],
  • "bids": [
    ]
}

Create user

Request Body schema: application/json
required
chainId
string <int32> (ChainId)
address
string (Address)
vesselKey
string (UserVesselKey)
levelId
string (FeeLevel)

Responses

Request samples

Content type
application/json
{
  • "chainId": "31337",
  • "address": "0xC38C2c17fC38fb8fF575BDd3b7fcF04b8274a7B5",
  • "vesselKey": "0xa33c4f4d9c546b0dd1bb88e5746b3f569b8a9750bac6813875cf5edc22cf599ef8a8110ac7fec9bdea811369cb4588e14e5eec87cbd41c4c39e91b680a9fce7a",
  • "levelId": "0"
}

Response samples

Content type
application/json
{
  • "uid": "1727077698601001"
}

Get All Chain Infos

Responses

Response samples

Content type
application/json
[
  • {
    }
]