YFX data API documents

YFX data API documents


This data interface is derived from the real data generated on the blockchain. The API interface  generated by the  the centralized server, the data can be verified on the blockchain. It can be used by market quotation websites, navigation websites, and tripartite data analysis platforms.



Other data please contact contact@yfx.com 

Domain: https://info.yfx.com/


Interfaces:

chain :

all
all
eth
ethereum 
trx
tron
bsc
binance smart chain
heco
Huobi ECO chain
ok
okchain
dot
Polkadot

1. summary 

Please check:


Input:
Field Name
Meaning
Parameter
chain
run on which blockchain
Defult setting is "all",it could also be fill with eth, trx, heco, bsc, ok, dot




Ourput:

  1. {
  2. "status":1,
  3. "msg":"success",
  4. "data":[
  5. {
  6. "chain":"all", //eth,trx,ok,heco,bsc,all 
  7. "symbol":"BTC_USDT",   // symbol
  8. "clear_anchor":"USDT",  //settlement anchor
  9. "market_type":"1", // 0 normal contract、1 coin contract、2 hybrid contract
  10. "zone":"normal_contract",  // normal_contract   coin_contract  hybrid_contract 
  11. "chains":"trx,eth,heco",   //this contract is run on trx/eth/heco chain
  12. "ticker":{
  13.                                                 "index_price": "2.983",        //index price
  14.                                                 "last_price": "2.983",         //last trade price on YFX
  15.                                                 "low_price": "2.981",          //24h low
  16.                                                 "high_price": "2.985",         //24h high
  17.    "change24h": "-5.343"          //24h change
  18.                                                "amount": "2132324.233",         //24h amount
  19.                                                "vol": "977782845.506509",        //24h volume
  20.   "vol_usd": "1212121212",          //24h volume estimate $USD
  21.                                                          "open_interest": "12121",         //open interest 
  22.   "open_interest_usd": "1213121"   //open interest estimate $USD
  23. }
  24. }
  25. {
  26. "chain":"all", //eth trx ok bsc all
  27. "symbol":"TRX_USDT",  //symbol
  28. "clear_anchor":"TRX",        // settlement anchor
  29. ....
  30. }
  31. ]
  32. }

2. pool_summary  --  YFX market maker pool summary

Please check

Input:
Field Name
Meaning
Parameter
chain
run on which blockchain
Defual setting is "all",it could also be fill with eth, trx, heco, bsc, ok, dot



Output:

  1. {
  2. "status":1,
  3. "msg":"success",
  4. "data":{
  5. "vol_usd": 12121212,            //total market maker pool value in $USD
  6. "chain":"all",  //eth,trx,bsc,ok,heco
  7. "lists":[
  8. {
  9. "clear_anchor":"USDT",      //settlement anchor
  10. "amount": 121312             //total amount token in the market maker pool
  11. "vol_usd": 121312   //value in $USD
  12. }
  13. {
  14. "clear_anchor":"TRX",  //trading is settled in TRX
  15. "amount":100000           //total amount token in the market maker pool
  16. "vol_usd": 3000             //value in $USD
  17. }
  18. ]
  19. }
  20. }

3. contracts  -- Trading Pairs Summary

Please check:

Input:
Filed Name
Meaning
Parameter
chain
If not be specific, return data from all blockchain
all, trx,heco,bsc,ok,eth,dot



Ourput:

  1. {
  2. "status":1,
  3. "msg":"success",
  4. "data":[
  5. {
  6. "trx":[
  7. {
  8. "chain":"trx",                         //run on TRON net
  9. "symbol":"BTC_USDT",        //Trading pair's name
  10. "clear_anchor":"USDT",        //settled in USDT
  11. "address":"TAewd2XbvRYK6LiRjAE32pLA6iJPw9qoLA",                //Trading contract for this trading pair
  12. "pool_address":"TEU4Xn98bFDDA1eJ77JAXX3G4AGBk2RFm9", //Market maker pool smart contract
  13. "clear_anchor_address":"TRR1ks6do2WvAeZ3vKfXd4ZELxvRtKQVSC",//token contract
  14. "market_type":"1", // 0 margin swap、1Coin margin swap、2 Mixed margin swap
  15. "zone":"normal_contract", //  normal_contract, coin_contract, hybrid_contract
  16.                                        "fee_rate":"0.0010", //trading fee
  17. "status":"1", //status
  18. "ticker":{
  19.                              "index_price": "2.983",        // index price
  20.                              "last_price": "2.983",         //last trade price on YFX
  21.                              "low_price": "2.981",          //24h low
  22.                              "high_price": "2.985",         //24h high
  23. "change24h": "-5.343"          //24h change
  24.                              "amount": 2132324.233,         //24h trade amount
  25.                              "vol": 977782845.506509        //24h volume
  26. "vol_usd": 1212121212          //24h trading volume in $USD
  27.                                        "open_interest": 12121         //open interest or open positions(BTC,ETH)
  28.         "open_interest_usd": 1213121   // open interest in $USD
  29. },
  30. "pool":{
  31. "liquidity":1, // share
  32. "total_supply": "119605",             //total shares
  33.                                     "share_price": "0.0000000000",      //net value
  34.                                     "people_num": 23,    // # of participant
  35.         "yield": "+4.41",7-day yield
  36.         "address": "TEU4Xn98bFDDA1eJ77JAXX3G4AGBk2RFm9",        //market maker pool contract
  37.                                      "clear_anchor": "USDT",     // settled in USDT
  38.                                      "clear_anchor_address": "TRR1ks6do2WvAeZ3vKfXd4ZELxvRtKQVSC",  //token contract
  39. "balance": "117718.356243076857325635",         //balance
  40.                                     "maker_lock": "1048.119517834136354820",     //margin locked
  41.                            "taker_total_margin": "209.623903566827270964",
  42. "long_position": { //long position for market maker
  43.                                          "long_open_total": "10180.0180018002",//Value
  44.                                         "long_margin": "999.099909990999099915",//Margin
  45.                                         "open_avg": "19353.72219456",//average open price
  46.                                         "profit_loss": -10080.4939316202,//PNL
  47.                                        "direction": 1//long or short
  48.                           },
  49.                                   "short_position": {//short position for market maker
  50.                                         "short_open_total": "196.0784313725",//Value
  51.                                         "short_margin": "49.019607843137254905",//Margin
  52.                                         "open_avg": "18539.22006050",//average open price
  53.                                         "profit_loss": -10080.4939316202,//PNL
  54.                                         "direction": -1//long or short
  55.                                     },
  56.   }
  57. }
  58.  "eth":[
  59. {
  60. "chain":"eth",
  61. "symbol":"BTC_USDT", 
  62. }
  63.                           ]
  64. }
  65. ]
  66. }

4. Contract -- Specific trading pair

Please check

Input(2 way to access the data): 
Field Name
Meaning
Parameter
chain,symbol,clear_anchor
chain: choice which blockchain, return data from all blockchain contract is running is not be specific

symbol: BTC_USDT

clear_anchor: USDT
need to enter all three inputs
address
check by smart contract address
or use smart contract address
Output:

  1. {
  2. "status":1,
  3. "msg":"success",
  4. "data":{
  5. "chain":"trx",  //run on trx
  6. "symbol":"EOS_USDT",  //Name for trading pair
  7. "clear_anchor":"USDT",  //settled in USDT
  8. "address":"TAewd2XbvRYK6LiRjAE32pLA6iJPw9qoLA",     //Trading contract
  9. "pool_address":"TEU4Xn98bFDDA1eJ77JAXX3G4AGBk2RFm9",   //market maker contract
  10. "clear_anchor_address":"TRR1ks6do2WvAeZ3vKfXd4ZELxvRtKQVSC",    //token contract
  11. "market_type":"1", //0 normal contract、1 coin contract、2 hybrid contract
  12. "fee_rate":"0.0010", // trading fee
  13. "zone":"normal_contract",  //  trading page
  14. "status":"1", //status
  15. "ticker":{
  16.                              "index_price": "2.983",        //price index
  17.                              "last_price": "2.983",         //last price on YFX
  18.                             "low_price": "2.981",          //24h low
  19.                             "high_price": "2.985",         //24h high
  20. "change24h": "-5.343"          //24h price change
  21.                             "amount": 2132324.233,         //24h volume in token
  22.                             "vol": 977782845.506509        //24h value
  23.         "vol_usd": 1212121212          //24hvalue in $USD
  24.                                        "open_interest": 12121         //open interest
  25.  "open_interest_usd": 1213121   //open interest in $USD
  26. },
  27. "pool":{
  28. "total_supply": "119605",//total shares
  29.                                                     "share_price": "0.0000000000",//net value
  30.                                                     "people_num": 23,//participants
  31. "yield": "+4.41",7-day yiles
  32. "address": "TEU4Xn98bFDDA1eJ77JAXX3G4AGBk2RFm9",//Market maker pool contract
  33.                                                     "clear_anchor": "USDT",//settled in USDT
  34.                                                     "clear_anchor_address": "TRR1ks6do2WvAeZ3vKfXd4ZELxvRtKQVSC",//token contract
  35. "balance": "117718.356243076857325635",// balance
  36.                                                     "maker_lock": "1048.119517834136354820",//margin locked
  37.                                             "taker_total_margin": "209.623903566827270964",
  38. "long_position": {//long position for market maker
  39.                                                             "long_open_total": "10180.0180018002",//long position total value
  40.                                                              "long_margin": "999.099909990999099915",//long position total margin
  41.                                                              "open_avg": "19353.72219456",//average price
  42.                                                              "profit_loss": -10080.4939316202,//unrealized PNL
  43.                                                             "direction": 1//direction,1 Long, -1 Short
  44.                                            },
  45.                                                     "short_position": {//short position for market maker
  46.                                                            "short_open_total": "196.0784313725",//short position total value
  47.                                                             "short_margin": "49.019607843137254905",// short position total margin
  48.                                                             "open_avg": "18539.22006050",//average price
  49.                                                             "profit_loss": -10080.4939316202,// unrealized PNL
  50.                                                             "direction": -1// Direction, 1 Long, -1 Short
  51. ,                                                },
  52.   }
  53. }
  54. }