Introduction

The Flash Liquidity API is a WebSocket-based, bidirectional JSON-RPC 2.0 API used for RFS-style ("Request For Stream") trading.

At the JSON-RPC level, both parties are technically "JSON-RPC servers" (since both you and Anthic expose some methods to be called by the other party). Each method name's prefix indicates the direction in which the message is expected to travel.

Websocket URL

Staging (Stokenet): wss://flash-liquidity-api.staging.anthic.io

Production (Mainnet): N/A

API Scope

The Flash Liquidity API is split into four channels.

Two channels where you will send data to Anthic:

  • Pricebooks
  • Fills

Two channels where data will be sent to you. These must be subscribed to:

  • New Orders
  • Fill Execution

A ping channel also exists to verify that the websocket connection is still alive.

Pricebooks

The Pricebooks channel allows you to continuously stream your newest bid/ask pricing for token pairs you are willing to trade.

See the platform.price_books.on_change method for details.

New Orders

The New Orders channel sends you newly-created orders which match your pricebook. These orders may then be be filled or rejected by you.

Each new order is an intent to consume a specific part of liquidity which you offered in the latest pricebook you have sent.

Anthic will start the new orders live stream only after you request it for a specific session (see the platform.new_orders.start_stream method and the Multi-session handling section).

Fills

The Fills channel allows you to submit signed fills for new orders sent to you (see the platform.fills.fill method for details).

Fill Execution

The Fill Execution channel will continuously send you both historical and live updates related to your fills.

Each fill is persistently recorded and handled by Anthic. You will be notified about the fill's execution progress by the maker.fill_execution.next method.

The fill execution channel uses strictly-incrementing-by-1 sequence numbers, and is thus resumable (in fact, rewindable): you can request it to be started from an arbitrary point in history. This allows you to reconcile any missed status change notifications (after your client restarts or recovers from an outage). It can also be used for performing historical queries.

Anthic will start the fill updates stream only after you request it for a specific session (see the platform.fill_execution.start_stream method and the Multi-session handling section).