post
https://sandboxapi.legendtrading.com/app/rfqbyfiat
基于法币金额询价
本接口用于根据法币金额获取指示性报价(例如:支付 50 USD 或 60 EUR 购买 BTC)。
本接口返回的报价仅供参考。确认购买请调用 /app/orderbyfiat 下单,该接口按**市价单(Market Order)**成交,实际成交价格与数量以订单结果为准。
费用格式 (fee_format) 说明
通过可选参数 fee_format 选择报价中费用的呈现方式;不传时默认为 3.0。
| 集成版本 | fee_format 值 | 费用呈现方式 |
|---|---|---|
| SaaS 3.0 | 3.0 | 费用单列。响应中包含 processing_fee(处理费)、network_fee(网络费)、size(法币金额);price 为币的单价,不包含上述费用 |
| SaaS 3.1 | 3.1 | 费用并入价格。price 为包含全部费用的均价;响应中不再返回 processing_fee、network_fee、size |
size 与费用的关系
fee_format = 3.0:
size = quantity × price + processing_fee + network_fee
示例:支付 20.8 USD 买入,响应为 quantity = 17.2352、price = 1.00515、processing_fee = 1.5、network_fee = 1.976,验算:
17.2352 × 1.00515 + 1.5 + 1.976 = 20.79996128 ≈ 20.8(= size)
fee_format = 3.1:
size = quantity × price
price 已包含全部费用。同一笔报价在 3.1 下:price = 20.8 ÷ 17.2352 ≈ 1.206833,费用不再单列。
注意:
quantity与price按交易对精度做了舍入,代入公式验算时可能存在极小尾差(如上例末位的 0.00004),对账请以size为准。