# 超导兑换API

Field Value
HTTP_SERVER_ENDPOINT https://supertx.movapi.com

# 获取交易对信息

# Request

GET /v1/symbols

# Response

名称 类型 描述
price_decimal Int 报价精度(小数点后位数)
amount_decimal Int 数量精度(小数点后位数)
base_asset Object base 币的详细信息
├── asset_id String 基础货币的ID
├── symbol String 基础货币的名称
├── effective_decimal Int 有效精度
└── min_exchange_num Float 最小交易量
quote_asset Object quote 币的详细信息
├── asset_id String 基础货币的ID
├── symbol String 基础货币的名称
├── effective_decimal Int 有效精度
└── min_exchange_num Float 最小交易量

示例:

# Request
GET https://supertx.movapi.com/v1/symbols

# Response
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "price_decimal": 4,
            "amount_decimal": 4,
            "base_asset": {
                "asset_id": "328d60d8192425beeaea53dbbc7900778ec06f4ca2e4499f92aea6ca17645d4c",
                "symbol": "USDC",
                "effective_decimal":2,
                "min_exchange_num":1
            },
            "quote_asset": {
                "asset_id": "57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443f",
                "symbol": "DAI",
                "effective_decimal":2,
                "min_exchange_num":1
            }
        }
    ]
}

# 获取某币池的兑换汇率

# Request

GET /v1/exchange-rate

# Params

名称 必选 类型 描述
symbol String 查询深度的交易对,比如DAI/USDT
amount String 查询的兑换金额,默认为1
side String 查询的兑换方向,填buy或sell

# Response

名称 类型 描述
amount String 交易金额
exchange_rate String 实际兑换汇率
oracle_exchange_rate String 预言机汇率

示例

# Request
GET https://supertx.movapi.com/v1/exchange-rate?symbol=USDC/DAI&amount=1&side=sell

# Response
{
    "code": 200,
    "msg": "",
    "data": {
        "amount": "1",
        "exchange_rate": "0.981801",
        "oracle_exchange_rate": "1"
    }
}

# 创建兑换请求

创建兑换请求,参数为资产兑换者持有地址,返回待签名的交易数据

# Request

POST /v1/build-exchange-request

# Params

名称 必选 类型 描述
address String 账户地址

# Body

名称 必选 类型 描述
symbol String 交易对
amount String 交易的的数量
side String 交易方向
exchange_rate String 交易费率
rate_deviation String 自定义滑点

# Response

名称 类型 描述
raw_transaction string 交易信息
signing_instructions array 签名指令
├── sign_data array 签名数据
├── derivation_path array 派生路径
└── pubkey String 公钥

示例:

POST https://supertx.movapi.com/v1/build-exchange-request?address=vp1q5hy06852u3h5js4efq7wwl0aut4fdemtk20pl4

# Request
{
  "symbol":"USDC/DAI",
  "amount":"1",
  "side":"buy",
  "exchange_rate":"1.017424"
}

# Response
{
    "code": 200,
    "msg": "",
    "data": [
        {
                   
            "raw_transaction": "07010001015f015d791d2f318247aadc14304860265f788f544f351dcc4bc07abf75dd5400b9920a57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443ff8d9cb2c0101160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b2201207ac8be38c84dfc52f3e68ad2b51fc580b9423371665337f8120aa54a15feba1702013d003b57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fc0843d011600146a386a295fee6837a6fa3a983493d3c09f48bee800013e003c57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fb8d58e2c01160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b00",
            "signing_instructions": [
                {
                    "derivation_path": [
                        "2c000000",
                        "99000000",
                        "01000000",
                        "00000000",
                        "01000000"
                    ],
                    "sign_data": [
                        "004b1d4a27f94c90243ea1956c87e233407a300f462524f951a7f24bf484b3af"
                    ],
                    "pubkey": "7ac8be38c84dfc52f3e68ad2b51fc580b9423371665337f8120aa54a15feba17"
                }
            ]
    ]
}

# 提交兑换请求

# Request

POST /v1/submit-exchange-request

# Params

名称 必选 类型 描述
address String 用户地址

# Body

名称 必选 类型 描述
raw_transaction String 原始交易
signatures array 签名数组

# Response

名称 类型 描述
tx_hash Object 交易哈希
symbol String 交易对
side String 方向
base_amount String base 币数量
quote_amount String quote 币数量
build_exchange_rate String 构建时的汇率
fee String 手续费
timestamp String 时间戳

示例:

# Request
POST https://supertx.movapi.com/v1/submit-exchange-request?address=vp1q6x2u97j48hk8m0czfpc3lwtqgm7004npwxc7ff

{
  "raw_transaction":"07010001015f015d791d2f318247aadc14304860265f788f544f351dcc4bc07abf75dd5400b9920a57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443ff8d9cb2c0101160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b2201207ac8be38c84dfc52f3e68ad2b51fc580b9423371665337f8120aa54a15feba1702013d003b57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fc0843d011600146a386a295fee6837a6fa3a983493d3c09f48bee800013e003c57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fb8d58e2c01160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b00",
  "signatures":[
        [
            "4f5e0b94f983ab6d98c230e7edf031951c93809af318d0bb6c362714794c38c5939df58e43ac1a45599d777386724354c0ced7bab54d19bac02c233fa9e2050a"
        ]
    ]
}

# Response
{
 "code": 200,
 "msg": "",
 "data": {
   "tx_hash": "76aa591cbb0f5191410db2679222afd20a864de399349b311baa704f64245af6",
   "symbol": "USDC/DAI",
   "side": "sell",
   "base_amount": "1.000000",
   "quote_amount": "0.998990",
   "build_exchange_rate": "0.9989900000",
   "fee": "0.000499",
   "timestamp": 1594779900
 }
}

# 获取兑换历史记录

# Request

GET /v1/exchange-order-history

# Params

名称 必选 类型 描述
address String 账户地址
start String 第几条开始
limit String 单次获取限制

# Response

名称 类型 描述
symbol String 交易对
side Bool 方向
base_amount Int base 币数量
quote_amount Int quote 币数量
build_exchange_rate String 构建时的汇率
fee String 手续费
order_txs Array 订单交易信息
├── hash String 交易哈希
├── timestamp String 时间
└── type String 交易类型
status String 状态
timestamp String 时间戳

示例:

# Request
GET https://supertx.movapi.com/v1/exchange-order-history

# Response
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "symbol": "SUP/BTM",
            "side": "sell",
            "base_amount": "12",
            "quote_amount": "133.26758009",
            "build_exchange_rate": "11.1056316743",
            "fee": "0.06666712",
            "order_txs": [
                {
                    "hash": "62e12e616c953729276d453df68e42203418beec19f1acb9d83fec7b7481fb08",
                    "timestamp": 1605741878,
                    "type": "in_tx_type"
                },
                {
                    "hash": "8867e0883dc601d7fcb1745461443ebd8fbee3305d3de198f1e0f1dc47c6a2dc",
                    "timestamp": 1605741883,
                    "type": "out_tx_type"
                }
            ],
            "status": "tx_pool_completed",
            "timestamp": 1605741878
        },
        {
            "symbol": "SUP/BTM",
            "side": "buy",
            "base_amount": "18.0087213",
            "quote_amount": "200",
            "build_exchange_rate": "0.0900436065",
            "fee": "0.00900886",
            "order_txs": [
                {
                    "hash": "f89d1593c8f691f2b041bc35d6602863b487e35a91d080ffb91a0a36374d4365",
                    "timestamp": 1605741816,
                    "type": "in_tx_type"
                },
                {
                    "hash": "77d755a57601b6fc7779d24a6edb917a14965f3bfb86ae5e8e93316df5267733",
                    "timestamp": 1605741822,
                    "type": "out_tx_type"
                }
            ],
            "status": "tx_pool_completed",
            "timestamp": 1605741816
        }
    ]
}

# 储蓄池当前信息

# Request

GET v1/pool-info

# Response

名称 类型 描述
symbol String 总可用美金价值
base_available String base币数量
quote_available String quote币数量

示例:

# Request
GET https://supertx.movapi.com/v1/pool-info


# Response
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "symbol": "USDC/DAI",
            "base_amount": "1602.942900",
            "quote_amount": "402.354003"
        }
    ]
}

# 获取某个币池的资产比例

# Request

GET /v1/asset-proportion

# Params

名称 必选 类型 描述
symbol String 交易对

# Response

名称 类型 描述
data string 资产比例

示例:

# Request
GET https://supertx.movapi.com/v1/asset-proportion?symbol=USDC/DAI

# Response
{
    "code": 200,
    "msg": "",
    "data": "3.983912"
}

# 构建双币转入

# Request

POST /v1/build-multi-asset-deposit

# Params

名称 必选 类型 描述
address String 账户地址

# Body

名称 必选 类型 描述
symbol String 交易对
quantity_proportion String 币池当前比例
amount String base币的数量

# Response

名称 类型 描述
raw_transaction string 交易信息
signing_instructions array 签名指令
├── sign_data array 签名数据
├── derivation_path array 派生路径
└── pubkey String 公钥

示例:

# Request
POST https://supertx.movapi.com/v1/build-multi-asset-deposit?address=vp1q6x2u97j48hk8m0czfpc3lwtqgm7004npwxc7ff

{
  "symbol":"USDC/DAI",
  "quantity_proportion":"1",
  "amount":"100"
}

# Response

{
    "code": 200,
    "msg": "",
    "data": [
        {
            "raw_transaction": "07010001015f015d791d2f318247aadc14304860265f788f544f351dcc4bc07abf75dd5400b9920a57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443ff8d9cb2c0101160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b2201207ac8be38c84dfc52f3e68ad2b51fc580b9423371665337f8120aa54a15feba1702013d003b57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fc0843d011600146a386a295fee6837a6fa3a983493d3c09f48bee800013e003c57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fb8d58e2c01160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b00",
            "signing_instructions": [
                {
                    "derivation_path": [
                        "2c000000",
                        "99000000",
                        "01000000",
                        "00000000",
                        "01000000"
                    ],
                    "sign_data": [
                        "004b1d4a27f94c90243ea1956c87e233407a300f462524f951a7f24bf484b3af"
                    ],
                    "pubkey": "7ac8be38c84dfc52f3e68ad2b51fc580b9423371665337f8120aa54a15feba17"
                }
            ]
        }
    ]
}

# 构建单币转入

# Request

POST /v1/build-single-asset-deposit

# Params

名称 必选 类型 描述
address String 账户地址

# Body

名称 必选 类型 描述
symbol String 交易对
amount String 币的数量
currency String 资产的符号

# Response

名称 类型 描述
raw_transaction string 交易信息
signing_instructions array 签名指令
├── sign_data array 签名数据
├── derivation_path array 派生路径
└── pubkey String 公钥

示例:

# Request
POST https://supertx.movapi.com/v1/build-single-asset-deposit?address=tp1q6x2u97j48hk8m0czfpc3lwtqgm7004npwxc7ff

{
  "symbol":"USDC/DAI",
  "amount":"1",
  "currency":"USDC"
}

# Response

{
    "code": 200,
    "msg": "",
    "data": [
        {
      
            "raw_transaction": "07010001015f015d791d2f318247aadc14304860265f788f544f351dcc4bc07abf75dd5400b9920a57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443ff8d9cb2c0101160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b2201207ac8be38c84dfc52f3e68ad2b51fc580b9423371665337f8120aa54a15feba1702013d003b57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fc0843d011600146a386a295fee6837a6fa3a983493d3c09f48bee800013e003c57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fb8d58e2c01160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b00",
            "signing_instructions": [
                {
                    "derivation_path": [
                        "2c000000",
                        "99000000",
                        "01000000",
                        "00000000",
                        "01000000"
                    ],
                    "sign_data": [
                        "004b1d4a27f94c90243ea1956c87e233407a300f462524f951a7f24bf484b3af"
                    ],
                    "pubkey": "7ac8be38c84dfc52f3e68ad2b51fc580b9423371665337f8120aa54a15feba17"
                }
            ]
        }
    ]
}

# 提交转入

# Request

POST /v1/submit-deposit

# Params

名称 必选 类型 描述
address String 需要提交交易的地址

# Body

名称 必选 类型 描述
raw_transaction String 原始交易
signatures array 签名数组

# Response

名称 类型 描述
tx_hash string 交易哈希
symbol String 交易对
build_proportion string 构建时的池比例
base_amount string base 币数量
quote_amount string quote 币数量

示例:

# Request
POST https://supertx.movapi.com/v1/submit-deposit?address=vp1q6x2u97j48hk8m0czfpc3lwtqgm7004npwxc7ff

{
  "raw_transaction":"07010001015f015d791d2f318247aadc14304860265f788f544f351dcc4bc07abf75dd5400b9920a57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443ff8d9cb2c0101160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b2201207ac8be38c84dfc52f3e68ad2b51fc580b9423371665337f8120aa54a15feba1702013d003b57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fc0843d011600146a386a295fee6837a6fa3a983493d3c09f48bee800013e003c57e5b3a3040e1c0162f64019838fd93b5f33dcde7069fa72aee48a054143443fb8d58e2c01160014a5c8fd1e8ae46f4942b9483ce77dfde2ea96e76b00",
  "signatures":[
        [
            "4f5e0b94f983ab6d98c230e7edf031951c93809af318d0bb6c362714794c38c5939df58e43ac1a45599d777386724354c0ced7bab54d19bac02c233fa9e2050a"
        ]
    ]
}

# Response
{
 "code": 200,
 "msg": "",
 "data": {
   "tx_hash": "bcbf287361a3f763faf5cc4a6c4e0bdcb3c8677100c0e899b6a401f008782024",
   "symbol": "USDC/DAI",
   "build_proportion": "1",
   "base_amount": "100",
   "quote_amount": "100"
 }
}

# 双资产移除流动性

# Request

POST /v1/submit-multi-asset-withdrawal

# Params

名称 必选 类型 描述
signature String 用户对提现请求的签名
address String 地址

# Body

名称 必选 类型 描述
pubkey String 公钥
symbol String 交易对
quantity_proportion String 比例
amount String base 币的数量
timestamp String 时间戳

# Response

名称 类型 描述
symbol string 交易对
quantity_proportion String 构建时的池比例
base_amount string base 币数量
quote_amount string quote 币数量

示例:

# Request
POST https://supertx.movapi.com/v1/submit-multi-asset-withdrawal?signature=ddabb7180da245d40ab3779a15b553ffc58c7ae8d34483a3128c908a7c715c64c05c38f4d369f46b8363ce5e3ee8519139fdc97b88ffff37c4f1cb5f6d66e80d&address=vp1q6x2u97j48hk8m0czfpc3lwtqgm7004npwxc7ff

{
  "pubkey":"afdsafdasfdasfsadfas",
  "symbol": "USDC/DAI",
  "quantity_proportion": "1",
  "amount":"100",
  "time_stamp":"111111"
}

# Response
{
 "code": 200,
 "msg": "",
 "data": {
  "tx_hash": "bcbf287361a3f763faf5cc4a6c4e0bdcb3c8677100c0e899b6a401f008782024",
   "symbol": "USDC/DAI",
   "quantity_proportion": "1",
   "base_amount": "100",
   "quote_amount": "100",

 }
}

# 单资产移除流动性

# Request

POST /v1/submit-single-asset-withdrawal

# Params

名称 必选 类型 描述
signature String 用户对提现请求的签名
address String 地址

# Body

名称 必选 类型 描述
pubkey String 公钥
symbol String 交易对
amount String 数量
timestamp String 时间戳
currency String 资产符号

# Response

名称 类型 描述
symbol string 交易对
currency string 资产符号
amount String 数量

示例:

# Request
POST https://supertx.movapi.com/v1/submit-single-asset-withdrawal?signature=ddabb7180da245d40ab3779a15b553ffc58c7ae8d34483a3128c908a7c715c64c05c38f4d369f46b8363ce5e3ee8519139fdc97b88ffff37c4f1cb5f6d66e80d&address=vp1q6x2u97j48hk8m0czfpc3lwtqgm7004npwxc7ff

{
  "pubkey":"afdsafdasfdasfsadfas",
  "symbol": "USDC/DAI",
  "amount":"100",
  "timestamp":"111111",
  "currency": "USDC"
}

# Response
{
 "code": 200,
 "msg": "",
 "data": {
   "symbol": "USDC/DAI",
   "currency": "USDT",
   "amount":"100",
 }
}

# 获取用户收益

# Request

GET /v1/user-earning

# Params

名称 必选 类型 描述
address String 用户地址

# Response

名称 类型 描述
symbol_info object 单个池的收益信息
├── symbol String 交易对
├── last_earning String 昨日收益
└── total_earning String 总收益
total_earning String 总收益
last_total_earning String 昨日总收益

示例:

# Request
GET https://supertx.movapi.com/v1/user-earning?address=vp1qc0736r3cpxz27uequxszn4l79sjnue8y96v7l5


# Response
{
    "code": 200,
    "msg": "",
    "data": {
        "symbol_info": [
            {
                "symbol": "USDC/DAI",
                "last_earning": "3.000000",
                "total_earning": "8.000000"
            }
        ],
        "total_earning": "8.000000",
        "last_total_earning": "3.000000"
    }
}

# 获取年化收益率

# Request

GET /v1/annual-rate

# Response

名称 类型 描述
symbol String 交易对
annual-rate String 年化收益率

示例:

# Request
GET https://supertx.movapi.com/v1/annual-rate

# Response
{
    "code": 200,
    "msg": "",
    "data": [
        {
            "symbol": "USDC/DAI",
            "annual_rate": "0.12"
        }
    ]
}

# 获取多资产可用信息

# Request

GET /v1/multi-asset-available

# Params

名称 必选 类型 描述
address String 用户地址

# Response

名称 类型 描述
details Array 各个交易对详细信息
├── base_available String base币可用
├── quote_available String quote币可用
└── symbol String 交易对
total_available_value String 总可用美金价值

示例:

# Request
GET https://supertx.movapi.com/v1/multi-asset-available?address=vp1qc0736r3cpxz27uequxszn4l79sjnue8y96v7l5


# Response
{
    "code": 200,
    "msg": "",
    "data": {
        "details": [
            {
                "base_available": "1",
                "quote_available": "1",
                "symbol": "USDC/DAI",
            }
        ],
        "total_available_value": "2.000000"
    }
}

# 获取单资产可用信息

# Request

GET /v1/single-asset-available

# Params

名称 必选 类型 描述
address String 用户地址

# Response

名称 类型 描述
details Array 每个交易对的可用信息
├── base_available String base币可用
├── quote_available String quote币可用
└── symbol String 交易对
total_available_value String 总可用美金价值

示例:

# Request
GET https://supertx.movapi.com/v1/single-asset-available?address=vp1qc0736r3cpxz27uequxszn4l79sjnue8y96v7l5

# Response
{
    "code": 200,
    "msg": "",
    "data": {
        "details": [
            {
                "base_available": "1",
                "quote_available": "1",
                "symbol": "USDC/DAI",
            }
        ],
        "total_available_value": "2.000000"
    }
}

# 获取同步状态信息

# Request

GET v1/chain-status

# Response

名称 类型 描述
block_height String 同步到的区块高度

示例:

# Request
GET https://supertx.movapi.com/v1/chain-status

# Response
{
    "code": 200,
    "msg": "",
    "data": {
        "block_height": 2915137
    }
}
上次更新: 12/30/2020, 10:13:49 AM