Borealis AI is gearing up to open a public algorithmic trading competition on Prism — a simulated synthetic financial market that supports algorithmic trading on a fictional stock called “PRSM”. Participants will aim to forecast and exploit one another’s actions, testing and perfecting their trading strategies and algorithms and working off of a common source of data. The Prism platform will evaluate agents’ models, offer order book visibility, the ability to place trades, and get metrics on how models participating in the competition are performing relative to one another. The leaderboard will display total profit or loss standing, as well as unrealized profit and loss.

The competition is set to open on January 31, 2023. You’re invited to apply!

Everyone is welcome to apply to participate in this friendly, light-hearted competition. The number of participants for the inaugural trading challenge is capped at 50. The trader with the highest realized profit at the end of the competition will win a cash prize of $3,000.

Once selected for participation, competitors can access:
• A UI reporting the state of the market and allowing one to place trades manually.
• Documentation explaining how to interact with Prism servers.
• Tutorials with examples to demonstrate how to create and test a trading agent.
• A testing environment to test your agent before the competition starts.
• A manual user interface to place buy/sell orders (for participants who prefer trading manually).

Competition Format and Rules

Each Prism competition features 3 trading episodes, each lasting 20 minutes and separated by a 10-minute break. An episode consists of a default trading agent, referred to as the Fundamental Agent (FT), which provides initial market liquidity as well as default market dynamics. The FT’s trading strategy remains undisclosed and varies between episodes. Scores are aggregated across all episodes to determine a winner. The participant with the highest realized profit at the end of the three episodes wins. Each participant can control a single agent during an episode.

Testing Environment

Prism’s testing environment allows participants to guarantee their agent can interact with the main competition. The testing environment shares the same API and data contracts as the Competition environment. The FT used in the trading environment is different than the FT used in the Prism competition; this is to discourage memorization of the FT’s action space.

Scoring

At the end of each episode, agents will be ranked according to the amassed profit and assigned a score according to this table:

RankPoints
110
26
33
42
51
The participant with the highest total score at the end of all episodes will win.

Trading Rules

• Each trading agent is rate-limited to 20 requests/second.
• Participants can execute one of the following instructions:
    • Query the current order volume at every price
    • Query current position and current wealth
    • Instruct their agent to submit a limit order.
    • Instruct their agent to cancel an outstanding limit order.
• Agents are subjected to both a position and a budget constraint.
• The position limit is expressed as a number of shares, and is enforced as follows:
• When a new bid order is submitted, Prism calculates what the agent’s new position would be if the submitted order plus all other outstanding agent bid orders were filled. If the new position is greater than the position limit, the submitted bid order is rejected.
    • When a new ask order is submitted, Prism calculates what the agent’s new position would be if that order plus all other outstanding agent ask orders were filled.  If the absolute value of the new position is greater than the position limit, the new ask order is rejected.
• The budget constraint is enforced as follows:
    • When a new bid order is submitted, Prism calculates the agent’s new wealth if the submitted order plus all other outstanding agent bid orders were filled.  If the new wealth would be less than 0, the new bid order is rejected.
    • All agents begin with a starting wealth of $500.

Understanding the Prism Dashboard

The Prism server offers a dashboard to visualize market dynamics like recent trades, bid/ask data and summary statistics. Here’s how it looks.

An artificial stock market dashboard visualization with number labels 1 to 6.

Prism dashboard preview.

The Prism dashboard contains the following information:

1️⃣ Stock Price

The current price that the stock ‘PRSM’ is trading at based on market activity.

2️⃣ Depth Chart

A pictorial representation of the available bid and ask orders, and their spread.

3️⃣ Bid/Ask Chart

A tabular representation of the available bid and ask orders.

4️⃣ Price Chart

A chart showing the stock price fluctuation over the last 60 seconds. The bubbles represent trades, with the radius being proportional to the traded volume.

5️⃣ Recent Trades

A chart showing the stock price fluctuation over the last 60 seconds. The bubbles represent trades, with the radius being proportional to the traded volume.5. Recent Trades: A tabular representation of trades that have occurred in the past 60 seconds. The table is divided into two halves, each half representing a trader. For each trader we have information like:
• volume and price information (ex: 23 @ 50.00)
• trade status: “F” implies the trade closes the trader’s order Fully, and “P” implies Partially.
• type of trade:
   • [STC](https://www.investopedia.com/terms/s/selltoclose.asp) = Sell To Close
   • [STO](https://www.investopedia.com/terms/s/selltoopen.asp) = Sell To Open
   • [BTO](https://www.investopedia.com/terms/b/buytoopen.asp) = Buy To Open
   • [BTC](https://www.investopedia.com/terms/b/buytoclose.asp) = Buy To Close

6️⃣ Trade Flows

A chord diagram representing trade interaction between all market participants. The ribbon size indicates the number of shares that were exchanged between two participants.

7️⃣ Summary Statistics

A tabular representation of global market statistics. Most of the metrics are self-explanatory.
• ‘Trade Dispersion’ measures the inequality amongst participants in contributing to the total market volume. The measure is high if all clients contribute equally to the total volume, and low if only one client is responsible for the entire volume.

You can choose to participate in the Prism market by trading manually.

The manual interface can be accessed through the Prism Dashboard page. Once you’re invited to participate in the Prism market, you can log into Prism and view the following interface.  

An information panel from a user interface.

An information panel from a user interface.

If you click the ‘Manual Interface’ button, you’ll see the following interface:

An information panel and a manual trading user interface.

An information panel and a manual trading user interface.

You can place a trade by entering a price and quantity for a limit order, and then clicking the ‘Buy’ or ‘Sell’ button. Prism presently only supports limit orders.

You can also cancel all of your pending orders (i.e. orders that haven’t yet been matched) by clicking the ‘Cancel Unfilled Orders’ button.

How to Get Started with Prism

Prism is an artificial exchange in which participants (agents) can submit trade orders via an API. This guide will help you setup your Python environment and make your first few calls to the Prism server.

Take a look at Prism’s Quickstart (below) to help you get set up with building your own trading agent. Alternatively, you can choose to trade yourself manually using Prism’s Manual Interface.

How to Register for Prism

On the Prism website, click on ‘Apply to Register’ and follow the sign-up process to apply and join the challenge. Prism will direct you to a registration form to be submitted. If selected to participate in Prism, you will receive an email with next steps at the email address used to register.

Install Poetry

Prism uses Poetry to manage Python dependencies. The first step is to install Poetry on your machine using instructions here.

Create a Python Virtual Environment

You can use your favourite Python Virtual Environment manager. Here we provide an example with Anaconda. The Python Version in Prism is ‘3.9’. You can also verify the version used through ‘pyproject.toml’ included in your starter kit.

$ conda create -n prism python==3.9
$ source activate prism

If you wish to run the included Jupyter notebooks for tutorials, additionally run the following.

python -m ipykernel install --user --name prism

Now run

# Install dependencies from the poetry.lock
$ poetry install

Connect to The Prism API

In order to contact the Prism API, you will need:

1. The Prism Server URL:

• You can get this by signing into Prism
• Under ‘Choose Your Instance’, select ‘Test Instance’. Note: When you’re participating in a live competition, you can use the competition instance.
• Click on ‘API Link’ and the link is copied.

2. Your Access Token:

• Next to the ‘API Link’ from the previous step is another field ‘Access Token’.
• Click on it, and your token is copied.

3. Your Alias:

• Prism uses your alias to represent you on the Prism Leaderboard.
• You can retrieve your chosen alias by signing into Prism.

Now we’re ready to make our first call to Prism. Register yourself by issuing the following Curl request:

$ curl -X POST "<test-server-url>/api/v1/accounts" -d "{\"alias\": \"<your-alias>\"}" --header "Content-Type: application/json" --header "Authorization: Bearer <your-access-token>"
> "5d11fc1f-aa8a-4b83-945d-802e1790b9ce"  # <-- Your Client ID!

The call returns a unique client id to be used in future requests to Prism. Congratulations! You just made your first API call to Prism and are ready for next steps.

Create A Trading Agent

You’re ready to create your own trading agent! You can choose to write your own scripts using the Prism API schema (available after log-in), or you can use our Starter Kit (which includes tutorials) to help you develop your own agent.

👋 Please note Prism is available to Authorized Participants only. 

No participant will create more than one account, or make any agreement with another participant. Doing so will be grounds for disqualification.

Apply to Participate!

Go to Prism