logo

Quick Engine

Quick engine allows to use upstream liquidity market source to create market pairs, which are not present on upstream exchange.

For example, if upstream exchange has BTC/ABC pair listed, and does not have desired BTC/XYZ pair, but there is a service to provide live ABC/XYZ conversion prices, quick engine can be used to list BTC/XYZ on your platform.

#Quick Orders

Quick orders are the only order type available for quick engine. Under the hood, when a quick order is submitted, f.e, BTC/XYZ, engine will recalculate it's value in intermediate currency ABC and submit BTC/ABC FOK (fill or kill) order to upstream engine.

API for creating QE orders is almost the same as regular trading API, except it does not accept 'type' for order. To get valid price for submitting an order, use quick exchange price (/api/v2/qe/prices) endpoint.

#API

Running quick engine also allows to access to additional API:

POST /api/v2/qe/orders

API for creating "quick" orders. This the only order type available for quick engine. Quick orders act as a market orders. Quick engine does not support limit orders.

Params

paramtypedesc
marketstringmarket id
sidestringbuy or sell
amountdecimalvalid decimal value
pricedecimalvalid decimal value

GET /api/v2/qe/prices

API for estimating current conversion price.

Params

paramtypedesc
marketstringmarket id
sidestringbuy or sell

#Forex service

Forex is a service providing live updates of prices. It unifies several price providers under same API:

  • Binance
  • Bitfinex
  • Fixer
  • Uniswap v2 and v3
  • Static provider for predefined price (testing purposes mainly)

Finex uses openware/pkg implementation of forex client for integration.

#Configuration

Environment variables:

NameDescription
FINEX_FOREX_HOSTHost of Forex service
FINEX_QE_CURRENCYIntermediate currency for conversion
FINEX_QE_MAX_AMOUNTMaximum value per one order (in intermediate currency)
FINEX_QE_MIN_AMOUNTMinimum value per one order (in intermediate currency)
FINEX_QE_LIQUIDITY_ACCOUNTAccount used by engine to reflect "other side" of trades

Database:

To create a quick market, set market type to "qe" (default is "spot"). Also next options can be set in market's data:

NameDescription
buy_spreadSpread adjustment for buy orders
sell_spreadSpread adjustment for sell orders
pair(Required) Upstream market pair to use, should be separated by '/', BTC/USD
max_slippageMaximum price slippage (for submitted price and current forex price)
upstream_price_precisionUpstream market price precision
upstream_amount_precisionUpstream market amount precision

Who can I talk to if I have questions?