<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.spiretrading.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kamal</id>
	<title>Spire Trading Inc. - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.spiretrading.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kamal"/>
	<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php/Special:Contributions/Kamal"/>
	<updated>2026-05-28T22:00:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=TypeScript_Style_Guide&amp;diff=145</id>
		<title>TypeScript Style Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=TypeScript_Style_Guide&amp;diff=145"/>
		<updated>2026-05-27T20:28:39Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article specifies the most general guidelines used for all Spire projects written using TypeScript as the primary programming language. Each individual project may extend or override the guidelines specified herein. The overall aim of this guideline is to provide consistency across the numerous projects developed by Spire in order to promote and benefit from modern web development practices as well as tailor them to our specific requirements.&lt;br /&gt;
&lt;br /&gt;
In general, the guidelines are very specific and opinionated. This is done intentionally to ensure that every detail has been given proper consideration and that every line of code is written with care and diligence. It is taken as a prerequisite that writing robust, clean and maintainable code requires paying close attention to even the smallest of details. As such, when there are two or more ways to write or express any given statement or expression, be it using spaces or tabs, number of characters per line, purple or violet, the guideline will often require that one particular approach be used to the exclusion of others.&lt;br /&gt;
&lt;br /&gt;
Finally, this document is constantly evolving and as such older projects may not be up-to-date with the guidelines found here. In those circumstances one must use their best judgment about how to integrate these guidelines into older codebases. As a general principle, consistency should favor the local over the global, that is it is more important to be consistent with a function definition than within a file, and more important to be consistent within a file than within a directory, project, etc...&lt;br /&gt;
&lt;br /&gt;
= Development Environment =&lt;br /&gt;
&lt;br /&gt;
The primary operating systems supported by Spire projects are Linux, Windows, and macOS. On all systems, nodejs is used as the build system and webpack is used as the bundler.&lt;br /&gt;
&lt;br /&gt;
For source control, git is used and projects are to be hosted on [https://github.com/spiretrading Spire Trading's Github page].&lt;br /&gt;
&lt;br /&gt;
Each developer is welcome to use an editor of their choice, however [https://code.visualstudio.com/ Visual Studio Code] is recommended.&lt;br /&gt;
&lt;br /&gt;
= File Names =&lt;br /&gt;
&lt;br /&gt;
Use [https://en.wikipedia.org/wiki/Snake_case snake case] using all lower case letters for files and directories. The name of a file should correspond to the primary class that it exports.&lt;br /&gt;
&lt;br /&gt;
The default extension for TypeScript files is ''ts''&lt;br /&gt;
&lt;br /&gt;
The extension used for TypeScript files containing JSX is ''tsx''&lt;br /&gt;
&lt;br /&gt;
All files end with a single new line character.&lt;br /&gt;
&lt;br /&gt;
= Directory Structure =&lt;br /&gt;
&lt;br /&gt;
A project is broken down into a library component, a test component, and one or more application components. These components are referred to as ''artifacts''. The applications go into their own ''applications'' directory and the libraries into the ''library'' directory. Within each artifact is a ''build'' directory containing the build scripts needed to build that artifact. Scripts for POSIX systems are found in the ''posix'' sub-directory and Windows build files are within the ''windows'' sub-directory. The build scripts specified are ''setup'' to download and install any dependencies needed to produce the artifact and the ''build'' script which produces the artifact. Typically the ''setup'' script is run only once or when a new dependency is introduced to the project, and the ''build'' script is run anytime a new build is needed.&lt;br /&gt;
&lt;br /&gt;
Finally there is a top-level ''build'' directory for the project as a whole which produces all artifacts by recursively calling each artifact's individual build scripts. Additionally the top-level build directory also includes a ''setup'' script which downloads all third party dependencies. Some projects may also opt to include an ''install'' script which sets up a suitable development environment, and other scripts for continuous builds, deployment and testing.&lt;br /&gt;
&lt;br /&gt;
Assuming a project named sudoku the following directory structure should be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudoku                             # Root level directory.&lt;br /&gt;
  build.sh                         # Script used to build all projects on POSIX.&lt;br /&gt;
  build.bat                        # Script used to build all projects on Windows.&lt;br /&gt;
  configure.sh                     # Script used to configure all projects on POSIX.&lt;br /&gt;
  configure.bat                    # Script used to configure all projects on Windows.&lt;br /&gt;
  setup.sh                         # Script used to install all dependencies on POSIX.&lt;br /&gt;
  setup.bat                        # Script used to install all dependencies on Windows.&lt;br /&gt;
  \application                     # Contains source specific for the sudoku web app.&lt;br /&gt;
    build.sh                       # Script used to build the web app on POSIX.&lt;br /&gt;
    build.bat                      # Script used to build the web app on Windows.&lt;br /&gt;
    configure.sh                   # Script used to configure the web app on POSIX.&lt;br /&gt;
    configure.bat                  # Script used to configure the web app on Windows.&lt;br /&gt;
    package.json                   # The Node JS package description.&lt;br /&gt;
    tsconfig.json                  # The TypeScript compiler configuration.&lt;br /&gt;
    setup.sh                       # Script used the web app dependencies on POSIX.&lt;br /&gt;
    setup.bat                      # Script used the web app dependencies on Windows.&lt;br /&gt;
    webpack.config.js              # The Webpack configuration.&lt;br /&gt;
    \source                        # Contains the web application source files.&lt;br /&gt;
      \index.html                  # The HTML file that loads the JavaScript application.&lt;br /&gt;
      \index.tsx                   # The TypeScript/JSX file containing the application.&lt;br /&gt;
  \library                         # Contains the common library code.&lt;br /&gt;
    build.sh                       # Script used to build the library on POSIX.&lt;br /&gt;
    build.bat                      # Script used to build the library on Windows.&lt;br /&gt;
    configure.sh                   # Script used to configure the library on POSIX.&lt;br /&gt;
    configure.bat                  # Script used to configure the library on Windows.&lt;br /&gt;
    package.json                   # The Node JS package description.&lt;br /&gt;
    setup.sh                       # Script used the library on POSIX.&lt;br /&gt;
    setup.bat                      # Script used the library on Windows.&lt;br /&gt;
    tsconfig.json                  # The TypeScript compiler configuration.&lt;br /&gt;
    \source                        # Contains the library source files.&lt;br /&gt;
      index.ts                     # Exports all definitions contained in this directory.&lt;br /&gt;
      \pages                       # Contains the source code for individual web pages.&lt;br /&gt;
        index.ts                   # Exports all definitions for every web page defined&lt;br /&gt;
                                   # in this directory.&lt;br /&gt;
        \landing_page              # Contains the source code for the landing page.&lt;br /&gt;
          index.ts                 # Exports the landing page.&lt;br /&gt;
          landing_page.tsx         # The TypeScript/JSX source code for the landing page.&lt;br /&gt;
        \page_2                    # Contains the source for for another web page.&lt;br /&gt;
          ...                      # Structured in a similar manner as the landing page.&lt;br /&gt;
  \resources                       # Contains images, fonts, CSS files and all other web&lt;br /&gt;
                                   # assets.&lt;br /&gt;
    \index.css                     # Contains the main CSS file, typically this is the&lt;br /&gt;
                                   # only CSS file used.&lt;br /&gt;
    \fonts                         # A directory of fonts used.&lt;br /&gt;
  \tests                           # This directory contains tests for every page of the&lt;br /&gt;
                                   # web app.&lt;br /&gt;
    build.sh                       # Script used to build all tests on POSIX.&lt;br /&gt;
    build.bat                      # Script used to build all tests on Windows.&lt;br /&gt;
    configure.sh                   # Script used to configure all tests on POSIX.&lt;br /&gt;
    configure.bat                  # Script used to configure all tests on Windows.&lt;br /&gt;
    setup.sh                       # Script used to install all test dependencies on POSIX.&lt;br /&gt;
    setup.bat                      # Script used to install all test dependencies on&lt;br /&gt;
                                   # Windows.&lt;br /&gt;
    \scratch                       # Directory containing a test/demo for a single page.&lt;br /&gt;
      build.sh                     # Script used to build the test on POSIX.&lt;br /&gt;
      build.bat                    # Script used to build the test on Windows.&lt;br /&gt;
      configure.sh                 # Script used to configure the test on POSIX.&lt;br /&gt;
      configure.bat                # Script used to configure the test on Windows.&lt;br /&gt;
      package.json                 # The Node JS package description.&lt;br /&gt;
      tsconfig.json                # The TypeScript compiler configuration.&lt;br /&gt;
      setup.sh                     # Script used the test dependencies on POSIX.&lt;br /&gt;
      setup.bat                    # Script used the test dependencies on Windows.&lt;br /&gt;
      webpack.config.js            # The Webpack configuration.&lt;br /&gt;
      \source                      # Contains the test source files.&lt;br /&gt;
        \index.html                # The HTML file that loads the JavaScript application.&lt;br /&gt;
        \index.tsx                 # The TypeScript/JSX file containing the application.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the above directory structure containing a basic skeletal implementation of all files can be found here: https://github.com/spiretrading/sudoku&lt;br /&gt;
&lt;br /&gt;
= Component Names =&lt;br /&gt;
&lt;br /&gt;
Naming components can be difficult. Names are usually prefixed with the context or domain. Most components will fall under one of the following categories.&lt;br /&gt;
&lt;br /&gt;
== Field ==&lt;br /&gt;
&lt;br /&gt;
The primary function of a field is to display data. The data can be edited. It can have a readonly property. It contains a onChange callback.&lt;br /&gt;
&lt;br /&gt;
Examples: DurationField, NumberField&lt;br /&gt;
&lt;br /&gt;
=== Selection Field ===&lt;br /&gt;
&lt;br /&gt;
A specialized field. It requires a list of potential values to choose from.&lt;br /&gt;
&lt;br /&gt;
Example: CountrySelectionField&lt;br /&gt;
&lt;br /&gt;
== Input ==&lt;br /&gt;
&lt;br /&gt;
The primary function of a input is to get user input. Inputs usually do not have a initial value unlike fields. Inputs can have a readonly mode, but it is only to be used when the input should not accept input.&lt;br /&gt;
&lt;br /&gt;
Example: SecurityInput&lt;br /&gt;
&lt;br /&gt;
=== Button ===&lt;br /&gt;
&lt;br /&gt;
Buttons are a specialized form of input. Only has a onClick callback.&lt;br /&gt;
&lt;br /&gt;
Examples: Button, BurgerButton&lt;br /&gt;
&lt;br /&gt;
== Box ==&lt;br /&gt;
&lt;br /&gt;
A component that displays data that cannot be directly edited.&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&lt;br /&gt;
== Indentation ==&lt;br /&gt;
&lt;br /&gt;
Code is indented using 2 spaces per level, tabs are not permitted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
function factorial(n: number): number {&lt;br /&gt;
  if(n == 0) {&lt;br /&gt;
    return 1;&lt;br /&gt;
  }&lt;br /&gt;
  return n * factorial(n - 1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Line Structure ==&lt;br /&gt;
&lt;br /&gt;
Statements must end with a semi-colon ';' or a closing brace '}', even in cases where TypeScript allows them to be optional.&lt;br /&gt;
&lt;br /&gt;
Lines are limited to 80 characters. Exceptions to this rule are long imports and long string literals where breaking up the literal into multiple lines is not possible. In order to break up long statements into multiple lines, break the line after the earliest operator or punctuation mark (which includes commas, operators, and opening brackets).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct, line break at comma.&lt;br /&gt;
f(a, ..., b,&lt;br /&gt;
  c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after expression.&lt;br /&gt;
f(a, ..., b&lt;br /&gt;
  , c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Correct, line break after operator.&lt;br /&gt;
a + ... + b +&lt;br /&gt;
  c + ... + d;&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after expression.&lt;br /&gt;
a + ... + b&lt;br /&gt;
  + c + ... + d;&lt;br /&gt;
&lt;br /&gt;
// Correct, line break after opening bracket.&lt;br /&gt;
f(&lt;br /&gt;
  a, ..., b, c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after function name.&lt;br /&gt;
f&lt;br /&gt;
  (a, ..., b, c, ..., d);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For statements that begin new blocks of code (such as if/while/class...), in order to avoid confusing the line continuation with the code block, the line continuation is indented two extra levels. For example consider the following snippet of code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Incorrect.&lt;br /&gt;
if(condition_a &amp;amp;&amp;amp; condition_b &amp;amp;&amp;amp; ... &amp;amp;&amp;amp;&lt;br /&gt;
  condition_c) {&lt;br /&gt;
  console.log('meow');&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line continuation on line 2 clashes with the code block on line 3. To avoid this clash the above code is indented as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
if(condition_a &amp;amp;&amp;amp; condition_b &amp;amp;&amp;amp; ... &amp;amp;&amp;amp;&lt;br /&gt;
    condition_c) {&lt;br /&gt;
  console.log('meow');&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The extra level of indentation in the line continuation makes it clear where the condition ends and the code block begins.&lt;br /&gt;
&lt;br /&gt;
== Braces ==&lt;br /&gt;
&lt;br /&gt;
Braces are placed using a variant of the [http://wiki.c2.com/?OneTrueBraceStyle OTBS style]. The opening brace is placed on the same line as the declaring statement with one single space preceding it, and the closing brace is placed on a line of its own at the same level of indentation as the declaring statement. For if statements, the else/else if is placed on the same line as the closing brace. For do/while loops, the while is placed on the same line as the closing brace.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
if(&amp;lt;cond&amp;gt;) {&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
} else {&lt;br /&gt;
  &amp;lt;default&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Correct.&lt;br /&gt;
do {&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
} while(&amp;lt;cond&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
// Incorrect.&lt;br /&gt;
if(&amp;lt;cond&amp;gt;)&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;default&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Incorrect.&lt;br /&gt;
do&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
while(&amp;lt;cond&amp;gt;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Spacing ==&lt;br /&gt;
&lt;br /&gt;
The following are correct use cases for white spaces:&lt;br /&gt;
&lt;br /&gt;
* Used for indentation.&lt;br /&gt;
* Used to surround binary operations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
const x = a + b;&lt;br /&gt;
const y = 5;&lt;br /&gt;
&lt;br /&gt;
//! Incorrect&lt;br /&gt;
const x = a+b;&lt;br /&gt;
const y=5;&lt;br /&gt;
const z= 5;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* One space is placed after a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
f(1, 2);&lt;br /&gt;
function g(a: number, b: number): number;&lt;br /&gt;
&lt;br /&gt;
//! Incorrect&lt;br /&gt;
f(1,2);&lt;br /&gt;
function g(a:number,b:number);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Naming ==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Camel_case Camel case] is used for naming whereas variables and functions use mixedCase and namespaces, modules, and types use CapWords. Names should be descriptive but should avoid being verbose.&lt;br /&gt;
&lt;br /&gt;
Classes and variables should be given the name of a noun and functions the name of a verb. Functions that return a boolean or boolean variables should be named in the form of a question starting with isX or hasX.&lt;br /&gt;
&lt;br /&gt;
== Imports ==&lt;br /&gt;
&lt;br /&gt;
Imports are listed in order of most global to local. Where dependencies have the same locality, then they are ordered alphabetically. For example, the first group of dependencies to be imported are third party packages which are listed in alphabetical order based on the package name. In the snippet below the third party dependencies are jquery, react and react-router-dom which are imported in alphabetical order. Then local dependencies are imported where directories further up the hierarchy are imported first. That is, the directory '../../..' which is three levels up is imported before the directory '..' which is only one level up.&lt;br /&gt;
&lt;br /&gt;
When multiple names are imported from a package, they must be listed in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
import * as $ from 'jquery';&lt;br /&gt;
import * as React from 'react';&lt;br /&gt;
import * as Router from 'react-router-dom';&lt;br /&gt;
import {HBoxLayout, Padding, VBoxLayout} from '../../..';&lt;br /&gt;
import {Model} from '..';&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Declarations ==&lt;br /&gt;
&lt;br /&gt;
Any declaration (such as a function or class) that is intended to be imported by another file must be documented using [http://usejsdoc.org/ JSDoc style]. If the definition is local then that documentation should be omitted entirely.&lt;br /&gt;
&lt;br /&gt;
Any documentation should be preceded by a blank line. In the code snippet below, Properties is part of the public API so it is documented along with all of its fields, but the State is internal to the file so no aspect of it is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
/** Stores the React properties used to render a Page. */&lt;br /&gt;
export interface Properties {&lt;br /&gt;
&lt;br /&gt;
  /** The model used to display the page. */&lt;br /&gt;
  model: Model;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
export interface State {&lt;br /&gt;
  redirect: string;&lt;br /&gt;
  isLoading: boolean;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Variable Declarations ==&lt;br /&gt;
&lt;br /&gt;
Variables are declared so that only one variable is declared per line, prefer declaring variables using ''const'' when possible, and deferring to ''let'' otherwise, variables should always be initialized at the point of their declaration.&lt;br /&gt;
&lt;br /&gt;
For complex initialization of values, use an [https://en.wikipedia.org/wiki/Immediately-invoked_function_expression immediately invoked lambda expression] as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
const value = (() =&amp;gt; {&lt;br /&gt;
  if(condition) {&lt;br /&gt;
    return 123;&lt;br /&gt;
  }&lt;br /&gt;
  return 321;&lt;br /&gt;
})();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Example =&lt;br /&gt;
&lt;br /&gt;
Below is a full example combining numerous elements of the style guide to define a typical React component. It should be used as a general reference for how code is laid out, structured, and properly spaced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
import * as $ from 'jquery';&lt;br /&gt;
import * as React from 'react';&lt;br /&gt;
import * as Router from 'react-router-dom';&lt;br /&gt;
import {HBoxLayout, Padding, VBoxLayout} from '..';&lt;br /&gt;
import {Model} from '.';&lt;br /&gt;
&lt;br /&gt;
/** Stores the React properties used to render a Page. */&lt;br /&gt;
export interface Properties {&lt;br /&gt;
&lt;br /&gt;
  /** The model used to display the page. */&lt;br /&gt;
  model: Model;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
export interface State {&lt;br /&gt;
  redirect: string;&lt;br /&gt;
  isLoading: boolean;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Displays an HTML page. */&lt;br /&gt;
export class Page extends React.Component&amp;lt;Properties, State&amp;gt; {&lt;br /&gt;
  constructor(props: Properties) {&lt;br /&gt;
    super(props);&lt;br /&gt;
    this.state = {&lt;br /&gt;
      redirect: '',&lt;br /&gt;
      isLoading: true&lt;br /&gt;
    };&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public componentWillMount(): void {&lt;br /&gt;
    this.props.model.load().then(&lt;br /&gt;
      () =&amp;gt; {&lt;br /&gt;
        this.setState({&lt;br /&gt;
          isLoading: false&lt;br /&gt;
        });&lt;br /&gt;
      });&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public render(): JSX.Element {&lt;br /&gt;
    if(this.state.redirect) {&lt;br /&gt;
      return &amp;lt;Router.Redirect push to={this.state.redirect}/&amp;gt;;&lt;br /&gt;
    } else if(this.state.isLoading) {&lt;br /&gt;
      return &amp;lt;LoadingPage/&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    const style = {&lt;br /&gt;
      backgroundColor: '#FFFFFF',&lt;br /&gt;
      font: 'Roboto 14px'&lt;br /&gt;
    };&lt;br /&gt;
    return (&lt;br /&gt;
      &amp;lt;div style={style}&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;Hello world!&amp;lt;/h1&amp;gt;&lt;br /&gt;
        &amp;lt;img src='cat.jpg'/&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Additional References =&lt;br /&gt;
&lt;br /&gt;
The bulk of this style guide focuses on syntax rather than good programming practices. The following list are reference materials for best practices on writing portable, efficient, and clean TypeScript:&lt;br /&gt;
&lt;br /&gt;
* [https://www.typescriptlang.org/docs/handbook/basic-types.html TypeScript Hand Book]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=C%2B%2B_Style_Guide&amp;diff=144</id>
		<title>C++ Style Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=C%2B%2B_Style_Guide&amp;diff=144"/>
		<updated>2026-05-27T20:26:07Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article specifies the most general guidelines used for all Spire projects written using C++ as the primary programming language. Each individual project may extend or override the guidelines specified herein. The overall aim of this guideline is to provide consistency across the numerous projects developed by Spire in order to promote and benefit from modern C++ practices as well as tailor them to our specific requirements.&lt;br /&gt;
&lt;br /&gt;
In general, the guidelines are very specific and opinionated. This is done intentionally to ensure that every detail has been given proper consideration and that every line of code is written with care and diligence. It is taken as a prerequisite that writing robust, clean and maintainable code requires paying close attention to even the smallest of details. As such, when there are two or more ways to write or express any given statement or expression, be it using spaces or tabs, number of characters per line, purple or violet, the guideline will often require that one particular approach be used to the exclusion of others.&lt;br /&gt;
&lt;br /&gt;
Finally, this document is constantly evolving and as such older projects may not be up-to-date with the guidelines found here. In those circumstances one must use their best judgment about how to integrate these guidelines into older codebases. As a general principle, consistency should favor the local over the global, that is it is more important to be consistent with a function definition than within a file, and more important to be consistent within a file than within a directory, project, etc...&lt;br /&gt;
&lt;br /&gt;
= Relationship to the Cpp Core Guidelines =&lt;br /&gt;
&lt;br /&gt;
This document should be seen as an extension to the Cpp Core Guidelines authored and maintained by Herb Sutter and Bjarne Stroustrup. After reviewing these guidelines one should then become familiar with the Cpp Core Guidelines as documented here:&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/isocpp/CppCoreGuidelines Cpp Core Guidelines]&lt;br /&gt;
&lt;br /&gt;
Those guidelines specify the best practices for writing modern C++ code. In situations where there is a conflict between the Cpp Core Guidelines and the guidelines set forth in this document, this document takes precedence. For all known situations where a conflict exists, this document should explicitly indicate that conflict to avoid confusion.&lt;br /&gt;
&lt;br /&gt;
= Development Environment =&lt;br /&gt;
&lt;br /&gt;
All projects target the C++23 standard. The two primary development environments supported by Spire projects are Linux and Windows. CMake is used to produce the appropriate project/make files for each platform.&lt;br /&gt;
&lt;br /&gt;
For source control, git is used and projects are to be hosted on [https://github.com/spiretrading Spire Trading's Github page].&lt;br /&gt;
&lt;br /&gt;
Each developer is welcome to use an editor of their choice.&lt;br /&gt;
&lt;br /&gt;
= File and Directory Naming =&lt;br /&gt;
&lt;br /&gt;
Use [https://en.wikipedia.org/wiki/CamelCase CamelCase] for header and source file names, matching the primary type or class defined within. The main exception is for CMake files which must use the name ''CMakeLists.txt''. Directory names use [https://en.wikipedia.org/wiki/Snake_case snake case] with all lower case letters.&lt;br /&gt;
&lt;br /&gt;
= Project Structure =&lt;br /&gt;
&lt;br /&gt;
A project is broken down into one library component and one or more application components. The library is written in a [https://en.wikipedia.org/wiki/Header-only header-only fashion], that is the implementation is provided directly in the header file rather than a separate .cpp source file. This allows for such libraries to easily be incorporated into other projects without the need for complex build configurations. Applications often use a mix of header only files and source files.&lt;br /&gt;
&lt;br /&gt;
At the root of a project are the build scripts: &amp;lt;code&amp;gt;build.bat&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;build.sh&amp;lt;/code&amp;gt; to build the project, &amp;lt;code&amp;gt;configure.bat&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;configure.sh&amp;lt;/code&amp;gt; to produce the platform specific build files (VS solutions for Windows, make files for POSIX), and &amp;lt;code&amp;gt;setup.bat&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;setup.sh&amp;lt;/code&amp;gt; to download all third party dependencies. Some projects may also include ''install'' scripts, ''version'' scripts, and scripts for continuous builds or deployment.&lt;br /&gt;
&lt;br /&gt;
The library is organized into the following directories:&lt;br /&gt;
&lt;br /&gt;
* ''Include'' - Header files (.hpp), organized by component under a project-level namespace directory.&lt;br /&gt;
* ''Source'' - Unit test source files (.cpp), organized into ''ComponentTests'' directories.&lt;br /&gt;
* ''Config'' - CMake build configuration files, with a subdirectory per component.&lt;br /&gt;
* ''Dependencies'' - Third party dependencies downloaded by the setup script.&lt;br /&gt;
&lt;br /&gt;
Applications go into a separate ''Applications'' directory at the project root. Each application follows the same structure with its own ''Include'', ''Source'', ''Config'', and ''Dependencies'' directories alongside its own build scripts.&lt;br /&gt;
&lt;br /&gt;
The following example shows the structure of a project named ''TicTacToe'' consisting of a library with two components (Board and Rules), and two applications (TicTacToeConsole and TicTacToeUi):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TicTacToe                          # Root level directory.&lt;br /&gt;
  build.bat                        # Builds all libraries and applications.&lt;br /&gt;
  configure.bat                    # Produces platform specific build files.&lt;br /&gt;
  setup.bat                        # Downloads all third party dependencies.&lt;br /&gt;
  \Applications                    # Contains all applications.&lt;br /&gt;
    \TicTacToeConsole              # A console application.&lt;br /&gt;
      build.bat                    # Application build scripts.&lt;br /&gt;
      CMakeLists.txt               # Top-level CMake config for the application.&lt;br /&gt;
      \Config                      # CMake build files per component.&lt;br /&gt;
        \TicTacToeConsole          # CMake config for the main executable.&lt;br /&gt;
      \Include                     # Application header files.&lt;br /&gt;
        \TicTacToeConsole          # Namespace directory.&lt;br /&gt;
      \Source                      # Application source files.&lt;br /&gt;
        \TicTacToeConsole          # Source files for the application.&lt;br /&gt;
    \TicTacToeUi                   # A GUI application.&lt;br /&gt;
      \...                         # Same structure as TicTacToeConsole.&lt;br /&gt;
  \TicTacToe                       # The main library.&lt;br /&gt;
    build.bat                      # Library build scripts.&lt;br /&gt;
    setup.bat                      # Downloads library dependencies.&lt;br /&gt;
    CMakeLists.txt                 # Top-level CMake config for the library.&lt;br /&gt;
    \Config                        # CMake build files per component.&lt;br /&gt;
      \Board                       # CMake config for the Board component.&lt;br /&gt;
      \Rules                       # CMake config for the Rules component.&lt;br /&gt;
    \Include                       # Library header files.&lt;br /&gt;
      \TicTacToe                   # Namespace directory.&lt;br /&gt;
        \Board                     # Headers for the Board component.&lt;br /&gt;
        \BoardTests                # Test utility headers.&lt;br /&gt;
        \Rules                     # Headers for the Rules component.&lt;br /&gt;
    \Source                        # Library source and test files.&lt;br /&gt;
      \BoardTests                  # Unit tests for the Board component.&lt;br /&gt;
      \RulesTests                  # Unit tests for the Rules component.&lt;br /&gt;
    \Dependencies                  # Third party dependencies.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Header File Structure =&lt;br /&gt;
&lt;br /&gt;
== Include Guards ==&lt;br /&gt;
&lt;br /&gt;
Header files are structured first with an [https://en.wikipedia.org/wiki/Include_guard include guard] defined using SNAKE_CASE whose name consists of the project name appended to the directory name and finally the file name itself, ending with a ''_HPP'' suffix. As a note, all files end with a single new line character.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
#ifndef CPP_CHAT_SERVER_HPP&lt;br /&gt;
#define CPP_CHAT_SERVER_HPP&lt;br /&gt;
  ...&lt;br /&gt;
#endif&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Include Directives ==&lt;br /&gt;
&lt;br /&gt;
Next come the list of #include directives. Include files are ordered based on their category where the first category is standard C++ header files, the second category is external dependency header files, and finally the third category is project header files. Both standard and external dependency header files use angle brackets (&amp;lt;code&amp;gt;#include &amp;lt;...&amp;gt;&amp;lt;/code&amp;gt;) and local project header files use quotes (&amp;lt;code&amp;gt;#include &amp;quot;...&amp;quot;&amp;lt;/code&amp;gt;). Within each category files are listed in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
#include &amp;lt;tuple&amp;gt;&lt;br /&gt;
#include &amp;lt;vector&amp;gt;&lt;br /&gt;
#include &amp;lt;boost/noncopyable.hpp&amp;gt;&lt;br /&gt;
#include &amp;quot;cpp_chat/cpp_chat.hpp&amp;quot;&lt;br /&gt;
#include &amp;quot;cpp_chat/definitions.hpp&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Namespaces ==&lt;br /&gt;
&lt;br /&gt;
After include directives the project's namespace is defined. All declarations and definitions must be contained within a namespace so as to avoid polluting the global namespace. Namespace definitions should be preceded by one single new line except when immediately following a namespace definition. The top level namespace is named after the project, and sub-namespaces may be used (although they should be used very sparingly). When possible, use the nested namespace syntax (''A::B'') instead of separate nested declarations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
namespace CppChat {&lt;br /&gt;
namespace SubChatA {&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
namespace SubChatB::SubSubChatA {&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
namespace CppChatExtra {&lt;br /&gt;
  ...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One situation where nested namespaces are welcome and encouraged are for implementation details that do not form part of the namespace's public interface. These definitions are put in a nested namespace called ''Details'' and go into a file of their own whose name contains the suffix ''details''. For example if the ''cpp_chat_server.hpp'' contains implementation details, then they should be included in the file ''cpp_chat_server_details.hpp'' and the definitions should go into the namespace ''CppChat::Details''.&lt;br /&gt;
&lt;br /&gt;
= Layout =&lt;br /&gt;
&lt;br /&gt;
== Indentation ==&lt;br /&gt;
&lt;br /&gt;
Code is indented using 2 spaces per level, tabs are not permitted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
int factorial(int n) {&lt;br /&gt;
  if(n == 0) {&lt;br /&gt;
    return 1;&lt;br /&gt;
  }&lt;br /&gt;
  return n * factorial(n - 1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Line Structure ==&lt;br /&gt;
&lt;br /&gt;
Lines are limited to 80 characters. Exceptions to this rule are long include files and long string literals where breaking up the literal into multiple lines is not possible. In order to break up long statements into multiple lines, break the line after the earliest operator or punctuation mark (which includes commas, operators, and opening brackets).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct, line break at comma.&lt;br /&gt;
f(a, ..., b,&lt;br /&gt;
  c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after expression.&lt;br /&gt;
f(a, ..., b&lt;br /&gt;
  , c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Correct, line break after operator.&lt;br /&gt;
a + ... + b +&lt;br /&gt;
  c + ... + d;&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after expression.&lt;br /&gt;
a + ... + b&lt;br /&gt;
  + c + ... + d;&lt;br /&gt;
&lt;br /&gt;
// Correct, line break after opening bracket.&lt;br /&gt;
f(&lt;br /&gt;
  a, ..., b, c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after function name.&lt;br /&gt;
f&lt;br /&gt;
  (a, ..., b, c, ..., d);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For statements that begin new blocks of code (such as if/while/class...), in order to avoid confusing the line continuation with the code block, the line continuation is indented two extra levels. For example consider the following snippet of code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Incorrect.&lt;br /&gt;
if(condition_a &amp;amp;&amp;amp; condition_b &amp;amp;&amp;amp; ... &amp;amp;&amp;amp;&lt;br /&gt;
  condition_c) {&lt;br /&gt;
  std::cout &amp;lt;&amp;lt; &amp;quot;meow&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line continuation on line 2 clashes with the code block on line 3. To avoid this clash the above code is indented as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
if(condition_a &amp;amp;&amp;amp; condition_b &amp;amp;&amp;amp; ... &amp;amp;&amp;amp;&lt;br /&gt;
    condition_c) {&lt;br /&gt;
  std::cout &amp;lt;&amp;lt; &amp;quot;meow&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The extra level of indentation in the line continuation makes it clear where the condition ends and the code block begins.&lt;br /&gt;
&lt;br /&gt;
== Blank Lines ==&lt;br /&gt;
&lt;br /&gt;
Documented declarations shall be separated from the following declaration by a blank line. Any two non-documented declarations shall not have a blank line between them. In general, public declarations shall be documented. This rule applies to all declarations including class members, free functions, and free variables.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
class Connection {&lt;br /&gt;
  public:&lt;br /&gt;
&lt;br /&gt;
    /** Constructs a Connection from a host and port. */&lt;br /&gt;
    Connection(std::string host, int port);&lt;br /&gt;
&lt;br /&gt;
    Connection(Connection&amp;amp;&amp;amp; other) noexcept;&lt;br /&gt;
    ~Connection();&lt;br /&gt;
&lt;br /&gt;
    /** Sends a message over the connection. */&lt;br /&gt;
    void send(const std::string&amp;amp; message);&lt;br /&gt;
&lt;br /&gt;
    /** Returns true if the connection is open. */&lt;br /&gt;
    bool is_open() const;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Function bodies shall not contain blank lines. All statements within a function body are written without vertical separation.&lt;br /&gt;
&lt;br /&gt;
== Braces ==&lt;br /&gt;
&lt;br /&gt;
Braces are placed using a variant of the [http://wiki.c2.com/?OneTrueBraceStyle OTBS style]. The opening brace is placed on the same line as the declaring statement with one single space preceding it, and the closing brace is placed on a line of its own at the same level of indentation as the declaring statement. For if statements, the else/else if is placed on the same line as the closing brace. For do/while loops, the while is placed on the same line as the closing brace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
if(&amp;lt;cond&amp;gt;) {&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
} else {&lt;br /&gt;
  &amp;lt;default&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Correct.&lt;br /&gt;
do {&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
} while(&amp;lt;cond&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
// Incorrect.&lt;br /&gt;
if(&amp;lt;cond&amp;gt;)&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;default&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Incorrect.&lt;br /&gt;
do&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
while(&amp;lt;cond&amp;gt;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Spacing ==&lt;br /&gt;
&lt;br /&gt;
The following are correct use cases for white spaces:&lt;br /&gt;
&lt;br /&gt;
* Used for indentation.&lt;br /&gt;
* Used to surround binary operations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
auto x = a + b;&lt;br /&gt;
auto y = 5;&lt;br /&gt;
&lt;br /&gt;
//! Incorrect&lt;br /&gt;
auto x = a+b;&lt;br /&gt;
auto y=5;&lt;br /&gt;
auto z= 5;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* One space is placed after a comma.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
f(1, 2);&lt;br /&gt;
int g(int a, int b);&lt;br /&gt;
&lt;br /&gt;
//! Incorrect&lt;br /&gt;
f(1,2);&lt;br /&gt;
int g(int a,int b);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Syntax =&lt;br /&gt;
&lt;br /&gt;
== Function Definitions ==&lt;br /&gt;
&lt;br /&gt;
Functions declared and defined in header files are formatted as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
inline int f() {&lt;br /&gt;
  ...&lt;br /&gt;
  return 123;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
template&amp;lt;typename T&amp;gt;&lt;br /&gt;
bool g() {&lt;br /&gt;
  ...&lt;br /&gt;
  return false;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That is they are declared as inline unless they are function templates in which case the inline specifier is omitted.&lt;br /&gt;
&lt;br /&gt;
== Variable Declarations ==&lt;br /&gt;
&lt;br /&gt;
Variables are declared so that only one variable is declared per line, the type of the variable should [https://herbsutter.com/2013/08/12/gotw-94-solution-aaa-style-almost-always-auto/ almost always use auto], and variables should almost always be initialized.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
auto x = 5;&lt;br /&gt;
auto y = a + b;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For complex initialization of values, use an [https://en.wikipedia.org/wiki/Immediately-invoked_function_expression immediately invoked lambda expression] as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
auto value = [&amp;amp;] {&lt;br /&gt;
  if(condition) {&lt;br /&gt;
    return 123;&lt;br /&gt;
  }&lt;br /&gt;
  return 321;&lt;br /&gt;
}();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Class Member Declaration Order ==&lt;br /&gt;
&lt;br /&gt;
Within each access section (public, protected, private), declarations are ordered as follows:&lt;br /&gt;
&lt;br /&gt;
# Nested types (enums, nested classes, typedefs, type aliases)&lt;br /&gt;
# Implicit constructors (compiler may call implicitly, e.g. non-explicit single parameter)&lt;br /&gt;
# Multi-parameter constructors (non-copy, non-move)&lt;br /&gt;
# Copy constructor, move constructor, destructor&lt;br /&gt;
# Member functions&lt;br /&gt;
# Operators (arithmetic, comparison, assignment)&lt;br /&gt;
&lt;br /&gt;
Within a class, there must always be a single blank line between the destructor and the following declaration in the same access section. If there is no destructor, then a single blank line between the last constructor and the following declaration.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
/** Base class for types that can be converted to a string. */&lt;br /&gt;
class Stringable {&lt;br /&gt;
  public:&lt;br /&gt;
&lt;br /&gt;
    /** Returns the string representation. */&lt;br /&gt;
    virtual std::string to_string() const = 0;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
/** Represents a duration of time. */&lt;br /&gt;
class Duration : public Stringable {&lt;br /&gt;
  public:&lt;br /&gt;
&lt;br /&gt;
    /** The underlying type used to count time units. */&lt;br /&gt;
    using Count = std::int64_t;&lt;br /&gt;
&lt;br /&gt;
    /** Returns a Duration from a count of milliseconds. */&lt;br /&gt;
    static Duration from_milliseconds(Count milliseconds);&lt;br /&gt;
&lt;br /&gt;
    /** Implicitly converts a count of seconds. */&lt;br /&gt;
    Duration(Count seconds);&lt;br /&gt;
&lt;br /&gt;
    /** Constructs a Duration from a string representation. */&lt;br /&gt;
    explicit Duration(std::string representation);&lt;br /&gt;
&lt;br /&gt;
    /** Constructs a Duration from a count and unit. */&lt;br /&gt;
    Duration(Count count, std::string unit);&lt;br /&gt;
&lt;br /&gt;
    Duration(const Duration&amp;amp; other);&lt;br /&gt;
    Duration(Duration&amp;amp;&amp;amp; other) noexcept;&lt;br /&gt;
    ~Duration() override;&lt;br /&gt;
&lt;br /&gt;
    /** Returns the count of time units. */&lt;br /&gt;
    Count get_count() const;&lt;br /&gt;
&lt;br /&gt;
    /** Returns true if this is a non-zero duration. */&lt;br /&gt;
    bool is_non_zero() const;&lt;br /&gt;
&lt;br /&gt;
    std::string to_string() const override;&lt;br /&gt;
&lt;br /&gt;
    Duration operator +(const Duration&amp;amp; rhs) const;&lt;br /&gt;
    Duration operator -(const Duration&amp;amp; rhs) const;&lt;br /&gt;
&lt;br /&gt;
    bool operator ==(const Duration&amp;amp; rhs) const;&lt;br /&gt;
    bool operator &amp;lt;(const Duration&amp;amp; rhs) const;&lt;br /&gt;
&lt;br /&gt;
    Duration&amp;amp; operator =(const Duration&amp;amp; rhs);&lt;br /&gt;
    Duration&amp;amp; operator =(Duration&amp;amp;&amp;amp; rhs) noexcept;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note how the copy constructor, move constructor, and destructor are undocumented and grouped without blank lines. The overridden ''to_string'' appears after the new method ''get_count''. Arithmetic, comparison, and assignment operators each form their own group at the end with no blank lines between them.&lt;br /&gt;
&lt;br /&gt;
== Naming Conventions ==&lt;br /&gt;
&lt;br /&gt;
* Use [https://en.wikipedia.org/wiki/CamelCase CamelCase] for all type names including classes, structs, enums, type aliases, typedefs, and concepts.&lt;br /&gt;
* Use [https://en.wikipedia.org/wiki/Snake_case snake_case] for function and variable names.&lt;br /&gt;
* Type traits use snake_case to be consistent with the standard library convention.&lt;br /&gt;
* Do not use abbreviations for names. Variable names should be a single noun, dropping adjectives unless needed to disambiguate.&lt;br /&gt;
* Functions returning bool shall use a prefix that reads as a question: ''is_'', ''has_'', or ''can_''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
class OrderBook {&lt;br /&gt;
  public:&lt;br /&gt;
    auto get_price() const -&amp;gt; Money;&lt;br /&gt;
    auto is_empty() const -&amp;gt; bool;&lt;br /&gt;
    auto has_bid() const -&amp;gt; bool;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
template&amp;lt;typename T&amp;gt;&lt;br /&gt;
struct is_numeric;&lt;br /&gt;
&lt;br /&gt;
auto order_count = 0;&lt;br /&gt;
&lt;br /&gt;
// Incorrect: abbreviation, wrong case, missing question prefix.&lt;br /&gt;
class OrdBk {&lt;br /&gt;
  public:&lt;br /&gt;
    Money getPrice() const;&lt;br /&gt;
    bool empty() const;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
auto orderCnt = 0;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Constructors and Operators ==&lt;br /&gt;
&lt;br /&gt;
Single parameter constructors shall be declared ''explicit'' to prevent implicit conversions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
class Distance {&lt;br /&gt;
  public:&lt;br /&gt;
    explicit Distance(int meters);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Incorrect, allows implicit conversion from int.&lt;br /&gt;
class Distance {&lt;br /&gt;
  public:&lt;br /&gt;
    Distance(int meters);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Constructors and assignment operators shall be declared ''noexcept'' if their implementations are actually noexcept. There is no need for ''noexcept'' on other methods.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
class Connection {&lt;br /&gt;
  public:&lt;br /&gt;
    Connection(Connection&amp;amp;&amp;amp; other) noexcept;&lt;br /&gt;
    Connection&amp;amp; operator =(Connection&amp;amp;&amp;amp; other) noexcept;&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Object Initialization ==&lt;br /&gt;
&lt;br /&gt;
Objects are always initialized using parentheses, never braces. The exception is when constructing a ''std::initializer_list''.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
auto duration = Duration(5);&lt;br /&gt;
auto values = std::vector&amp;lt;int&amp;gt;(10, 0);&lt;br /&gt;
&lt;br /&gt;
// Correct, std::initializer_list exception.&lt;br /&gt;
auto primes = std::vector&amp;lt;int&amp;gt;{2, 3, 5, 7, 11};&lt;br /&gt;
&lt;br /&gt;
// Incorrect.&lt;br /&gt;
auto duration = Duration{5};&lt;br /&gt;
auto values = std::vector&amp;lt;int&amp;gt;{10, 0};  // Constructs {10, 0}, not 10 zeros.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Templates ==&lt;br /&gt;
&lt;br /&gt;
Use compile time argument deduction (CTAD) as much as possible. Provide deduction guides for all class templates unless a compiler generated deduction guide is available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct, CTAD with explicit deduction guide.&lt;br /&gt;
template&amp;lt;typename T&amp;gt;&lt;br /&gt;
class Wrapper {&lt;br /&gt;
  public:&lt;br /&gt;
    Wrapper(T value);&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
template&amp;lt;typename T&amp;gt;&lt;br /&gt;
Wrapper(T) -&amp;gt; Wrapper&amp;lt;T&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
auto w = Wrapper(5);  // Deduces Wrapper&amp;lt;int&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
// Incorrect, redundant template arguments.&lt;br /&gt;
auto w = Wrapper&amp;lt;int&amp;gt;(5);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
Use modern jsdoc style comments. Do not use old Doxygen-style comments. Only document the interface, not the implementation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
/** Sends a message to all connected clients. */&lt;br /&gt;
void broadcast(const std::string&amp;amp; message);&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Connects to a server at the given host and port.&lt;br /&gt;
 * @param host The hostname to connect to.&lt;br /&gt;
 * @param port The port to connect on.&lt;br /&gt;
 * @return The established connection.&lt;br /&gt;
 */&lt;br /&gt;
Connection connect(const std::string&amp;amp; host, int port);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, old Doxygen style.&lt;br /&gt;
/*! \brief Sends a message to all connected clients. */&lt;br /&gt;
void broadcast(const std::string&amp;amp; message);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Character Set ==&lt;br /&gt;
&lt;br /&gt;
Only basic ASCII characters are permitted in source code. Never use unicode characters.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
auto pi = 3.14159;&lt;br /&gt;
auto label = std::string(&amp;quot;degrees&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, unicode in source.&lt;br /&gt;
auto pi = 3.14159;  // π&lt;br /&gt;
auto label = std::string(&amp;quot;degrees °&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Helper Functions ==&lt;br /&gt;
&lt;br /&gt;
When a helper function does not need access to class state, prefer placing it in the narrowest possible scope. In order of preference:&lt;br /&gt;
&lt;br /&gt;
# Anonymous namespace (for file-local helpers in .cpp files)&lt;br /&gt;
# Free function in a Details namespace&lt;br /&gt;
# Static class member (only when needed)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
// Preferred: anonymous namespace for file-local helpers.&lt;br /&gt;
namespace {&lt;br /&gt;
  int compute_offset(int base) {&lt;br /&gt;
    return base * 2 + 1;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Acceptable: free function in Details namespace for header-only code.&lt;br /&gt;
namespace CppChat::Details {&lt;br /&gt;
  inline int compute_offset(int base) {&lt;br /&gt;
    return base * 2 + 1;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Last resort: static class member.&lt;br /&gt;
class Connection {&lt;br /&gt;
  public:&lt;br /&gt;
    static int compute_offset(int base);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Static Members ==&lt;br /&gt;
&lt;br /&gt;
Static class members shall always be accessed through the class name, never through an instance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=c++ line=line&amp;gt;&lt;br /&gt;
class Counter {&lt;br /&gt;
  public:&lt;br /&gt;
    static int instance_count;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
// Correct.&lt;br /&gt;
auto count = Counter::instance_count;&lt;br /&gt;
&lt;br /&gt;
// Incorrect, accesses static member through an instance.&lt;br /&gt;
auto counter = Counter();&lt;br /&gt;
auto count = counter.instance_count;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&lt;br /&gt;
The bulk of this style guide focuses on syntax rather than good programming practices. The following list are reference materials (both online and published) for best practices on writing portable, efficient, and clean C++ code:&lt;br /&gt;
&lt;br /&gt;
* B. Stroustrup ''The C++ Programming Language (4th Edition)''. 2013&lt;br /&gt;
* [https://github.com/isocpp/CppCoreGuidelines Cpp Core Guidelines]&lt;br /&gt;
* [https://cppcon.org/ CppCon - The C++ Conference]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=NeoeMarketDataFeedClient&amp;diff=143</id>
		<title>NeoeMarketDataFeedClient</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=NeoeMarketDataFeedClient&amp;diff=143"/>
		<updated>2026-05-27T20:18:37Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The NeoeMarketDataFeedClient disseminates real-time market data for the Aequitas NEO Exchange. It connects to the Service Locator for authentication and provides order boo...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The NeoeMarketDataFeedClient disseminates real-time market data for the Aequitas NEO Exchange. It connects to the [[Service Locator]] for authentication and provides order book data, time and sales, and the consolidated best bid offer (CBBO) for the NEO Exchange.&lt;br /&gt;
&lt;br /&gt;
The feed is split into multiple channels for disseminating the CBBO, book, and trade data. Each channel resides in its own subdirectory whose name starts with the &amp;lt;code&amp;gt;neoe&amp;lt;/code&amp;gt; prefix: &amp;lt;code&amp;gt;neoe_cbbo&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;neoe_cls&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;neoe_book&amp;lt;/code&amp;gt; for the CBBO, time and sales, and book feeds respectively.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Each channel is configured via a YAML file (&amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt;) with the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;127.0.0.1:20000&amp;quot;&lt;br /&gt;
  # The account username used to authenticate with the Service Locator.&lt;br /&gt;
  username: market_data_feed&lt;br /&gt;
  # The password for the Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
# Rate at which market data snapshots are sampled and forwarded to the&lt;br /&gt;
# Market Data Server.&lt;br /&gt;
sampling: 100ms&lt;br /&gt;
&lt;br /&gt;
# Multicast group address and port for the feed.&lt;br /&gt;
host: &amp;quot;239.0.0.1:30501&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Network interface to join the multicast group on.&lt;br /&gt;
interface: &amp;quot;0.0.0.0:0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# UDP socket receive buffer size in bytes (default: 128 MB).&lt;br /&gt;
receive_buffer: 134217728&lt;br /&gt;
&lt;br /&gt;
# Maximum datagram size (MTU) in bytes (optional; defaults to system MTU).&lt;br /&gt;
mtu: 1500&lt;br /&gt;
&lt;br /&gt;
# Retransmission endpoints for recovering dropped packets.&lt;br /&gt;
retransmission_request_address: &amp;quot;142.201.149.44:61030&amp;quot;&lt;br /&gt;
retransmission_response_address: &amp;quot;142.201.149.44:61031&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Whether retransmission requests are enabled (default: false).&lt;br /&gt;
enable_retransmission: false&lt;br /&gt;
&lt;br /&gt;
# Maximum number of retransmission requests before giving up (default: 10).&lt;br /&gt;
max_retransmissions: 10&lt;br /&gt;
&lt;br /&gt;
# Maximum number of messages requested in a single retransmission block (default: 20000).&lt;br /&gt;
retransmission_block_size: 20000&lt;br /&gt;
&lt;br /&gt;
# Time zone used to compute the feed's time offset (default: &amp;quot;America/Toronto&amp;quot;).&lt;br /&gt;
time_zone: &amp;quot;America/Toronto&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Enable logging of every received message (off by default; verbose when enabled).&lt;br /&gt;
enable_logging: false&lt;br /&gt;
&lt;br /&gt;
# Whether this channel carries time and sales data.&lt;br /&gt;
is_time_and_sale: false&lt;br /&gt;
&lt;br /&gt;
# Optional MPID rewriting: maps source IDs to canonical MPID names.&lt;br /&gt;
mpid_mappings:&lt;br /&gt;
  - source: 1&lt;br /&gt;
    name: ANON&lt;br /&gt;
&lt;br /&gt;
# Path to the security master list (symbols.yml).&lt;br /&gt;
symbol_list: &amp;quot;symbols.yml&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;sampling&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;interface&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;retransmission_request_address&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;retransmission_response_address&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;symbol_list&amp;lt;/code&amp;gt; fields are required. All other fields have defaults.&lt;br /&gt;
&lt;br /&gt;
== Security Master ==&lt;br /&gt;
&lt;br /&gt;
A security master list of traded securities is typically stored in the &amp;lt;code&amp;gt;symbols.yml&amp;lt;/code&amp;gt; file with the following format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
- symbol: AAPL                  # The ticker symbol.&lt;br /&gt;
  name: APPLE CDR (CAD HEDGED)  # The name of the security.&lt;br /&gt;
  board_lot: 100                # The security's board lot.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Changes can be made in this security master list and reloaded by restarting the NEOE CBBO feed.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; Python script configures all of the channels at once and can be called as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 192.168.0.100          # Local interface (default: auto-detected IP)&lt;br /&gt;
  --address 127.0.0.1:20000      # Service Locator address&lt;br /&gt;
  --username market_data_feed    # Service Locator username (default: market_data_feed)&lt;br /&gt;
  --password [REQUIRED]          # Service Locator password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
Each channel is managed through three core scripts:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt; - Starts the channel. Does nothing if the channel is already running.&lt;br /&gt;
* &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt; - Stops the channel and waits for the channel to terminate.&lt;br /&gt;
* &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; - Verifies that the channel is running.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Log files are generated as &amp;lt;code&amp;gt;srv_[YYYY][MM][DD]_[HH]_[MM]_[SS].log&amp;lt;/code&amp;gt; in the runtime directory. Upon termination, non-empty log files are moved into the &amp;lt;code&amp;gt;log/&amp;lt;/code&amp;gt; subfolder, while empty log files are deleted.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=AsxItchMarketDataFeedClient&amp;diff=142</id>
		<title>AsxItchMarketDataFeedClient</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=AsxItchMarketDataFeedClient&amp;diff=142"/>
		<updated>2026-05-27T20:14:03Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;Support for ASX Trade ITCH market data is provided by the AsxItchMarketDataFeedClient. This market data feed can be used by Spire to populate the security database for ASX lis...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Support for ASX Trade ITCH market data is provided by the AsxItchMarketDataFeedClient. This market data feed can be used by Spire to populate the security database for ASX listed securities, BBO quotes, time and sales, book quotes and order imbalances. In addition to real time market data, ASX Trade ITCH also provides a market data snapshot used for data recovery along with retransmission of dropped packets, both of which are fully supported.&lt;br /&gt;
&lt;br /&gt;
For more information about the ASX ITCH protocol and connectivity, refer to the [https://www.asxonline.com/public/documents/asx-trade-open-interface-manuals.html ASX Trade Open Interface manuals].&lt;br /&gt;
&lt;br /&gt;
== Feed Partitioning ==&lt;br /&gt;
&lt;br /&gt;
By default ASX ITCH is split into multiple feeds each handling a range of securities. Each feed is placed in its own directory and named &amp;lt;code&amp;gt;asxitch_partition[N]&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;N = 1&amp;lt;/code&amp;gt; representing the first feed. Each feed also has its own configuration file.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
Each feed is configured via a YAML file (&amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt;) with the following structure:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used to authenticate with the Service Locator.&lt;br /&gt;
  username: market_data_feed&lt;br /&gt;
  # The password for the Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
# Rate at which market data snapshots are sampled and forwarded to the&lt;br /&gt;
# Market Data Server. A higher rate reduces load at the cost of latency.&lt;br /&gt;
sampling: 100ms&lt;br /&gt;
&lt;br /&gt;
# Multicast group address and port for the ITCH feed.&lt;br /&gt;
host: &amp;quot;239.0.0.1:21801&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Network interface to join the multicast group on.&lt;br /&gt;
interface: &amp;quot;0.0.0.0:0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# UDP socket receive buffer size in bytes (default: 128 MB).&lt;br /&gt;
receive_buffer: 134217728&lt;br /&gt;
&lt;br /&gt;
# Maximum datagram size (MTU) in bytes (optional; defaults to system MTU).&lt;br /&gt;
mtu: 1500&lt;br /&gt;
&lt;br /&gt;
# Enable logging of every received message (off by default; verbose when enabled).&lt;br /&gt;
enable_logging: false&lt;br /&gt;
&lt;br /&gt;
# Whether this partition carries time and sales data.&lt;br /&gt;
is_time_and_sale: false&lt;br /&gt;
&lt;br /&gt;
# Venue display name (e.g., &amp;quot;XASX&amp;quot;) this feed services.&lt;br /&gt;
venue: &amp;quot;XASX&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Default MPID assigned to messages that do not carry their own MPID.&lt;br /&gt;
mpid: &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Whether to consolidate multiple MPIDs into the default MPID.&lt;br /&gt;
consolidate_mpids: false&lt;br /&gt;
&lt;br /&gt;
# GLIMPSE snapshot server address (SoupBinTCP).&lt;br /&gt;
glimpse_host: &amp;quot;203.0.113.10:21803&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Timeout for the GLIMPSE login handshake.&lt;br /&gt;
glimpse_timeout: &amp;quot;00:00:10&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# GLIMPSE login credentials.&lt;br /&gt;
username: glimpse_user&lt;br /&gt;
password: [REQUIRED]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;sampling&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;host&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;interface&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;glimpse_host&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;password&amp;lt;/code&amp;gt; fields are required. All other fields have defaults.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The AsxItchMarketDataFeedClient contains the standard suite of scripts used to manage each individual feed.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt; - Starts a feed. Accepts a single feed identifier &amp;lt;code&amp;gt;partition[N]&amp;lt;/code&amp;gt; as a command line argument to start one feed, or &amp;lt;code&amp;gt;all&amp;lt;/code&amp;gt; to start every configured feed.&lt;br /&gt;
* &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt; - Stops a currently running feed. Accepts the same arguments as &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;list_feeds.sh&amp;lt;/code&amp;gt; - Outputs all currently running feeds.&lt;br /&gt;
* &amp;lt;code&amp;gt;create_softlinks.sh&amp;lt;/code&amp;gt; - Used when first setting up the feeds, or when a new feed is added, to create the necessary softlinks for each partition.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
On startup a log file is created with the name &amp;lt;code&amp;gt;srv_[YYYY][MM][DD]_[HH]_[MM]_[SS].log&amp;lt;/code&amp;gt; and is used to record dropped packets, any error messages or warnings, and, if logging is enabled in the configuration file, a dump of every received message.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Order_Execution_Server&amp;diff=141</id>
		<title>Order Execution Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Order_Execution_Server&amp;diff=141"/>
		<updated>2026-05-27T20:10:32Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Order Execution Server receives order submissions from clients, routes them to appropriate execution venues or brokers, and tracks the lifecycle of each order from submiss...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Order Execution Server receives order submissions from clients, routes them to appropriate execution venues or brokers, and tracks the lifecycle of each order from submission through completion. It publishes execution reports to subscribed clients, enforces compliance rules and risk parameters, and maintains a persistent record of all order activity. By centralizing order routing and monitoring, the server ensures consistent application of trading controls while providing real-time visibility into order status across the system.&lt;br /&gt;
&lt;br /&gt;
The Order Execution Server integrates with the [[Service Locator]] for authentication, the [[Compliance Server]] for rule validation, the [[Risk Server]] for position and loss monitoring, the [[Administration Server]] for risk parameters, the [[Market Data Server]] for pricing and board lot checks, the [[Uid Server]] for unique order identifiers, and a MySQL database (with optional replication) to persist order records and execution reports.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Order Execution Server is configured via a YAML file with three top-level sections: &amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;data_store&amp;lt;/code&amp;gt;. An optional &amp;lt;code&amp;gt;session_start_time&amp;lt;/code&amp;gt; field may also be specified. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server:&lt;br /&gt;
  # Primary network interface and port the Order Execution Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:20700&amp;quot;&lt;br /&gt;
  # List of addresses the server is reachable at (for registration with Service Locator).&lt;br /&gt;
  # Typically includes both public-facing and local addresses.&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:20700&amp;quot;, &amp;quot;10.0.0.5:20700&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used by the Order Execution Server to authenticate with the Service Locator.&lt;br /&gt;
  username: order_execution_server&lt;br /&gt;
  # The password for the Order Execution Server's Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
# Data store supports replication: provide either a single MySQL endpoint&lt;br /&gt;
# or a list of endpoints to replicate writes across.&lt;br /&gt;
data_store:&lt;br /&gt;
  # The address of the MySQL server.&lt;br /&gt;
  address: &amp;quot;127.0.0.1:3306&amp;quot;&lt;br /&gt;
  # The username used to authenticate with MySQL.&lt;br /&gt;
  username: spireadmin&lt;br /&gt;
  # The password for the MySQL user.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
  # The name of the database schema where data is stored.&lt;br /&gt;
  schema: spire&lt;br /&gt;
&lt;br /&gt;
# Optional start time of the trading session (default: +infinity, meaning no session boundary).&lt;br /&gt;
session_start_time: &amp;quot;2026-01-01 09:30:00&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0                 # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5            # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000        # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]           # Service password for authentication&lt;br /&gt;
  --mysql_address 127.0.0.1:3306  # MySQL server address&lt;br /&gt;
  --mysql_username spireadmin     # MySQL username&lt;br /&gt;
  --mysql_password secretpw       # MySQL password (default: --password if omitted)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Order Submission ==&lt;br /&gt;
&lt;br /&gt;
Before routing, each order passes through a series of submission checks:&lt;br /&gt;
&lt;br /&gt;
* '''Board Lot Check''' - Validates that order quantities conform to the security's board lot size.&lt;br /&gt;
* '''Buying Power Check''' - Ensures the account has sufficient buying power for the order, accounting for current positions and exchange rate conversions.&lt;br /&gt;
* '''Risk State Check''' - Verifies the account is in a risk state that permits new orders.&lt;br /&gt;
* '''Compliance Rule Check''' - Validates the order against all active compliance rules for the account or group.&lt;br /&gt;
&lt;br /&gt;
Orders that fail any check are immediately rejected with an appropriate error message.&lt;br /&gt;
&lt;br /&gt;
== Order Routing ==&lt;br /&gt;
&lt;br /&gt;
The server routes orders to their specified destinations based on:&lt;br /&gt;
&lt;br /&gt;
* Destination configuration (venue, broker, or internal order type like MOE)&lt;br /&gt;
* Symbol resolution against the venue and trading session&lt;br /&gt;
&lt;br /&gt;
Orders that violate compliance rules or risk limits are rejected before routing.&lt;br /&gt;
&lt;br /&gt;
== Execution Reports ==&lt;br /&gt;
&lt;br /&gt;
Clients can subscribe to receive execution reports for:&lt;br /&gt;
&lt;br /&gt;
* Specific accounts&lt;br /&gt;
* Groups of accounts&lt;br /&gt;
* Their own orders&lt;br /&gt;
&lt;br /&gt;
Subscriptions enable real-time tracking of order activity across portfolios or trading desks.&lt;br /&gt;
&lt;br /&gt;
== Order Cancellation ==&lt;br /&gt;
&lt;br /&gt;
Clients can request order cancellation. The server:&lt;br /&gt;
&lt;br /&gt;
# Validates the cancellation request against permissions and order state&lt;br /&gt;
# Forwards the cancellation to the destination&lt;br /&gt;
# Updates order state based on destination response&lt;br /&gt;
&lt;br /&gt;
=== Bulk Cancellation Utility ===&lt;br /&gt;
&lt;br /&gt;
A utility for bulk order cancellation supporting multiple use cases:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --config config.yml              # Configuration file&lt;br /&gt;
  --region CA                      # Country code, venue, or security&lt;br /&gt;
  --connections 8                  # Parallel connections for performance&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script supports parallel processing using multiple service connections to efficiently cancel large numbers of orders.&lt;br /&gt;
&lt;br /&gt;
== Data Store Replication ==&lt;br /&gt;
&lt;br /&gt;
The Order Execution Server supports a replicated data store, allowing order records to be written across multiple MySQL endpoints for redundancy. When multiple endpoints are configured in the &amp;lt;code&amp;gt;data_store&amp;lt;/code&amp;gt; section, writes are replicated to all configured stores while reads can be served from any available replica.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Order Execution Server is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
&lt;br /&gt;
* Exits immediately if the server is already running.&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary.&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;OrderExecutionServer&amp;lt;/code&amp;gt; process in the background.&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address.&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown.&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds).&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly.&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable).&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Risk_Server&amp;diff=140</id>
		<title>Risk Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Risk_Server&amp;diff=140"/>
		<updated>2026-05-27T20:07:49Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Risk Server monitors account profit and loss, enforces risk limits, and manages account state transitions based on trading activity. It tracks each account's net position,...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Risk Server monitors account profit and loss, enforces risk limits, and manages account state transitions based on trading activity. It tracks each account's net position, buying power consumption, and realized/unrealized profit and loss. When an account exceeds its configured loss threshold, the server automatically transitions the account through risk states from active trading to closed orders mode, and ultimately to disabled or liquidation if losses continue. By centralizing risk monitoring and enforcement, the server protects both individual accounts and the overall system from excessive exposure.&lt;br /&gt;
&lt;br /&gt;
The Risk Server integrates with the [[Service Locator]] for authentication, the [[Order Execution Server]] to monitor trades, the [[Market Data Server]] for price discovery, the [[Administration Server]] for risk parameters, and a MySQL database to persist risk parameters and inventory snapshots.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Risk Server is configured via a YAML file with three top-level sections: &amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;data_store&amp;lt;/code&amp;gt;. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server:&lt;br /&gt;
  # Primary network interface and port the Risk Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:20600&amp;quot;&lt;br /&gt;
  # List of addresses the server is reachable at (for registration with Service Locator).&lt;br /&gt;
  # Typically includes both public-facing and local addresses.&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:20600&amp;quot;, &amp;quot;10.0.0.5:20600&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used by the Risk Server to authenticate with the Service Locator.&lt;br /&gt;
  username: risk_server&lt;br /&gt;
  # The password for the Risk Server's Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
data_store:&lt;br /&gt;
  # The address of the MySQL server.&lt;br /&gt;
  address: &amp;quot;127.0.0.1:3306&amp;quot;&lt;br /&gt;
  # The username used to authenticate with MySQL.&lt;br /&gt;
  username: spireadmin&lt;br /&gt;
  # The password for the MySQL user.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
  # The name of the database schema where data is stored.&lt;br /&gt;
  schema: spire&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0                 # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5            # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000        # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]           # Service password for authentication&lt;br /&gt;
  --mysql_address 127.0.0.1:3306  # MySQL server address&lt;br /&gt;
  --mysql_username spireadmin     # MySQL username&lt;br /&gt;
  --mysql_password secretpw       # MySQL password (default: --password if omitted)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Risk Parameters ==&lt;br /&gt;
&lt;br /&gt;
Each account is assigned risk parameters that govern its trading limits and risk enforcement behavior:&lt;br /&gt;
&lt;br /&gt;
* '''Currency''' - The currency used for risk calculations and loss limits&lt;br /&gt;
* '''Buying Power''' - Maximum amount of capital available for trading&lt;br /&gt;
* '''Allowed State''' - The risk state the account is permitted to operate in&lt;br /&gt;
* '''Net Loss Threshold''' - Maximum net loss before transitioning to closed orders mode&lt;br /&gt;
* '''Transition Time''' - Duration allowed in closed orders mode before automatic liquidation&lt;br /&gt;
&lt;br /&gt;
== Risk States ==&lt;br /&gt;
&lt;br /&gt;
Accounts progress through the following risk states based on their profit and loss:&lt;br /&gt;
&lt;br /&gt;
* '''Active''' - Normal trading with full permissions&lt;br /&gt;
* '''Closed Orders''' - No new orders allowed; existing positions may be closed&lt;br /&gt;
* '''Disabled''' - Trading prohibited; positions automatically liquidated&lt;br /&gt;
&lt;br /&gt;
When an account's net loss exceeds its configured threshold, the server automatically transitions the account to closed orders mode and starts a timer. If the account does reduce its loss above the threshold within the transition time, the account transitions to disabled.&lt;br /&gt;
&lt;br /&gt;
== Inventory Tracking ==&lt;br /&gt;
&lt;br /&gt;
The server maintains real-time inventory snapshots for each account, tracking:&lt;br /&gt;
&lt;br /&gt;
* Open positions by security&lt;br /&gt;
* Cost basis and average entry price&lt;br /&gt;
* Realized and unrealized profit and loss&lt;br /&gt;
* Buying power consumption&lt;br /&gt;
&lt;br /&gt;
Inventory updates occur on every execution report, ensuring accurate position tracking across all trading venues.&lt;br /&gt;
&lt;br /&gt;
== Regional Scoping ==&lt;br /&gt;
&lt;br /&gt;
Risk parameters and state transitions can be scoped by region (country, venue, or security). This enables fine-grained control over risk exposure in specific markets or asset classes.&lt;br /&gt;
&lt;br /&gt;
== Utility Scripts ==&lt;br /&gt;
&lt;br /&gt;
=== Position Report ===&lt;br /&gt;
&lt;br /&gt;
Reports current positions for accounts in CSV format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --config config.yml       # Configuration file&lt;br /&gt;
  --account trader1         # Specific account (optional; reports all if omitted)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Output format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Account,Security,Currency,Side,Open Quantity,Cost Basis&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Manual Order Entry ===&lt;br /&gt;
&lt;br /&gt;
Manual Order Entry (MOE) utility for opening or closing positions without market execution. These orders are synthetic and do not interact with external venues:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --config config.yml           # Configuration file&lt;br /&gt;
  --positions positions.csv     # CSV file with positions to MOE&lt;br /&gt;
  --account trader1             # Specific account (optional)&lt;br /&gt;
  --region CA                   # Region filter (country/venue/security)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The positions CSV uses the following format:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Account,Security,Currency,Side,Open Quantity,Cost Basis&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Reset Risk States ===&lt;br /&gt;
&lt;br /&gt;
Resets risk state for a specific region, clearing accumulated profit/loss tracking:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --config config.yml       # Configuration file&lt;br /&gt;
  --region CA               # Region to reset (country code, venue, or security)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This utility is typically used at the start of a trading day or after maintenance periods to reset risk calculations.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Risk Server is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
&lt;br /&gt;
* Exits immediately if the server is already running.&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary.&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;RiskServer&amp;lt;/code&amp;gt; process in the background.&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address.&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown.&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds).&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly.&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable).&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Compliance_Server&amp;diff=139</id>
		<title>Compliance Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Compliance_Server&amp;diff=139"/>
		<updated>2026-05-27T20:03:40Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Compliance Server manages compliance rules and monitors rule violations for trading accounts. It maintains a repository of compliance rule definitions organized by directo...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Compliance Server manages compliance rules and monitors rule violations for trading accounts. It maintains a repository of compliance rule definitions organized by directory entry, tracks rule states (active, passive, or deleted), and records violation events. By centralizing compliance rule administration and violation tracking, the server enforces consistent regulatory and risk management policies across the trading platform.&lt;br /&gt;
&lt;br /&gt;
The Compliance Server integrates with the [[Service Locator]] for authentication and permission verification, the [[Administration Server]] to validate administrator privileges, and a MySQL database to persist compliance rules and violation records.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Compliance Server is configured via a YAML file with three top-level sections: &amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;data_store&amp;lt;/code&amp;gt;. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server:&lt;br /&gt;
  # Primary network interface and port the Compliance Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:21900&amp;quot;&lt;br /&gt;
  # List of addresses the server is reachable at (for registration with Service Locator).&lt;br /&gt;
  # Typically includes both public-facing and local addresses.&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:21900&amp;quot;, &amp;quot;10.0.0.5:21900&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used by the Compliance Server to authenticate with the Service Locator.&lt;br /&gt;
  username: compliance_server&lt;br /&gt;
  # The password for the Compliance Server's Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
data_store:&lt;br /&gt;
  # The address of the MySQL server.&lt;br /&gt;
  address: &amp;quot;127.0.0.1:3306&amp;quot;&lt;br /&gt;
  # The username used to authenticate with MySQL.&lt;br /&gt;
  username: spireadmin&lt;br /&gt;
  # The password for the MySQL user.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
  # The name of the database schema where data is stored.&lt;br /&gt;
  schema: spire&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0                 # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5            # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000        # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]           # Service password for authentication&lt;br /&gt;
  --mysql_address 127.0.0.1:3306  # MySQL server address&lt;br /&gt;
  --mysql_username spireadmin     # MySQL username&lt;br /&gt;
  --mysql_password secretpw       # MySQL password (default: --password if omitted)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Capabilities ==&lt;br /&gt;
&lt;br /&gt;
The Compliance Server provides the following capabilities:&lt;br /&gt;
&lt;br /&gt;
=== Rule Management ===&lt;br /&gt;
&lt;br /&gt;
Compliance rules are organized by directory entry (accounts or groups) and consist of:&lt;br /&gt;
&lt;br /&gt;
* A compliance rule schema defining the rule logic&lt;br /&gt;
* Parameters configuring the rule's behavior&lt;br /&gt;
* A state indicating whether the rule is active, passive, or deleted&lt;br /&gt;
&lt;br /&gt;
Administrators can create, update, and delete compliance rules. Rule changes are immediately propagated to subscribed clients for real-time enforcement.&lt;br /&gt;
&lt;br /&gt;
=== Rule Loading and Subscription ===&lt;br /&gt;
&lt;br /&gt;
Clients can:&lt;br /&gt;
&lt;br /&gt;
* Load existing compliance rules for a specific directory entry&lt;br /&gt;
* Subscribe to receive real-time updates when rules are added, modified, or deleted&lt;br /&gt;
&lt;br /&gt;
Subscriptions enable clients to maintain synchronized views of active compliance rules without polling.&lt;br /&gt;
&lt;br /&gt;
=== Violation Reporting ===&lt;br /&gt;
&lt;br /&gt;
Administrators can report compliance rule violations, which are:&lt;br /&gt;
&lt;br /&gt;
* Persisted to the database for audit purposes&lt;br /&gt;
* Associated with the specific account and rule involved&lt;br /&gt;
* Timestamped using an NTP-synchronized time client&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Compliance Server is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
&lt;br /&gt;
* Exits immediately if the server is already running.&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary.&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;ComplianceServer&amp;lt;/code&amp;gt; process in the background.&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address.&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown.&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds).&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly.&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable).&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Charting_Server&amp;diff=138</id>
		<title>Charting Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Charting_Server&amp;diff=138"/>
		<updated>2026-05-27T20:02:09Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Charting Server processes time series queries on market data and publishes ongoing updates to clients. It performs calculations such as candlestick aggregation, technical...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Charting Server processes time series queries on market data and publishes ongoing updates to clients. It performs calculations such as candlestick aggregation, technical indicators, and other analytical transformations over historical and real-time market data. By centralizing these computations, the server enables multiple clients to subscribe to identical chart data without redundant calculation overhead.&lt;br /&gt;
&lt;br /&gt;
The Charting Server integrates with the [[Service Locator]] for authentication and service registration. Multiple Charting Servers can be deployed concurrently to distribute query processing load across instances, with the Service Locator performing the load balancing among them.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Charting Server is configured via a YAML file with two top-level sections: &amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server:&lt;br /&gt;
  # Primary network interface and port the Charting Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:21400&amp;quot;&lt;br /&gt;
  # List of addresses the server is reachable at (for registration with Service Locator).&lt;br /&gt;
  # Typically includes both public-facing and local addresses.&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:21400&amp;quot;, &amp;quot;10.0.0.5:21400&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used by the Charting Server to authenticate with the Service Locator.&lt;br /&gt;
  username: charting_server&lt;br /&gt;
  # The password for the Charting Server's Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0           # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5      # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000  # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]     # Service password for authentication&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Charting Server is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
&lt;br /&gt;
* Exits immediately if the server is already running.&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary.&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;ChartingServer&amp;lt;/code&amp;gt; process in the background.&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address.&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown.&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds).&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly.&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable).&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Market_Data_Relay_Server&amp;diff=137</id>
		<title>Market Data Relay Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Market_Data_Relay_Server&amp;diff=137"/>
		<updated>2026-05-27T19:56:18Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Market Data Relay Server provides load-balanced distribution of market data to end users. It acts as an intermediary layer between the Market Data Server and client ap...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Market Data Relay Server provides load-balanced distribution of market data to end users. It acts as an intermediary layer between the [[Market Data Server]] and client applications, receiving market data updates from the Market Data Server and relaying them to subscribed clients. By deploying multiple relay servers in parallel, the system can distribute client connections across instances, ensuring scalable and resilient market data delivery.&lt;br /&gt;
&lt;br /&gt;
The Market Data Relay Server integrates with the [[Service Locator]] for authentication and service registration. Multiple relay servers can operate concurrently to distribute load across the infrastructure.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Market Data Relay Server is configured via a YAML file with two top-level sections (&amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;) plus optional tuning parameters. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server:&lt;br /&gt;
  # Primary network interface and port the Market Data Relay Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:22300&amp;quot;&lt;br /&gt;
  # List of addresses the server is reachable at (for registration with Service Locator).&lt;br /&gt;
  # Typically includes both public-facing and local addresses.&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:22300&amp;quot;, &amp;quot;10.0.0.5:22300&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used by the Market Data Relay Server to authenticate with the Service Locator.&lt;br /&gt;
  username: market_data_relay_server&lt;br /&gt;
  # The password for the Market Data Relay Server's Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
# Optional timeout for upstream Market Data Server connections (default: 500 ms).&lt;br /&gt;
connection_timeout: 500ms&lt;br /&gt;
&lt;br /&gt;
# Optional minimum pool size for upstream connections (default: hardware concurrency).&lt;br /&gt;
min_connections: 8&lt;br /&gt;
&lt;br /&gt;
# Optional maximum pool size for upstream connections (default: 10 * min_connections).&lt;br /&gt;
max_connections: 80&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0           # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5      # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000  # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]     # Service password for authentication&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Architecture ==&lt;br /&gt;
&lt;br /&gt;
The market data distribution architecture consists of three tiers:&lt;br /&gt;
&lt;br /&gt;
# '''Feed Clients''' publish raw market data to the Market Data Server.&lt;br /&gt;
# '''Market Data Server''' organizes, sequences, and persists market data.&lt;br /&gt;
# '''Market Data Relay Servers''' distribute market data to end-user clients.&lt;br /&gt;
&lt;br /&gt;
This architecture separates data processing from distribution, allowing the Market Data Server to focus on sequencing and storage while relay servers handle the potentially large number of client connections. Multiple relay servers can be deployed to distribute client load geographically or by capacity requirements.&lt;br /&gt;
&lt;br /&gt;
When multiple Market Data Servers are registered with the Service Locator (each potentially serving different country scopes), the relay server connects to all of them and routes client subscriptions to the appropriate upstream based on the country associated with each security.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Market Data Relay Server is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
&lt;br /&gt;
* Exits immediately if the server is already running.&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary.&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;MarketDataRelayServer&amp;lt;/code&amp;gt; process in the background.&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address.&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown.&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds).&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly.&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable).&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Market_Data_Server&amp;diff=136</id>
		<title>Market Data Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Market_Data_Server&amp;diff=136"/>
		<updated>2026-05-27T19:54:00Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Market Data Server receives market data from feed clients, organizes and persists the data, and provides query and subscription services to clients. It maintains real-time...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Market Data Server receives market data from feed clients, organizes and persists the data, and provides query and subscription services to clients. It maintains real-time market data snapshots for each security, tracks security technicals (open, high, low, close, volume), and sequences all market data updates to ensure consistent ordering across the system. The server supports multiple market data types including best bid/offer quotes, book quotes, time and sales, and order imbalances.&lt;br /&gt;
&lt;br /&gt;
The Market Data Server integrates with the [[Service Locator]] for authentication and a MySQL database for historical data storage. It operates as two distinct services: a '''registry server''' for managing security metadata and subscriptions, and a '''feed server''' for receiving and distributing market data updates.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Market Data Server is configured via a YAML file with five top-level sections: &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;registry_server&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;feed_server&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;data_store&amp;lt;/code&amp;gt;, and an optional &amp;lt;code&amp;gt;countries&amp;lt;/code&amp;gt; filter. A &amp;lt;code&amp;gt;cache_block_size&amp;lt;/code&amp;gt; may also be specified. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used by the Market Data Server to authenticate with the Service Locator.&lt;br /&gt;
  username: market_data_server&lt;br /&gt;
  # The password for the Market Data Server's Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
registry_server:&lt;br /&gt;
  # Primary network interface and port the Market Data Registry Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:20300&amp;quot;&lt;br /&gt;
  # List of addresses the registry server is reachable at (for registration with Service Locator).&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:20300&amp;quot;, &amp;quot;10.0.0.5:20300&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
feed_server:&lt;br /&gt;
  # Primary network interface and port the Market Data Feed Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:20400&amp;quot;&lt;br /&gt;
  # List of addresses the feed server is reachable at (for registration with Service Locator).&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:20400&amp;quot;, &amp;quot;10.0.0.5:20400&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
data_store:&lt;br /&gt;
  # The address of the MySQL server.&lt;br /&gt;
  address: &amp;quot;127.0.0.1:3306&amp;quot;&lt;br /&gt;
  # The username used to authenticate with MySQL.&lt;br /&gt;
  username: spireadmin&lt;br /&gt;
  # The password for the MySQL user.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
  # The name of the database schema where data is stored.&lt;br /&gt;
  schema: spire&lt;br /&gt;
&lt;br /&gt;
# Optional restriction of market data to specified countries (by ISO code).&lt;br /&gt;
countries: [&amp;quot;US&amp;quot;, &amp;quot;CA&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
# Number of records to buffer per write to the historical data store (default: 1000).&lt;br /&gt;
cache_block_size: 1000&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0                 # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5            # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000        # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]           # Service password for authentication&lt;br /&gt;
  --mysql_address 127.0.0.1:3306  # MySQL server address&lt;br /&gt;
  --mysql_username spireadmin     # MySQL username&lt;br /&gt;
  --mysql_password secretpw       # MySQL password (default: --password if omitted)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Market Data Types ==&lt;br /&gt;
&lt;br /&gt;
The server processes and distributes the following market data types:&lt;br /&gt;
&lt;br /&gt;
* '''BBO Quotes''' (Best Bid/Offer) - Top-of-book bid and ask prices with sizes&lt;br /&gt;
* '''Book Quotes''' - Full order book depth with multiple price levels per side&lt;br /&gt;
* '''Time and Sales''' - Executed trade prices, sizes, and timestamps&lt;br /&gt;
* '''Order Imbalances''' - Pre-opening and closing auction imbalance data&lt;br /&gt;
&lt;br /&gt;
In addition to raw market data, the server publishes:&lt;br /&gt;
&lt;br /&gt;
* Real-time market data snapshots combining BBO, book depth, and last trade&lt;br /&gt;
* Security technicals including open, high, low, close, and volume&lt;br /&gt;
* Sequence numbers ensuring consistent ordering of market data updates&lt;br /&gt;
* Source tracking to identify which feed client published each data point&lt;br /&gt;
&lt;br /&gt;
All market data updates are assigned monotonically increasing sequence numbers per security and data type. This ensures clients can detect gaps, maintain consistent ordering, and synchronize state reliably.&lt;br /&gt;
&lt;br /&gt;
== Storage ==&lt;br /&gt;
&lt;br /&gt;
Market data is persisted to MySQL with indexed queries supporting:&lt;br /&gt;
&lt;br /&gt;
* Efficient storage of high-frequency data streams&lt;br /&gt;
* Time-bounded historical queries&lt;br /&gt;
* Per-security and per-data-type lookups&lt;br /&gt;
&lt;br /&gt;
== Utility Scripts ==&lt;br /&gt;
&lt;br /&gt;
A utility script is provided to add or update security metadata in the system.&lt;br /&gt;
&lt;br /&gt;
A backup and restore utility supports bidirectional data transfer between MySQL and SQLite:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --config config.yml              # Configuration file&lt;br /&gt;
  --start &amp;quot;2024-01-01 00:00:00&amp;quot;   # Start time range&lt;br /&gt;
  --end &amp;quot;2024-12-31 23:59:59&amp;quot;     # End time range&lt;br /&gt;
  --output backup.db               # Export MySQL to SQLite&lt;br /&gt;
  --cores 8                        # Number of parallel workers&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script uses multiprocessing to efficiently backup or restore large datasets across multiple securities and venues in parallel.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Market Data Server is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
&lt;br /&gt;
* Exits immediately if the server is already running.&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary.&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;MarketDataServer&amp;lt;/code&amp;gt; process in the background.&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address.&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown.&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds).&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly.&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable).&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Definitions_Server&amp;diff=135</id>
		<title>Definitions Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Definitions_Server&amp;diff=135"/>
		<updated>2026-05-27T19:51:39Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Definitions Server provides centralized reference data for the trading platform. It disseminates system-wide definitions including country codes, currencies, trading venue...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Definitions Server provides centralized reference data for the trading platform. It disseminates system-wide definitions including country codes, currencies, trading venues, order routing destinations, time zones, exchange rates, compliance rule schemas, and trading schedules. By centralizing these definitions, the server ensures consistent metadata across all components of the system.&lt;br /&gt;
&lt;br /&gt;
The Definitions Server integrates with the [[Service Locator]] for authentication and service registration. All reference data is loaded from YAML and CSV configuration files at startup.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Definitions Server is configured via a YAML file with two top-level sections (&amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;) plus several inline fields that specify reference data files and platform metadata. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server:&lt;br /&gt;
  # Primary network interface and port the Definitions Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:20200&amp;quot;&lt;br /&gt;
  # List of addresses the server is reachable at (for registration with Service Locator).&lt;br /&gt;
  # Typically includes both public-facing and local addresses.&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:20200&amp;quot;, &amp;quot;10.0.0.5:20200&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used by the Definitions Server to authenticate with the Service Locator.&lt;br /&gt;
  username: definitions_server&lt;br /&gt;
  # The password for the Definitions Server's Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
# Minimum version of the Spire client required to connect.&lt;br /&gt;
minimum_spire_version: &amp;quot;1234&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Name of the organization operating the platform.&lt;br /&gt;
organization: &amp;quot;Spire Trading Inc.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Paths to reference data files.&lt;br /&gt;
time_zones: &amp;quot;time_zones.csv&amp;quot;&lt;br /&gt;
countries: &amp;quot;countries.yml&amp;quot;&lt;br /&gt;
currencies: &amp;quot;currencies.yml&amp;quot;&lt;br /&gt;
venues: &amp;quot;venues.yml&amp;quot;&lt;br /&gt;
destinations: &amp;quot;destinations.yml&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Exchange rates between currency pairs.&lt;br /&gt;
exchange_rates:&lt;br /&gt;
  - symbol: &amp;quot;USD/CAD&amp;quot;&lt;br /&gt;
    rate: &amp;quot;1.35&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# NTP servers registered as time service endpoints.&lt;br /&gt;
ntp_pool: [&amp;quot;pool.ntp.org:123&amp;quot;]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template. The script also copies default reference data files if they do not already exist. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0           # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5      # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000  # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]     # Service password for authentication&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Reference Data Files ==&lt;br /&gt;
&lt;br /&gt;
The Definitions Server loads reference data from the following files:&lt;br /&gt;
&lt;br /&gt;
=== countries.yml ===&lt;br /&gt;
&lt;br /&gt;
Defines country codes according to the ISO 3166 standard. A utility script (&amp;lt;code&amp;gt;update_countries.sh&amp;lt;/code&amp;gt;) is provided to download and update country definitions from the official ISO 3166 data source. The script uses &amp;lt;code&amp;gt;country_code_parser.py&amp;lt;/code&amp;gt; to parse the CSV data and generate the YAML file.&lt;br /&gt;
&lt;br /&gt;
=== currencies.yml ===&lt;br /&gt;
&lt;br /&gt;
Defines currencies including their codes, names, and decimal places.&lt;br /&gt;
&lt;br /&gt;
=== venues.yml ===&lt;br /&gt;
&lt;br /&gt;
Defines trading venues (exchanges and markets) including their country, time zone, and currency.&lt;br /&gt;
&lt;br /&gt;
=== destinations.yml ===&lt;br /&gt;
&lt;br /&gt;
Defines order routing destinations and their applicable venues. Preferred destinations specify default routing per venue.&lt;br /&gt;
&lt;br /&gt;
=== time_zones.csv ===&lt;br /&gt;
&lt;br /&gt;
Contains time zone database information in CSV format for accurate timestamp conversion across regions.&lt;br /&gt;
&lt;br /&gt;
=== trading_schedule.yml ===&lt;br /&gt;
&lt;br /&gt;
Defines market hours, holidays, and trading events.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Definitions Server is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
&lt;br /&gt;
* Exits immediately if the server is already running.&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary.&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;DefinitionsServer&amp;lt;/code&amp;gt; process in the background.&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address.&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown.&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds).&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly.&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable).&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Web_Portal&amp;diff=134</id>
		<title>Web Portal</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Web_Portal&amp;diff=134"/>
		<updated>2026-05-27T19:49:40Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Web Portal provides web-based access to account management and administrative functions through both a web API and an interactive HTML interface. It serves as the primary...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Web Portal provides web-based access to account management and administrative functions through both a web API and an interactive HTML interface. It serves as the primary user interface for creating and managing trading accounts, configuring market data entitlements, defining compliance rules, setting risk parameters, and monitoring account activity. By aggregating functionality from multiple backend services, the Web Portal enables administrators and managers to perform operational tasks through a unified web application.&lt;br /&gt;
&lt;br /&gt;
The Web Portal integrates with the [[Service Locator]] for authentication and communicates with the [[Administration Server]], [[Compliance Server]], [[Risk Server]], and [[Order Execution Server]] to provide comprehensive account management capabilities.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Web Portal is configured via a YAML file with two top-level sections: &amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;, plus an optional &amp;lt;code&amp;gt;url&amp;lt;/code&amp;gt; field. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
server:&lt;br /&gt;
  # Primary network interface and port the Web Portal binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:8080&amp;quot;&lt;br /&gt;
  # List of addresses the server is reachable at (for registration with Service Locator).&lt;br /&gt;
  # Typically includes both public-facing and local addresses.&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:8080&amp;quot;, &amp;quot;10.0.0.5:8080&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used by the Web Portal to authenticate with the Service Locator.&lt;br /&gt;
  username: web_portal&lt;br /&gt;
  # The password for the Web Portal's Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
# Optional public URL registered with the Service Locator (defaults to http://&amp;lt;interface&amp;gt;).&lt;br /&gt;
url: &amp;quot;https://portal.example.com&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from the &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0           # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5      # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000  # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]     # Service password for authentication&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Capabilities ==&lt;br /&gt;
&lt;br /&gt;
The Web Portal provides access to the following administrative and operational capabilities:&lt;br /&gt;
&lt;br /&gt;
* Configure account permissions and access controls&lt;br /&gt;
* Set account roles (trader, manager, administrator, service)&lt;br /&gt;
* Configure per-venue and per-message-type permissions&lt;br /&gt;
* Assign rules to accounts, groups, or directories&lt;br /&gt;
* Configure rule states (active, passive, disabled)&lt;br /&gt;
&lt;br /&gt;
== Permissions ==&lt;br /&gt;
&lt;br /&gt;
The Web Portal enforces permissions based on account roles:&lt;br /&gt;
&lt;br /&gt;
* '''Administrators''' have full access to all management functions&lt;br /&gt;
* '''Managers''' can manage accounts within their assigned groups&lt;br /&gt;
* '''Traders''' can view their own account details and activity&lt;br /&gt;
* '''Service''' accounts have restricted programmatic access&lt;br /&gt;
&lt;br /&gt;
All operations are authenticated through the Service Locator and logged for audit purposes.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Web Portal is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
&lt;br /&gt;
* Exits immediately if the server is already running.&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary.&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;WebPortal&amp;lt;/code&amp;gt; process in the background.&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address.&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown.&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds).&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly.&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable).&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Administration_Server&amp;diff=133</id>
		<title>Administration Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Administration_Server&amp;diff=133"/>
		<updated>2026-05-27T19:47:52Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Administration Server manages account-level authorization and operational metadata for Spire. It maintains each account's role (trader, manager, administrator, or service)...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Administration Server manages account-level authorization and operational metadata for Spire. It maintains each account's role (trader, manager, administrator, or service), market-data entitlements, risk parameters, and trading permissions. By centralizing these attributes, it enforces access control, entitlement visibility, and trading eligibility across the system.&lt;br /&gt;
&lt;br /&gt;
The server integrates with the [[Service Locator]] to enumerate accounts and with a MySQL database to persist administrative data.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Administration Server is configured via a YAML file with four top-level sections: &amp;lt;code&amp;gt;data_store&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;entitlements&amp;lt;/code&amp;gt;. A &amp;lt;code&amp;gt;grant_interval&amp;lt;/code&amp;gt; setting may also be specified. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data_store:&lt;br /&gt;
  # The address of the MySQL server.&lt;br /&gt;
  address: &amp;quot;127.0.0.1:3306&amp;quot;&lt;br /&gt;
  # The username used to authenticate with MySQL.&lt;br /&gt;
  username: spireadmin&lt;br /&gt;
  # The password for the MySQL user.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
  # The name of the database schema where data is stored.&lt;br /&gt;
  schema: spire&lt;br /&gt;
&lt;br /&gt;
server:&lt;br /&gt;
  # Primary network interface and port the Administration Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:20100&amp;quot;&lt;br /&gt;
  # List of addresses the server is reachable at (for registration with Service Locator).&lt;br /&gt;
  # Typically includes both public-facing and local addresses.&lt;br /&gt;
  addresses: [&amp;quot;198.51.100.5:20100&amp;quot;, &amp;quot;10.0.0.5:20100&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;10.0.0.5:20000&amp;quot;&lt;br /&gt;
  # The account username used to authenticate with the Service Locator.&lt;br /&gt;
  username: administration_server&lt;br /&gt;
  # The password for the Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&lt;br /&gt;
# Each entitlement specifies pricing, applicable exchanges, and message types.&lt;br /&gt;
entitlements:&lt;br /&gt;
  - name: &amp;quot;NYSE Basic&amp;quot;&lt;br /&gt;
    price: &amp;quot;10.00&amp;quot;&lt;br /&gt;
    currency: USD&lt;br /&gt;
    group: nyse_basic&lt;br /&gt;
    applicability:&lt;br /&gt;
      - venue: XNYS&lt;br /&gt;
        # source: the venue disseminating the market data&lt;br /&gt;
        source: XNYS&lt;br /&gt;
        messages: [BBO, TAS]&lt;br /&gt;
&lt;br /&gt;
# Interval at which entitlement grants are reapplied (default: 1 hour).&lt;br /&gt;
grant_interval: 1h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided to generate the final &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt;. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0                   # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 198.51.100.5              # Global/public interface (optional)&lt;br /&gt;
  --address 10.0.0.5:20000          # Service Locator address (default: local_interface:20000)&lt;br /&gt;
  --password [REQUIRED]             # Admin password for Service Locator&lt;br /&gt;
  --mysql_address 127.0.0.1:3306    # MySQL server address&lt;br /&gt;
  --mysql_password secretpw         # MySQL password (default: --password if omitted)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A reset script (&amp;lt;code&amp;gt;reset_risk_states.py&amp;lt;/code&amp;gt;) is provided to initialize or reset the risk state for all accounts and is typically run on a daily basis.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Administration Server is controlled using three operational scripts: &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== start.sh ===&lt;br /&gt;
&lt;br /&gt;
* Exits immediately if the server is already running.&lt;br /&gt;
* Creates a &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory if necessary.&lt;br /&gt;
* Moves any existing &amp;lt;code&amp;gt;srv_*.log&amp;lt;/code&amp;gt; files into &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Starts the &amp;lt;code&amp;gt;AdministrationServer&amp;lt;/code&amp;gt; process in the background.&lt;br /&gt;
* Reads network interfaces from &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; and waits until the server is listening on at least one configured address.&lt;br /&gt;
&lt;br /&gt;
This ensures the server is fully initialized before the script exits.&lt;br /&gt;
&lt;br /&gt;
=== stop.sh ===&lt;br /&gt;
&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGINT&amp;lt;/code&amp;gt; to request a graceful shutdown.&lt;br /&gt;
* Waits for termination using exponential backoff (up to 300 seconds).&lt;br /&gt;
* Sends &amp;lt;code&amp;gt;SIGKILL&amp;lt;/code&amp;gt; if the server fails to stop cleanly.&lt;br /&gt;
* Appends a forced-termination message to the most recent log file (if applicable).&lt;br /&gt;
&lt;br /&gt;
This guarantees consistent shutdown behavior across normal and exceptional conditions.&lt;br /&gt;
&lt;br /&gt;
=== check.sh ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies whether the server is currently running by inspecting the PID recorded in &amp;lt;code&amp;gt;pid.lock&amp;lt;/code&amp;gt; and testing whether the associated process exists.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Upon startup, older log files are moved into the &amp;lt;code&amp;gt;logs/&amp;lt;/code&amp;gt; directory.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Uid_Server&amp;diff=132</id>
		<title>Uid Server</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Uid_Server&amp;diff=132"/>
		<updated>2026-05-27T19:43:54Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Uid Server is a centralized service responsible for generating batches of unique integers that can be used to identify items, such as database entries. The Uid Server regi...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Uid Server is a centralized service responsible for generating batches of unique integers that can be used to identify items, such as database entries. The Uid Server registers itself with the [[Service Locator]] as a &amp;lt;code&amp;gt;uid_server&amp;lt;/code&amp;gt; and ensures uniqueness by tracking allocated identifiers in a MySQL database.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Uid Server is configured via a YAML file with three top-level sections: &amp;lt;code&amp;gt;data_store&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;server&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;service_locator&amp;lt;/code&amp;gt;. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
data_store:&lt;br /&gt;
  # The address of the MySQL server.&lt;br /&gt;
  address: &amp;quot;127.0.0.1:3306&amp;quot;&lt;br /&gt;
  # The username used to authenticate with MySQL.&lt;br /&gt;
  username: spireadmin&lt;br /&gt;
  # The password for the MySQL user.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
  # The name of the database schema where data is stored.&lt;br /&gt;
  schema: spire&lt;br /&gt;
&lt;br /&gt;
server:&lt;br /&gt;
  # The network interface and port the Uid Server binds to.&lt;br /&gt;
  interface: &amp;quot;0.0.0.0:20900&amp;quot;&lt;br /&gt;
  # List of addresses the server advertises for client connections.&lt;br /&gt;
  addresses: [&amp;quot;192.168.1.100:20900&amp;quot;, &amp;quot;0.0.0.0:20900&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
service_locator:&lt;br /&gt;
  # The address of the Service Locator (host:port).&lt;br /&gt;
  address: &amp;quot;127.0.0.1:20000&amp;quot;&lt;br /&gt;
  # The account username used to authenticate with the Service Locator.&lt;br /&gt;
  username: uid_server&lt;br /&gt;
  # The password for the Service Locator account.&lt;br /&gt;
  password: [REQUIRED]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Python script automates configuration file generation. Usage:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0                   # Local interface (default: auto-detected IP)&lt;br /&gt;
  --world 192.168.1.100             # Global interface (default: same as local)&lt;br /&gt;
  --address 127.0.0.1:20000         # Service Locator address&lt;br /&gt;
  --password [REQUIRED]             # Admin password for Service Locator&lt;br /&gt;
  --mysql_address 127.0.0.1:3306    # MySQL server address&lt;br /&gt;
  --mysql_username admin            # MySQL username (default: spireadmin)&lt;br /&gt;
  --mysql_password [OPTIONAL]       # MySQL password (default: same as admin password)&lt;br /&gt;
  --mysql_schema uid_db             # Database schema (default: spire)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script:&lt;br /&gt;
* Generates &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;config.default.yml&amp;lt;/code&amp;gt; template.&lt;br /&gt;
* Requires only the &amp;lt;code&amp;gt;--password&amp;lt;/code&amp;gt; argument by default.&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Log files are generated as &amp;lt;code&amp;gt;srv_[YYYY][MM][DD]_[HH]_[MM]_[SS].log&amp;lt;/code&amp;gt; in the runtime directory. Upon termination, non-empty log files are moved into the &amp;lt;code&amp;gt;log/&amp;lt;/code&amp;gt; subfolder, while empty log files are deleted.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Uid Server is managed through three core scripts:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt; - Starts the Uid Server. Does nothing if the server is already running.&lt;br /&gt;
* &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt; - Stops an existing server instance and waits for the server to terminate.&lt;br /&gt;
* &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; - Verifies that the server is running and reports its status.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Service_Locator&amp;diff=131</id>
		<title>Service Locator</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Service_Locator&amp;diff=131"/>
		<updated>2026-05-27T19:41:19Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;The Service Locator is a centralized server responsible for authenticating account logins, creating and managing user accounts, organizing accounts into directories, controlli...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The Service Locator is a centralized server responsible for authenticating account logins, creating and managing user accounts, organizing accounts into directories, controlling permissions, and registering available services. It acts as a critical component for coordinating access control and service discovery. The Service Locator integrates with a MySQL database to persistently store account details, directory structures, permissions, and service registration data.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
The Service Locator is configured via a YAML file that defines its network interface and data store settings. Below is the structure of the configuration file with example values:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# The network interface and port the Service Locator binds to.&lt;br /&gt;
interface: &amp;quot;0.0.0.0:20000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
data_store:&lt;br /&gt;
  # The address of the MySQL server.&lt;br /&gt;
  address: &amp;quot;127.0.0.1:3306&amp;quot;&lt;br /&gt;
  # The username used to authenticate with MySQL.&lt;br /&gt;
  username: spireadmin&lt;br /&gt;
  # The password for the MySQL user.&lt;br /&gt;
  password: 1234&lt;br /&gt;
  # The name of the database schema where data is stored.&lt;br /&gt;
  schema: spire&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script is provided for convenience to configure the Service Locator and generate the &amp;lt;code&amp;gt;config.yml&amp;lt;/code&amp;gt; file. The script supports the following arguments:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  --local 0.0.0.0                   # Local interface (default: auto-detected IP)&lt;br /&gt;
  --mysql_address 127.0.0.1:3306    # MySQL server address&lt;br /&gt;
  --mysql_username admin            # MySQL username (default: spireadmin)&lt;br /&gt;
  --mysql_password [REQUIRED]       # MySQL password (no default)&lt;br /&gt;
  --mysql_schema service_db         # Database schema (default: spire)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Logging ==&lt;br /&gt;
&lt;br /&gt;
Log files are generated as &amp;lt;code&amp;gt;srv_[YYYY][MM][DD]_[HH]_[MM]_[SS].log&amp;lt;/code&amp;gt; in the runtime directory. Upon termination, non-empty log files are moved into the &amp;lt;code&amp;gt;log/&amp;lt;/code&amp;gt; subfolder, while empty log files are deleted.&lt;br /&gt;
&lt;br /&gt;
== Management ==&lt;br /&gt;
&lt;br /&gt;
The Service Locator is managed through three core scripts:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt; - Starts the Service Locator server. Does nothing if the server is already running.&lt;br /&gt;
* &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt; - Stops an existing server instance and waits for the server to terminate.&lt;br /&gt;
* &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; - Verifies that the server is running and reports its status.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Services&amp;diff=130</id>
		<title>Spire Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Services&amp;diff=130"/>
		<updated>2026-05-27T19:38:19Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;Spire is a distributed trading platform composed of multiple specialized servers that work together to provide a complete trading infrastructure. Each server is independently...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Spire is a distributed trading platform composed of multiple specialized servers that work together to provide a complete trading infrastructure. Each server is independently deployable, communicates through well-defined service interfaces, and authenticates through a central Service Locator.&lt;br /&gt;
&lt;br /&gt;
== Architecture Principles ==&lt;br /&gt;
&lt;br /&gt;
* '''Service-Oriented Design''' - Each server provides a focused set of functionality&lt;br /&gt;
* '''Distributed Deployment''' - Services can be deployed across multiple machines for scalability&lt;br /&gt;
* '''Centralized Authentication''' - All services authenticate through the Service Locator&lt;br /&gt;
* '''Persistent Storage''' - Critical data persisted to MySQL for durability&lt;br /&gt;
* '''Real-time Updates''' - Services publish updates to subscribed clients&lt;br /&gt;
&lt;br /&gt;
== Servers ==&lt;br /&gt;
&lt;br /&gt;
* '''[[Service Locator]]''' - Centralized authentication, account management, and service discovery&lt;br /&gt;
* '''[[Uid Server]]''' - Generates unique identifiers for orders and other entities&lt;br /&gt;
* '''[[Administration Server]]''' - Manages account roles, entitlements, risk parameters, and trading permissions&lt;br /&gt;
* '''[[Web Portal]]''' - Web-based interface for account management and administrative tasks&lt;br /&gt;
* '''[[Definitions Server]]''' - Provides reference data (countries, currencies, venues, trading schedules)&lt;br /&gt;
* '''[[Market Data Server]]''' - Receives, sequences, and persists market data from feed clients&lt;br /&gt;
* '''[[Market Data Relay Server]]''' - Load-balanced distribution of market data to end users&lt;br /&gt;
* '''[[Charting Server]]''' - Processes time series queries for candlestick and technical analysis data&lt;br /&gt;
* '''[[Compliance Server]]''' - Manages compliance rules and monitors violations&lt;br /&gt;
* '''[[Risk Server]]''' - Monitors profit/loss, enforces risk limits, manages account state transitions&lt;br /&gt;
* '''[[Order Execution Server]]''' - Routes orders to venues, tracks execution, enforces controls&lt;br /&gt;
&lt;br /&gt;
== Operations ==&lt;br /&gt;
&lt;br /&gt;
All servers follow consistent operational patterns. In addition to individual server management scripts, the platform provides aggregate scripts for managing all servers collectively.&lt;br /&gt;
&lt;br /&gt;
=== Installation ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;install.sh&amp;lt;/code&amp;gt; script is designed for the latest Ubuntu Server LTS and performs a complete system installation including:&lt;br /&gt;
&lt;br /&gt;
* Installing system dependencies (build tools, MySQL, Node.js, Python packages)&lt;br /&gt;
* Configuring MySQL database and creating the spire schema&lt;br /&gt;
* Creating service accounts in the Service Locator&lt;br /&gt;
* Setting up initial permissions and directory structure&lt;br /&gt;
* Configuring all servers with appropriate network settings&lt;br /&gt;
&lt;br /&gt;
The installation script automatically creates service accounts for all servers and assigns them to the appropriate permission groups.&lt;br /&gt;
&lt;br /&gt;
=== Configuration ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;setup.py&amp;lt;/code&amp;gt; script configures all servers by propagating common settings across individual server configurations. This script calls each server's individual setup script with appropriate parameters, ensuring consistent configuration across the platform.&lt;br /&gt;
&lt;br /&gt;
=== Starting and Stopping ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt; script starts all servers in dependency order. After starting all servers, the script automatically runs &amp;lt;code&amp;gt;reset_risk_states.py&amp;lt;/code&amp;gt; to initialize risk state for the trading session.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;stop.sh&amp;lt;/code&amp;gt; script gracefully stops all servers in reverse dependency order, ensuring that dependent services shut down before the services they depend on.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;check.sh&amp;lt;/code&amp;gt; script verifies that all servers are running and reports the status of each service. It exits with a non-zero status if any server is not running, making it suitable for monitoring and health check automation.&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Common.css&amp;diff=103</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Common.css&amp;diff=103"/>
		<updated>2020-04-28T16:33:08Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@import url('https://fonts.googleapis.com/css?family=Montserrat&amp;amp;display=swap');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** SELECTORS ***/&lt;br /&gt;
&lt;br /&gt;
html, body {&lt;br /&gt;
  font-family: Roboto, sans-serif;&lt;br /&gt;
  line-height: 18pt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
body {&lt;br /&gt;
  background-color: #FFF;&lt;br /&gt;
  background-image: url('https://wiki.spiretrading.com/images/b/bd/Footer.pattern.png');&lt;br /&gt;
  background-repeat: repeat-x;&lt;br /&gt;
  background-position: bottom center;&lt;br /&gt;
  background-size: 20%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
a, #mw-panel .portal .body li a {&lt;br /&gt;
  color: #4B23A0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1, h2, h3, h4, h5, h6 {&lt;br /&gt;
  font-family: 'Montserrat', sans-serif;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#mw-page-base {&lt;br /&gt;
  background-image: none;&lt;br /&gt;
  background-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** IDENTIFIERS ***/&lt;br /&gt;
&lt;br /&gt;
#pt-login-private a {&lt;br /&gt;
  color: #EC228F !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#p-logo {&lt;br /&gt;
    height: 70px !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** CLASSES ***/&lt;br /&gt;
&lt;br /&gt;
/* RESETTING GRADIENTS AND HEADINGD */&lt;br /&gt;
.vectorTabs, .vectorTabs span, #mw-head .vectorMenu h3, .vectorTabs li {&lt;br /&gt;
  background-image: none !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* LOGO */&lt;br /&gt;
.mw-wiki-logo {&lt;br /&gt;
    background-position: left 20px top 20px !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-body h1, .mw-body-content h1, .mw-body-content h2 {&lt;br /&gt;
  font-family: 'Montserrat', sans-serif;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.vectorTabs .selected {&lt;br /&gt;
  border-bottom: 2px solid #4B23A0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-body {&lt;br /&gt;
  border-color: #C8C8C8 !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.toc {&lt;br /&gt;
  background: #F8F9FA;&lt;br /&gt;
  border-color: #F2F2F2;&lt;br /&gt;
  margin: 15px 0;&lt;br /&gt;
  padding: 15px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** SKIN: TWEEKI CUSTOMIZATIONS ***/&lt;br /&gt;
&lt;br /&gt;
.navbar-brand img {&lt;br /&gt;
  margin-top: -5px;&lt;br /&gt;
  width: 136.5px;&lt;br /&gt;
  height: 35px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1, .h1 {&lt;br /&gt;
  font-size: 30px;&lt;br /&gt;
}&lt;br /&gt;
h2, .h2 {&lt;br /&gt;
  font-size: 27px;&lt;br /&gt;
}&lt;br /&gt;
h3, .h3 {&lt;br /&gt;
  font-size: 24px;&lt;br /&gt;
}&lt;br /&gt;
h4, .h4 {&lt;br /&gt;
  font-size: 20px;&lt;br /&gt;
}&lt;br /&gt;
h5, .h5 {&lt;br /&gt;
  font-size: 18px;&lt;br /&gt;
}&lt;br /&gt;
h6, .h6 {&lt;br /&gt;
  font-size: 16px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1, .h1, h2, .h2, h3, .h3 {&lt;br /&gt;
    margin-top: 25px;&lt;br /&gt;
    margin-bottom: 15px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.firstHeading, .tweekiFirstHeading {&lt;br /&gt;
  text-align: left;&lt;br /&gt;
  margin-bottom: 30px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar-default {&lt;br /&gt;
  background-image: none !important;&lt;br /&gt;
  background-color: #FFF !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn, #wpSave {&lt;br /&gt;
  border: 0px !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-default, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger, #wpSave {&lt;br /&gt;
  text-shadow: none !important;&lt;br /&gt;
  -webkit-box-shadow: none !important;&lt;br /&gt;
  box-shadow: none !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-primary, .mw-ui-button.mw-ui-progressive, #wpSave {&lt;br /&gt;
  background-image: none;&lt;br /&gt;
  background-color: #513392;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-primary:hover, .btn-primary:focus, .mw-ui-button.mw-ui-progressive:hover, mw-ui-button.mw-ui-progressive:focus, #wpSave:hover, #wpSave:focus {&lt;br /&gt;
  background-color: #6556A4;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-primary:active, .mw-ui-button.mw-ui-progressive:active, #wpSave:active {&lt;br /&gt;
  background-color: #453A70;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
a:hover, a:focus {&lt;br /&gt;
  color: #6556A4;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar-right {&lt;br /&gt;
  margin-top: 7px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#searchInput {&lt;br /&gt;
  margin-top: 5px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#searchInput:focus {&lt;br /&gt;
  border: 1px solid #4B23A0;&lt;br /&gt;
  background-image: none;&lt;br /&gt;
  outline: 0;&lt;br /&gt;
  -webkit-box-shadow: none;&lt;br /&gt;
  box-shadow: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#footer {&lt;br /&gt;
  background-color: #F8F8F8;&lt;br /&gt;
  padding: 15px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#footer-icons li:last-child::before {&lt;br /&gt;
  content: &amp;quot; • &amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
td.mw-label {&lt;br /&gt;
  padding-right: 10px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media only screen and (min-width: 1000px){&lt;br /&gt;
  #contentwrapper {&lt;br /&gt;
    margin-bottom: 190px !important;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.oo-ui-panelLayout-framed {&lt;br /&gt;
  border: 0 none #FFF;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=TypeScript_Style_Guide&amp;diff=102</id>
		<title>TypeScript Style Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=TypeScript_Style_Guide&amp;diff=102"/>
		<updated>2020-04-07T15:49:49Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article specifies the most general guidelines used for all Spire projects written using TypeScript as the primary programming language. Each individual project may extend or override the guidelines specified herein. The overall aim of this guideline is to provide consistency across the numerous projects developed by Spire in order to promote and benefit from modern web development practices as well as tailor them to our specific requirements.&lt;br /&gt;
&lt;br /&gt;
In general, the guidelines are very specific and opinionated. This is done intentionally to ensure that every detail has been given proper consideration and that every line of code is written with care and diligence. It is taken as a prerequisite that writing robust, clean and maintainable code requires paying close attention to even the smallest of details. As such, when there are two or more ways to write or express any given statement or expression, be it using spaces or tabs, number of characters per line, purple or violet, the guideline will often require that one particular approach be used to the exclusion of others.&lt;br /&gt;
&lt;br /&gt;
Finally, this document is constantly evolving and as such older projects may not be up-to-date with the guidelines found here. In those circumstances one must use their best judgment about how to integrate these guidelines into older codebases. As a general principle, consistency should favor the local over the global, that is it is more important to be consistent with a function definition than within a file, and more important to be consistent within a file than within a directory, project, etc...&lt;br /&gt;
&lt;br /&gt;
=Development Environment=&lt;br /&gt;
&lt;br /&gt;
The primary operating systems supported by Spire projects are Ubuntu 18.02 LTS, Windows 10, and macOS. On all systems, nodejs is used as the build system and webpack is used as the bundler.&lt;br /&gt;
&lt;br /&gt;
For source control, git is used and projects are to be hosted on [https://github.com/spiretrading Spire Trading's Github page].&lt;br /&gt;
&lt;br /&gt;
Each developer is welcome to use an editor of their choice, however [https://code.visualstudio.com/ Visual Studio Code] is recommended.&lt;br /&gt;
&lt;br /&gt;
=File Names=&lt;br /&gt;
&lt;br /&gt;
Use [https://en.wikipedia.org/wiki/Snake_case snake case] using all lower case letters for files and directories. The name of a file should correspond to the primary class that it exports.&lt;br /&gt;
&lt;br /&gt;
The default extension for TypeScript files is ''ts''&lt;br /&gt;
&lt;br /&gt;
The extension used for TypeScript files containing JSX is ''tsx''&lt;br /&gt;
&lt;br /&gt;
All files end with a single new line character.&lt;br /&gt;
&lt;br /&gt;
=Directory Structure=&lt;br /&gt;
&lt;br /&gt;
A project is broken down into a library component, a test component, and one or more application components. These components are referred to as ''artifacts''. The applications go into their own ''applications'' directory and the libraries into the ''library'' directory. Within each artifact is a ''build'' directory containing the build scripts needed to build that artifact. Scripts for POSIX systems are found in the ''posix'' sub-directory and Windows build files are within the ''windows'' sub-directory. The build scripts specified are ''setup'' to download and install any dependencies needed to produce the artifact and the ''build'' script which produces the artifact. Typically the ''setup'' script is run only once or when a new dependency is introduced to the project, and the ''build'' script is run anytime a new build is needed.&lt;br /&gt;
&lt;br /&gt;
Finally there is a top-level ''build'' directory for the project as a whole which produces all artifacts by recursively calling each artifact's individual build scripts. Additionally the top-level build directory also includes a ''setup'' script which downloads all third party dependencies. Some projects may also opt to include an ''install'' script which sets up a suitable development environment, and other scripts for continuous builds, deployment and testing.&lt;br /&gt;
&lt;br /&gt;
Assuming a project named sudoku the following directory structure should be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudoku                             # Root level directory.&lt;br /&gt;
  build.sh                         # Script used to build all projects on POSIX.&lt;br /&gt;
  build.bat                        # Script used to build all projects on Windows.&lt;br /&gt;
  configure.sh                     # Script used to configure all projects on POSIX.&lt;br /&gt;
  configure.bat                    # Script used to configure all projects on Windows.&lt;br /&gt;
  setup.sh                         # Script used to install all dependencies on POSIX.&lt;br /&gt;
  setup.bat                        # Script used to install all dependencies on Windows.&lt;br /&gt;
  \application                     # Contains source specific for the sudoku web app.&lt;br /&gt;
    build.sh                       # Script used to build the web app on POSIX.&lt;br /&gt;
    build.bat                      # Script used to build the web app on Windows.&lt;br /&gt;
    configure.sh                   # Script used to configure the web app on POSIX.&lt;br /&gt;
    configure.bat                  # Script used to configure the web app on Windows.&lt;br /&gt;
    package.json                   # The Node JS package description.&lt;br /&gt;
    tsconfig.json                  # The TypeScript compiler configuration.&lt;br /&gt;
    setup.sh                       # Script used the web app dependencies on POSIX.&lt;br /&gt;
    setup.bat                      # Script used the web app dependencies on Windows.&lt;br /&gt;
    webpack.config.js              # The Webpack configuration.&lt;br /&gt;
    \source                        # Contains the web application source files.&lt;br /&gt;
      \index.html                  # The HTML file that loads the JavaScript application.&lt;br /&gt;
      \index.tsx                   # The TypeScript/JSX file containing the application.&lt;br /&gt;
  \library                         # Contains the common library code.&lt;br /&gt;
    build.sh                       # Script used to build the library on POSIX.&lt;br /&gt;
    build.bat                      # Script used to build the library on Windows.&lt;br /&gt;
    configure.sh                   # Script used to configure the library on POSIX.&lt;br /&gt;
    configure.bat                  # Script used to configure the library on Windows.&lt;br /&gt;
    package.json                   # The Node JS package description.&lt;br /&gt;
    setup.sh                       # Script used the library on POSIX.&lt;br /&gt;
    setup.bat                      # Script used the library on Windows.&lt;br /&gt;
    tsconfig.json                  # The TypeScript compiler configuration.&lt;br /&gt;
    \source                        # Contains the library source files.&lt;br /&gt;
      index.ts                     # Exports all definitions contained in this directory.&lt;br /&gt;
      \pages                       # Contains the source code for individual web pages.&lt;br /&gt;
        index.ts                   # Exports all definitions for every web page defined&lt;br /&gt;
                                   # in this directory.&lt;br /&gt;
        \landing_page              # Contains the source code for the landing page.&lt;br /&gt;
          index.ts                 # Exports the landing page.&lt;br /&gt;
          landing_page.tsx         # The TypeScript/JSX source code for the landing page.&lt;br /&gt;
        \page_2                    # Contains the source for for another web page.&lt;br /&gt;
          ...                      # Structured in a similar manner as the landing page.&lt;br /&gt;
  \resources                       # Contains images, fonts, CSS files and all other web&lt;br /&gt;
                                   # assets.&lt;br /&gt;
    \index.css                     # Contains the main CSS file, typically this is the&lt;br /&gt;
                                   # only CSS file used.&lt;br /&gt;
    \fonts                         # A directory of fonts used.&lt;br /&gt;
  \tests                           # This directory contains tests for every page of the&lt;br /&gt;
                                   # web app.&lt;br /&gt;
    build.sh                       # Script used to build all tests on POSIX.&lt;br /&gt;
    build.bat                      # Script used to build all tests on Windows.&lt;br /&gt;
    configure.sh                   # Script used to configure all tests on POSIX.&lt;br /&gt;
    configure.bat                  # Script used to configure all tests on Windows.&lt;br /&gt;
    setup.sh                       # Script used to install all test dependencies on POSIX.&lt;br /&gt;
    setup.bat                      # Script used to install all test dependencies on&lt;br /&gt;
                                   # Windows.&lt;br /&gt;
    \scratch                       # Directory containing a test/demo for a single page.&lt;br /&gt;
      build.sh                     # Script used to build the test on POSIX.&lt;br /&gt;
      build.bat                    # Script used to build the test on Windows.&lt;br /&gt;
      configure.sh                 # Script used to configure the test on POSIX.&lt;br /&gt;
      configure.bat                # Script used to configure the test on Windows.&lt;br /&gt;
      package.json                 # The Node JS package description.&lt;br /&gt;
      tsconfig.json                # The TypeScript compiler configuration.&lt;br /&gt;
      setup.sh                     # Script used the test dependencies on POSIX.&lt;br /&gt;
      setup.bat                    # Script used the test dependencies on Windows.&lt;br /&gt;
      webpack.config.js            # The Webpack configuration.&lt;br /&gt;
      \source                      # Contains the test source files.&lt;br /&gt;
        \index.html                # The HTML file that loads the JavaScript application.&lt;br /&gt;
        \index.tsx                 # The TypeScript/JSX file containing the application.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the above directory structure containing a basic skeletal implementation of all files can be found here: https://github.com/spiretrading/sudoku&lt;br /&gt;
&lt;br /&gt;
=Component Names=&lt;br /&gt;
&lt;br /&gt;
Naming components can be difficult. Names are usually prefixed with the context or domain. Most components will fall under one of the following categories.&lt;br /&gt;
&lt;br /&gt;
==Field==&lt;br /&gt;
The primary function of a field is to display data. The data can be edited. It can have a readonly property. It contains a onChange callback.&lt;br /&gt;
&lt;br /&gt;
Examples: DurationField, NumberField&lt;br /&gt;
&lt;br /&gt;
===Selection Field===&lt;br /&gt;
A specialized field. It requires a list of potential values to choose from.&lt;br /&gt;
&lt;br /&gt;
Example: CountrySelectionField&lt;br /&gt;
&lt;br /&gt;
==Input==&lt;br /&gt;
The primary function of a input is to get user input. Inputs usually do not have a initial value unlike fields. Inputs can have a readonly mode, but it is only to be used when the input should not accept input.&lt;br /&gt;
&lt;br /&gt;
Example: SecurityInput&lt;br /&gt;
&lt;br /&gt;
===Button===&lt;br /&gt;
Buttons are a specialized form of input. Only has a onClick callback.&lt;br /&gt;
&lt;br /&gt;
Examples: Button, BurgerButton&lt;br /&gt;
&lt;br /&gt;
==Box==&lt;br /&gt;
A component that displays data that cannot be directly edited.&lt;br /&gt;
&lt;br /&gt;
=Syntax=&lt;br /&gt;
&lt;br /&gt;
==Indentation==&lt;br /&gt;
Code is indented using 2 spaces per level, tabs are not permitted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
function factorial(n: number): number {&lt;br /&gt;
  if(n == 0) {&lt;br /&gt;
    return 1;&lt;br /&gt;
  }&lt;br /&gt;
  return n * factorial(n - 1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Line Structure==&lt;br /&gt;
&lt;br /&gt;
Statements must end with a semi-colon ';' or a closing brace '}', even in cases where TypeScript allows them to be optional.&lt;br /&gt;
&lt;br /&gt;
Lines are limited to 80 characters. Exceptions to this rule are long imports and long string literals where breaking up the literal into multiple lines is not possible. In order to break up long statements into multiple lines the following rules are used:&lt;br /&gt;
&lt;br /&gt;
* Break the line at a comma, operator or opening bracket.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Correct, line break at comma.&lt;br /&gt;
f(a, ..., b,&lt;br /&gt;
  c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after expression.&lt;br /&gt;
f(a, ..., b&lt;br /&gt;
  , c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Correct, line break after operator.&lt;br /&gt;
a + ... + b +&lt;br /&gt;
  c + ... + d;&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after expression.&lt;br /&gt;
a + ... + b&lt;br /&gt;
  + c + ... + d;&lt;br /&gt;
&lt;br /&gt;
// Correct, line break after opening bracket.&lt;br /&gt;
f(&lt;br /&gt;
  a, ..., b, c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after function name.&lt;br /&gt;
f&lt;br /&gt;
  (a, ..., b, c, ..., d);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For statements that begin new blocks of code (such as if/while/class...), in order to avoid confusing the line continuation with the code block, the line continuation is indented two extra levels. For example consider the following snippet of code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Incorrect.&lt;br /&gt;
if(condition_a &amp;amp;&amp;amp; condition_b &amp;amp;&amp;amp; ... &amp;amp;&amp;amp;&lt;br /&gt;
  condition_c) {&lt;br /&gt;
  console.log('meow');&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line continuation on line 2 clashes with the code block on line 3. To avoid this clash the above code is indented as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
if(condition_a &amp;amp;&amp;amp; condition_b &amp;amp;&amp;amp; ... &amp;amp;&amp;amp;&lt;br /&gt;
    condition_c) {&lt;br /&gt;
  console.log('meow');&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The extra level of indentation in the line continuation makes it clear where the condition ends and the code block begins.&lt;br /&gt;
&lt;br /&gt;
==Braces==&lt;br /&gt;
&lt;br /&gt;
Braces are placed using a variant of the [http://wiki.c2.com/?OneTrueBraceStyle OTBS style]. The opening brace is placed on the same line as the declaring statement with one single space preceding it, and the closing brace is placed on a line of its own at the same level of indentation as the declaring statement. For if statements, the else/else if is placed on the same line as the closing brace. For do/while loops, the while is placed on the same line as the closing brace.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
if(&amp;lt;cond&amp;gt;) {&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
} else {&lt;br /&gt;
  &amp;lt;default&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Correct.&lt;br /&gt;
do {&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
} while(&amp;lt;cond&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
// Incorrect.&lt;br /&gt;
if(&amp;lt;cond&amp;gt;)&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;default&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Incorrect.&lt;br /&gt;
do&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
while(&amp;lt;cond&amp;gt;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Spacing==&lt;br /&gt;
&lt;br /&gt;
The following are correct use cases for white spaces:&lt;br /&gt;
&lt;br /&gt;
* Used for indentation.&lt;br /&gt;
* Used to surround binary operations.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
const x = a + b;&lt;br /&gt;
const y = 5;&lt;br /&gt;
&lt;br /&gt;
//! Incorrect&lt;br /&gt;
const x = a+b;&lt;br /&gt;
const y=5;&lt;br /&gt;
const z= 5;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* One space is placed after a comma.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
f(1, 2);&lt;br /&gt;
function g(a: number, b: number): number;&lt;br /&gt;
&lt;br /&gt;
//! Incorrect&lt;br /&gt;
f(1,2);&lt;br /&gt;
function g(a:number,b:number);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Naming==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Camel_case Camel case] is used for naming whereas variables and functions use mixedCase and namespaces, modules, and types use CapWords. Names should be descriptive but should avoid being verbose.&lt;br /&gt;
&lt;br /&gt;
Classes and variables should be given the name of a noun and functions the name of a verb. Functions that return a boolean or boolean variables should be named in the form of a question starting with isX or hasX.&lt;br /&gt;
&lt;br /&gt;
==Imports==&lt;br /&gt;
Imports are listed in order of most global to local. Where dependencies have the same locality, then they are ordered alphabetically. For example, the first group of dependencies to be imported are third party packages which are listed in alphabetical order based on the package name. In the above snippet the third party dependencies are jquery, react and react-router-dom which are imported in alphabetical order. Then local dependencies are imported where directories further up the hierarchy are imported first. That is, the directory '../../..' which is three levels up is imported before the directory '..' which is only one level up.&lt;br /&gt;
&lt;br /&gt;
When multiple names are imported from a package, they must be listed in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
import * as $ from 'jquery';&lt;br /&gt;
import * as React from 'react';&lt;br /&gt;
import * as Router from 'react-router-dom';&lt;br /&gt;
import {HBoxLayout, Padding, VBoxLayout} from '../../..';&lt;br /&gt;
import {Model} from '..';&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
&lt;br /&gt;
Any declaration (such as a function or class) that is intended to be imported by another file must be documented using [http://usejsdoc.org/ JSDoc style]. If the definition is local then that documentation should be omitted entirely.&lt;br /&gt;
&lt;br /&gt;
Any documentation should be preceded by a blank line. In the code snippet, Properties is part of the public API so it is documented along with all of its fields, but the State is internal to the file so no aspect of it is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/** Stores the React properties used to render a Page. */&lt;br /&gt;
export interface Properties {&lt;br /&gt;
&lt;br /&gt;
  /** The model used to display the page. */&lt;br /&gt;
  model: Model;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
export interface State {&lt;br /&gt;
  redirect: string;&lt;br /&gt;
  isLoading: boolean;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Variable Declarations==&lt;br /&gt;
&lt;br /&gt;
Variables are declared so that only one variable is declared per line, prefer declaring variables using ''const'' when possible, and deferring to ''let'' otherwise, variables should always be initialized at the point of their declaration.&lt;br /&gt;
&lt;br /&gt;
For complex initialization of values, use an [https://en.wikipedia.org/wiki/Immediately-invoked_function_expression immediately invoked lambda expression] as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
const value = (() =&amp;gt; {&lt;br /&gt;
  if(condition) {&lt;br /&gt;
    return 123;&lt;br /&gt;
  }&lt;br /&gt;
  return 321;&lt;br /&gt;
})();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&lt;br /&gt;
Below is a full example combining numerous elements of the style guide to define a typical React component. It should be used as a general reference for how code is laid out, structured, and properly spaced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
import * as $ from 'jquery';&lt;br /&gt;
import * as React from 'react';&lt;br /&gt;
import * as Router from 'react-router-dom';&lt;br /&gt;
import {HBoxLayout, Padding, VBoxLayout} from '..';&lt;br /&gt;
import {Model} from '.';&lt;br /&gt;
&lt;br /&gt;
/** Stores the React properties used to render a Page. */&lt;br /&gt;
export interface Properties {&lt;br /&gt;
&lt;br /&gt;
  /** The model used to display the page. */&lt;br /&gt;
  model: Model;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
export interface State {&lt;br /&gt;
  redirect: string;&lt;br /&gt;
  isLoading: boolean;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Displays an HTML page. */&lt;br /&gt;
export class Page extends React.Component&amp;lt;Properties, State&amp;gt; {&lt;br /&gt;
  constructor(props: Properties) {&lt;br /&gt;
    super(props);&lt;br /&gt;
    this.state = {&lt;br /&gt;
      redirect: '',&lt;br /&gt;
      isLoading: true&lt;br /&gt;
    };&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public componentWillMount(): void {&lt;br /&gt;
    this.props.model.load().then(&lt;br /&gt;
      () =&amp;gt; {&lt;br /&gt;
        this.setState({&lt;br /&gt;
          isLoading: false&lt;br /&gt;
        });&lt;br /&gt;
      });&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public render(): JSX.Element {&lt;br /&gt;
    if(this.state.redirect) {&lt;br /&gt;
      return &amp;lt;Router.Redirect push to={this.state.redirect}/&amp;gt;;&lt;br /&gt;
    } else if(this.state.isLoading) {&lt;br /&gt;
      return &amp;lt;LoadingPage/&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    const style = {&lt;br /&gt;
      backgroundColor: '#FFFFFF',&lt;br /&gt;
      font: 'Roboto 14px'&lt;br /&gt;
    };&lt;br /&gt;
    return (&lt;br /&gt;
      &amp;lt;div style={style}&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;Hello world!&amp;lt;/h1&amp;gt;&lt;br /&gt;
        &amp;lt;img src='cat.jpg'/&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Additional References=&lt;br /&gt;
&lt;br /&gt;
The bulk of this style guide focuses on syntax rather than good programming practices. The following list are reference materials for best practices on writing portable, efficient, and clean TypeScript:&lt;br /&gt;
&lt;br /&gt;
* [https://www.typescriptlang.org/docs/handbook/basic-types.html TypeScript Hand Book]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=TypeScript_Style_Guide&amp;diff=101</id>
		<title>TypeScript Style Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=TypeScript_Style_Guide&amp;diff=101"/>
		<updated>2020-03-20T18:59:59Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article specifies the most general guidelines used for all Spire projects written using TypeScript as the primary programming language. Each individual project may extend or override the guidelines specified herein. The overall aim of this guideline is to provide consistency across the numerous projects developed by Spire in order to promote and benefit from modern web development practices as well as tailor them to our specific requirements.&lt;br /&gt;
&lt;br /&gt;
In general, the guidelines are very specific and opinionated. This is done intentionally to ensure that every detail has been given proper consideration and that every line of code is written with care and diligence. It is taken as a prerequisite that writing robust, clean and maintainable code requires paying close attention to even the smallest of details. As such, when there are two or more ways to write or express any given statement or expression, be it using spaces or tabs, number of characters per line, purple or violet, the guideline will often require that one particular approach be used to the exclusion of others.&lt;br /&gt;
&lt;br /&gt;
Finally, this document is constantly evolving and as such older projects may not be up-to-date with the guidelines found here. In those circumstances one must use their best judgment about how to integrate these guidelines into older codebases. As a general principle, consistency should favor the local over the global, that is it is more important to be consistent with a function definition than within a file, and more important to be consistent within a file than within a directory, project, etc...&lt;br /&gt;
&lt;br /&gt;
=Development Environment=&lt;br /&gt;
&lt;br /&gt;
The primary operating systems supported by Spire projects are Ubuntu 18.02 LTS, Windows 10, and macOS. On all systems, nodejs is used as the build system and webpack is used as the bundler.&lt;br /&gt;
&lt;br /&gt;
For source control, git is used and projects are to be hosted on [https://github.com/spiretrading Spire Trading's Github page].&lt;br /&gt;
&lt;br /&gt;
Each developer is welcome to use an editor of their choice, however [https://code.visualstudio.com/ Visual Studio Code] is recommended.&lt;br /&gt;
&lt;br /&gt;
=File Names=&lt;br /&gt;
&lt;br /&gt;
Use [https://en.wikipedia.org/wiki/Snake_case snake case] using all lower case letters for files and directories. The name of a file should correspond to the primary class that it exports.&lt;br /&gt;
&lt;br /&gt;
The default extension for TypeScript files is ''ts''&lt;br /&gt;
&lt;br /&gt;
The extension used for TypeScript files containing JSX is ''tsx''&lt;br /&gt;
&lt;br /&gt;
All files end with a single new line character.&lt;br /&gt;
&lt;br /&gt;
=Directory Structure=&lt;br /&gt;
&lt;br /&gt;
A project is broken down into a library component, a test component, and one or more application components. These components are referred to as ''artifacts''. The applications go into their own ''applications'' directory and the libraries into the ''library'' directory. Within each artifact is a ''build'' directory containing the build scripts needed to build that artifact. Scripts for POSIX systems are found in the ''posix'' sub-directory and Windows build files are within the ''windows'' sub-directory. The build scripts specified are ''setup'' to download and install any dependencies needed to produce the artifact and the ''build'' script which produces the artifact. Typically the ''setup'' script is run only once or when a new dependency is introduced to the project, and the ''build'' script is run anytime a new build is needed.&lt;br /&gt;
&lt;br /&gt;
Finally there is a top-level ''build'' directory for the project as a whole which produces all artifacts by recursively calling each artifact's individual build scripts. Additionally the top-level build directory also includes a ''setup'' script which downloads all third party dependencies. Some projects may also opt to include an ''install'' script which sets up a suitable development environment, and other scripts for continuous builds, deployment and testing.&lt;br /&gt;
&lt;br /&gt;
Assuming a project named sudoku the following directory structure should be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sudoku                             # Root level directory.&lt;br /&gt;
  build.sh                         # Script used to build all projects on POSIX.&lt;br /&gt;
  build.bat                        # Script used to build all projects on Windows.&lt;br /&gt;
  \applications                    # Contains all applications.&lt;br /&gt;
    \sudoku                        # Contains the source for the sudoku web application.&lt;br /&gt;
      package.json                 # The Node JS package description.&lt;br /&gt;
      tsconfig.json                # The TypeScript compiler configuration.&lt;br /&gt;
      webpack.config.js            # The Webpack configuration.&lt;br /&gt;
      build.sh                     # Script used to build application on POSIX.&lt;br /&gt;
      build.bat                    # Script used to build application Windows.&lt;br /&gt;
      \source                      # Contains the web application source files.&lt;br /&gt;
        \index.html                # The HTML file that loads the JavaScript application.&lt;br /&gt;
        \index.tsx                 # The TypeScript/JSX file containing the application.&lt;br /&gt;
  \library                         # Contains the common library code.&lt;br /&gt;
    package.json                   # The Node JS package description.&lt;br /&gt;
    tsconfig.json                  # The TypeScript compiler configuration.&lt;br /&gt;
    webpack.config.js              # The Webpack configuration.&lt;br /&gt;
    build.sh                       # Script used to build library on POSIX.&lt;br /&gt;
    build.bat                      # Script used to build library on Windows.&lt;br /&gt;
    \source                        # Contains the library source files.&lt;br /&gt;
      index.ts                     # Exports all definitions contained in this directory.&lt;br /&gt;
      \pages                       # Contains the source code for individual web pages.&lt;br /&gt;
        index.ts                   # Exports all definitions for every web page defined&lt;br /&gt;
                                   # in this directory.&lt;br /&gt;
        \landing_page              # Contains the source code for the landing page.&lt;br /&gt;
          index.ts                 # Exports the landing page.&lt;br /&gt;
          landing_page.tsx         # The TypeScript/JSX source code for the landing page.&lt;br /&gt;
        \page_2                    # Contains the source for for another web page.&lt;br /&gt;
          ...                      # Structured in a similar manner as the landing page.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An example of the above directory structure containing a basic skeletal implementation of all files can be found here: https://github.com/spiretrading/sudoku&lt;br /&gt;
&lt;br /&gt;
=Component Names=&lt;br /&gt;
&lt;br /&gt;
Naming components can be difficult. Names are usually prefixed with the context or domain. Most components will fall under one of the following categories.&lt;br /&gt;
&lt;br /&gt;
==Field==&lt;br /&gt;
The primary function of a field is to display data. The data can be edited. It can have a readonly property. It contains a onChange callback.&lt;br /&gt;
&lt;br /&gt;
Examples: DurationField, NumberField&lt;br /&gt;
&lt;br /&gt;
===Selection Field===&lt;br /&gt;
A specialized field. It requires a list of potential values to choose from.&lt;br /&gt;
&lt;br /&gt;
Example: CountrySelectionField&lt;br /&gt;
&lt;br /&gt;
==Input==&lt;br /&gt;
The primary function of a input is to get user input. Inputs usually do not have a initial value unlike fields. Inputs can have a readonly mode, but it is only to be used when the input should not accept input.&lt;br /&gt;
&lt;br /&gt;
Example: SecurityInput&lt;br /&gt;
&lt;br /&gt;
===Button===&lt;br /&gt;
Buttons are a specialized form of input. Only has a onClick callback.&lt;br /&gt;
&lt;br /&gt;
Examples: Button, BurgerButton&lt;br /&gt;
&lt;br /&gt;
==Box==&lt;br /&gt;
A component that displays data that cannot be directly edited.&lt;br /&gt;
&lt;br /&gt;
=Syntax=&lt;br /&gt;
&lt;br /&gt;
==Indentation==&lt;br /&gt;
Code is indented using 2 spaces per level, tabs are not permitted.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
function factorial(n: number): number {&lt;br /&gt;
  if(n == 0) {&lt;br /&gt;
    return 1;&lt;br /&gt;
  }&lt;br /&gt;
  return n * factorial(n - 1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Line Structure==&lt;br /&gt;
&lt;br /&gt;
Statements must end with a semi-colon ';' or a closing brace '}', even in cases where TypeScript allows them to be optional.&lt;br /&gt;
&lt;br /&gt;
Lines are limited to 80 characters. Exceptions to this rule are long imports and long string literals where breaking up the literal into multiple lines is not possible. In order to break up long statements into multiple lines the following rules are used:&lt;br /&gt;
&lt;br /&gt;
* Break the line at a comma, operator or opening bracket.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
// Correct, line break at comma.&lt;br /&gt;
f(a, ..., b,&lt;br /&gt;
  c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after expression.&lt;br /&gt;
f(a, ..., b&lt;br /&gt;
  , c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Correct, line break after operator.&lt;br /&gt;
a + ... + b +&lt;br /&gt;
  c + ... + d;&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after expression.&lt;br /&gt;
a + ... + b&lt;br /&gt;
  + c + ... + d;&lt;br /&gt;
&lt;br /&gt;
// Correct, line break after opening bracket.&lt;br /&gt;
f(&lt;br /&gt;
  a, ..., b, c, ..., d);&lt;br /&gt;
&lt;br /&gt;
// Incorrect, line break after function name.&lt;br /&gt;
f&lt;br /&gt;
  (a, ..., b, c, ..., d);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* For statements that begin new blocks of code (such as if/while/class...), in order to avoid confusing the line continuation with the code block, the line continuation is indented two extra levels. For example consider the following snippet of code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Incorrect.&lt;br /&gt;
if(condition_a &amp;amp;&amp;amp; condition_b &amp;amp;&amp;amp; ... &amp;amp;&amp;amp;&lt;br /&gt;
  condition_c) {&lt;br /&gt;
  console.log('meow');&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The line continuation on line 2 clashes with the code block on line 3. To avoid this clash the above code is indented as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
if(condition_a &amp;amp;&amp;amp; condition_b &amp;amp;&amp;amp; ... &amp;amp;&amp;amp;&lt;br /&gt;
    condition_c) {&lt;br /&gt;
  console.log('meow');&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The extra level of indentation in the line continuation makes it clear where the condition ends and the code block begins.&lt;br /&gt;
&lt;br /&gt;
==Braces==&lt;br /&gt;
&lt;br /&gt;
Braces are placed using a variant of the [http://wiki.c2.com/?OneTrueBraceStyle OTBS style]. The opening brace is placed on the same line as the declaring statement with one single space preceding it, and the closing brace is placed on a line of its own at the same level of indentation as the declaring statement. For if statements, the else/else if is placed on the same line as the closing brace. For do/while loops, the while is placed on the same line as the closing brace.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
if(&amp;lt;cond&amp;gt;) {&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
} else {&lt;br /&gt;
  &amp;lt;default&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Correct.&lt;br /&gt;
do {&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
} while(&amp;lt;cond&amp;gt;);&lt;br /&gt;
&lt;br /&gt;
// Incorrect.&lt;br /&gt;
if(&amp;lt;cond&amp;gt;)&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;default&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Incorrect.&lt;br /&gt;
do&lt;br /&gt;
{&lt;br /&gt;
  &amp;lt;body&amp;gt;&lt;br /&gt;
}&lt;br /&gt;
while(&amp;lt;cond&amp;gt;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Spacing==&lt;br /&gt;
&lt;br /&gt;
The following are correct use cases for white spaces:&lt;br /&gt;
&lt;br /&gt;
* Used for indentation.&lt;br /&gt;
* Used to surround binary operations.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
const x = a + b;&lt;br /&gt;
const y = 5;&lt;br /&gt;
&lt;br /&gt;
//! Incorrect&lt;br /&gt;
const x = a+b;&lt;br /&gt;
const y=5;&lt;br /&gt;
const z= 5;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* One space is placed after a comma.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
// Correct.&lt;br /&gt;
f(1, 2);&lt;br /&gt;
function g(a: number, b: number): number;&lt;br /&gt;
&lt;br /&gt;
//! Incorrect&lt;br /&gt;
f(1,2);&lt;br /&gt;
function g(a:number,b:number);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Naming==&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Camel_case Camel case] is used for naming whereas variables and functions use mixedCase and namespaces, modules, and types use CapWords. Names should be descriptive but should avoid being verbose.&lt;br /&gt;
&lt;br /&gt;
Classes and variables should be given the name of a noun and functions the name of a verb. Functions that return a boolean or boolean variables should be named in the form of a question starting with isX or hasX.&lt;br /&gt;
&lt;br /&gt;
==Imports==&lt;br /&gt;
Imports are listed in order of most global to local. Where dependencies have the same locality, then they are ordered alphabetically. For example, the first group of dependencies to be imported are third party packages which are listed in alphabetical order based on the package name. In the above snippet the third party dependencies are jquery, react and react-router-dom which are imported in alphabetical order. Then local dependencies are imported where directories further up the hierarchy are imported first. That is, the directory '../../..' which is three levels up is imported before the directory '..' which is only one level up.&lt;br /&gt;
&lt;br /&gt;
When multiple names are imported from a package, they must be listed in alphabetical order.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
import * as $ from 'jquery';&lt;br /&gt;
import * as React from 'react';&lt;br /&gt;
import * as Router from 'react-router-dom';&lt;br /&gt;
import {HBoxLayout, Padding, VBoxLayout} from '../../..';&lt;br /&gt;
import {Model} from '..';&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Declarations==&lt;br /&gt;
&lt;br /&gt;
Any declaration (such as a function or class) that is intended to be imported by another file must be documented using [http://usejsdoc.org/ JSDoc style]. If the definition is local then that documentation should be omitted entirely.&lt;br /&gt;
&lt;br /&gt;
Any documentation should be preceded by a blank line. In the code snippet, Properties is part of the public API so it is documented along with all of its fields, but the State is internal to the file so no aspect of it is documented.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/** Stores the React properties used to render a Page. */&lt;br /&gt;
export interface Properties {&lt;br /&gt;
&lt;br /&gt;
  /** The model used to display the page. */&lt;br /&gt;
  model: Model;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
export interface State {&lt;br /&gt;
  redirect: string;&lt;br /&gt;
  isLoading: boolean;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Variable Declarations==&lt;br /&gt;
&lt;br /&gt;
Variables are declared so that only one variable is declared per line, prefer declaring variables using ''const'' when possible, and deferring to ''let'' otherwise, variables should always be initialized at the point of their declaration.&lt;br /&gt;
&lt;br /&gt;
For complex initialization of values, use an [https://en.wikipedia.org/wiki/Immediately-invoked_function_expression immediately invoked lambda expression] as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
const value = (() =&amp;gt; {&lt;br /&gt;
  if(condition) {&lt;br /&gt;
    return 123;&lt;br /&gt;
  }&lt;br /&gt;
  return 321;&lt;br /&gt;
})();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Example=&lt;br /&gt;
&lt;br /&gt;
Below is a full example combining numerous elements of the style guide to define a typical React component. It should be used as a general reference for how code is laid out, structured, and properly spaced.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=typescript line=line&amp;gt;&lt;br /&gt;
import * as $ from 'jquery';&lt;br /&gt;
import * as React from 'react';&lt;br /&gt;
import * as Router from 'react-router-dom';&lt;br /&gt;
import {HBoxLayout, Padding, VBoxLayout} from '..';&lt;br /&gt;
import {Model} from '.';&lt;br /&gt;
&lt;br /&gt;
/** Stores the React properties used to render a Page. */&lt;br /&gt;
export interface Properties {&lt;br /&gt;
&lt;br /&gt;
  /** The model used to display the page. */&lt;br /&gt;
  model: Model;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
export interface State {&lt;br /&gt;
  redirect: string;&lt;br /&gt;
  isLoading: boolean;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/** Displays an HTML page. */&lt;br /&gt;
export class Page extends React.Component&amp;lt;Properties, State&amp;gt; {&lt;br /&gt;
  constructor(props: Properties) {&lt;br /&gt;
    super(props);&lt;br /&gt;
    this.state = {&lt;br /&gt;
      redirect: '',&lt;br /&gt;
      isLoading: true&lt;br /&gt;
    };&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public componentWillMount(): void {&lt;br /&gt;
    this.props.model.load().then(&lt;br /&gt;
      () =&amp;gt; {&lt;br /&gt;
        this.setState({&lt;br /&gt;
          isLoading: false&lt;br /&gt;
        });&lt;br /&gt;
      });&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  public render(): JSX.Element {&lt;br /&gt;
    if(this.state.redirect) {&lt;br /&gt;
      return &amp;lt;Router.Redirect push to={this.state.redirect}/&amp;gt;;&lt;br /&gt;
    } else if(this.state.isLoading) {&lt;br /&gt;
      return &amp;lt;LoadingPage/&amp;gt;;&lt;br /&gt;
    }&lt;br /&gt;
    const style = {&lt;br /&gt;
      backgroundColor: '#FFFFFF',&lt;br /&gt;
      font: 'Roboto 14px'&lt;br /&gt;
    };&lt;br /&gt;
    return (&lt;br /&gt;
      &amp;lt;div style={style}&amp;gt;&lt;br /&gt;
        &amp;lt;h1&amp;gt;Hello world!&amp;lt;/h1&amp;gt;&lt;br /&gt;
        &amp;lt;img src='cat.jpg'/&amp;gt;&lt;br /&gt;
      &amp;lt;/div&amp;gt;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Additional References=&lt;br /&gt;
&lt;br /&gt;
The bulk of this style guide focuses on syntax rather than good programming practices. The following list are reference materials for best practices on writing portable, efficient, and clean TypeScript:&lt;br /&gt;
&lt;br /&gt;
* [https://www.typescriptlang.org/docs/handbook/basic-types.html TypeScript Hand Book]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=100</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=100"/>
		<updated>2020-03-19T19:41:53Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File: Spire-logo.png|237x91px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=99</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=99"/>
		<updated>2020-03-19T19:41:04Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File: Spire-logo.png|upright=1.0|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=98</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=98"/>
		<updated>2020-03-19T19:40:09Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File: Spire-logo.png|50x50%|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=97</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=97"/>
		<updated>2020-03-19T19:35:51Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File: Spire-logo.png|395x151px|center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=96</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=96"/>
		<updated>2020-03-19T19:34:18Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File: Spire-logo.png|395x151px|center]]&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=95</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=95"/>
		<updated>2020-03-19T19:33:22Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File: Spire-logo.png|upright=1.0|center]]&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=94</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=94"/>
		<updated>2020-03-19T19:32:06Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File: Spire-logo.png|upright=0.5]]&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=93</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=93"/>
		<updated>2020-03-19T19:30:40Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File: Spire-logo.png]]&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Spire-logo.png&amp;diff=92</id>
		<title>File:Spire-logo.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Spire-logo.png&amp;diff=92"/>
		<updated>2020-03-19T19:30:22Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=91</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=91"/>
		<updated>2020-03-19T15:34:58Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File: Spire-logo.svg]]&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Spire-logo.svg&amp;diff=90</id>
		<title>File:Spire-logo.svg</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Spire-logo.svg&amp;diff=90"/>
		<updated>2020-03-19T15:15:29Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=89</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=89"/>
		<updated>2020-03-19T15:01:16Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Logo.png]]&lt;br /&gt;
&lt;br /&gt;
We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=88</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=88"/>
		<updated>2020-03-19T15:00:40Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=87</id>
		<title>Spire Trading Inc.:About</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Spire_Trading_Inc.:About&amp;diff=87"/>
		<updated>2020-03-19T15:00:24Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading softw...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;We’re a boutique firm developing high-quality trading software in Canada’s financial hub. We pride ourselves on building extremely stable and lightning-quick trading software that can be highly customized for our customers. At Spire, we understand that small teams can do amazing things, and take pride in achieving the kind of work that results in better output and happier employees. If you want to know more about us, take a look at [https://spiretrading.com|our website].&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Common.css&amp;diff=86</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Common.css&amp;diff=86"/>
		<updated>2020-03-19T14:32:14Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@import url('https://fonts.googleapis.com/css?family=Montserrat&amp;amp;display=swap');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** SELECTORS ***/&lt;br /&gt;
&lt;br /&gt;
html, body {&lt;br /&gt;
  font-family: Roboto, sans-serif;&lt;br /&gt;
  line-height: 18pt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
body {&lt;br /&gt;
  background-color: #FFF;&lt;br /&gt;
  background-image: url('http://wiki.spiretrading.com/images/b/bd/Footer.pattern.png');&lt;br /&gt;
  background-repeat: repeat-x;&lt;br /&gt;
  background-position: bottom center;&lt;br /&gt;
  background-size: 20%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
a, #mw-panel .portal .body li a {&lt;br /&gt;
  color: #4B23A0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1, h2, h3, h4, h5, h6 {&lt;br /&gt;
  font-family: 'Montserrat', sans-serif;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#mw-page-base {&lt;br /&gt;
  background-image: none;&lt;br /&gt;
  background-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** IDENTIFIERS ***/&lt;br /&gt;
&lt;br /&gt;
#pt-login-private a {&lt;br /&gt;
  color: #EC228F !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#p-logo {&lt;br /&gt;
    height: 70px !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** CLASSES ***/&lt;br /&gt;
&lt;br /&gt;
/* RESETTING GRADIENTS AND HEADINGD */&lt;br /&gt;
.vectorTabs, .vectorTabs span, #mw-head .vectorMenu h3, .vectorTabs li {&lt;br /&gt;
  background-image: none !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* LOGO */&lt;br /&gt;
.mw-wiki-logo {&lt;br /&gt;
    background-position: left 20px top 20px !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-body h1, .mw-body-content h1, .mw-body-content h2 {&lt;br /&gt;
  font-family: 'Montserrat', sans-serif;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.vectorTabs .selected {&lt;br /&gt;
  border-bottom: 2px solid #4B23A0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-body {&lt;br /&gt;
  border-color: #C8C8C8 !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.toc {&lt;br /&gt;
  background: #F8F9FA;&lt;br /&gt;
  border-color: #F2F2F2;&lt;br /&gt;
  margin: 15px 0;&lt;br /&gt;
  padding: 15px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** SKIN: TWEEKI CUSTOMIZATIONS ***/&lt;br /&gt;
&lt;br /&gt;
.navbar-brand img {&lt;br /&gt;
  margin-top: -5px;&lt;br /&gt;
  width: 136.5px;&lt;br /&gt;
  height: 35px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1, .h1 {&lt;br /&gt;
  font-size: 30px;&lt;br /&gt;
}&lt;br /&gt;
h2, .h2 {&lt;br /&gt;
  font-size: 27px;&lt;br /&gt;
}&lt;br /&gt;
h3, .h3 {&lt;br /&gt;
  font-size: 24px;&lt;br /&gt;
}&lt;br /&gt;
h4, .h4 {&lt;br /&gt;
  font-size: 20px;&lt;br /&gt;
}&lt;br /&gt;
h5, .h5 {&lt;br /&gt;
  font-size: 18px;&lt;br /&gt;
}&lt;br /&gt;
h6, .h6 {&lt;br /&gt;
  font-size: 16px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1, .h1, h2, .h2, h3, .h3 {&lt;br /&gt;
    margin-top: 25px;&lt;br /&gt;
    margin-bottom: 15px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.firstHeading, .tweekiFirstHeading {&lt;br /&gt;
  text-align: left;&lt;br /&gt;
  margin-bottom: 30px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar-default {&lt;br /&gt;
  background-image: none !important;&lt;br /&gt;
  background-color: #FFF !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn, #wpSave {&lt;br /&gt;
  border: 0px !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-default, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger, #wpSave {&lt;br /&gt;
  text-shadow: none !important;&lt;br /&gt;
  -webkit-box-shadow: none !important;&lt;br /&gt;
  box-shadow: none !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-primary, .mw-ui-button.mw-ui-progressive, #wpSave {&lt;br /&gt;
  background-image: none;&lt;br /&gt;
  background-color: #513392;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-primary:hover, .btn-primary:focus, .mw-ui-button.mw-ui-progressive:hover, mw-ui-button.mw-ui-progressive:focus, #wpSave:hover, #wpSave:focus {&lt;br /&gt;
  background-color: #6556A4;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-primary:active, .mw-ui-button.mw-ui-progressive:active, #wpSave:active {&lt;br /&gt;
  background-color: #453A70;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
a:hover, a:focus {&lt;br /&gt;
  color: #6556A4;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar-right {&lt;br /&gt;
  margin-top: 7px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#searchInput {&lt;br /&gt;
  margin-top: 5px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#searchInput:focus {&lt;br /&gt;
  border: 1px solid #4B23A0;&lt;br /&gt;
  background-image: none;&lt;br /&gt;
  outline: 0;&lt;br /&gt;
  -webkit-box-shadow: none;&lt;br /&gt;
  box-shadow: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#footer {&lt;br /&gt;
  background-color: #F8F8F8;&lt;br /&gt;
  padding: 15px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#footer-icons li:last-child::before {&lt;br /&gt;
  content: &amp;quot; • &amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
td.mw-label {&lt;br /&gt;
  padding-right: 10px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media only screen and (min-width: 1000px){&lt;br /&gt;
  #contentwrapper {&lt;br /&gt;
    margin-bottom: 190px !important;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.oo-ui-panelLayout-framed {&lt;br /&gt;
  border: 0 none #FFF;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=85</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=85"/>
		<updated>2020-03-12T21:20:48Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, Special:ALLPAGES |All Articles&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=84</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=84"/>
		<updated>2020-03-12T21:20:14Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, [[Special:ALLPAGES |All Articles]]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=83</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=83"/>
		<updated>2020-03-12T21:20:02Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, [[Special:ALL PAGES |All Articles]]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=82</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=82"/>
		<updated>2020-03-12T21:18:04Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, [[Special:ALLPAGES |All Articles]]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=81</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=81"/>
		<updated>2020-03-12T21:17:21Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, [[Special:ALLPAGES &amp;quot;All Articles&amp;quot;]]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=80</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=80"/>
		<updated>2020-03-12T21:17:01Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, [[Special:ALLPAGES]]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=79</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=79"/>
		<updated>2020-03-12T21:16:44Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, [[ALLPAGES]]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=78</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=78"/>
		<updated>2020-03-12T21:16:26Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, [[ALL PAGES]]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=77</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=77"/>
		<updated>2020-03-12T21:13:46Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, ALL PAGES&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=76</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=76"/>
		<updated>2020-03-12T21:13:31Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN|ALL PAGES&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=75</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=75"/>
		<updated>2020-03-12T21:11:04Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN, ALL PAGES&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=74</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=74"/>
		<updated>2020-03-12T21:06:06Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN - All Pages&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=73</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=73"/>
		<updated>2020-03-12T21:05:05Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN - [http://wiki.spiretrading.com/index.php?title=Special:AllPages ALL PAGES]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=72</id>
		<title>MediaWiki:Tweeki-footer-custom</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-footer-custom&amp;diff=72"/>
		<updated>2020-03-12T19:57:04Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;LOGIN-[http://wiki.spiretrading.com/index.php?title=Special:AllPages ALL PAGES]&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LOGIN-[http://wiki.spiretrading.com/index.php?title=Special:AllPages ALL PAGES]&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Common.css&amp;diff=71</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Common.css&amp;diff=71"/>
		<updated>2020-03-10T20:07:21Z</updated>

		<summary type="html">&lt;p&gt;Kamal: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
@import url('https://fonts.googleapis.com/css?family=Montserrat&amp;amp;display=swap');&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** SELECTORS ***/&lt;br /&gt;
&lt;br /&gt;
html, body {&lt;br /&gt;
  font-family: Roboto, sans-serif;&lt;br /&gt;
  line-height: 18pt;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
body {&lt;br /&gt;
  background-color: #FFF;&lt;br /&gt;
  background-image: url('http://wiki.spiretrading.com/images/b/bd/Footer.pattern.png');&lt;br /&gt;
  background-repeat: repeat-x;&lt;br /&gt;
  background-position: bottom center;&lt;br /&gt;
  background-size: 20%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
a, #mw-panel .portal .body li a {&lt;br /&gt;
  color: #4B23A0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1, h2, h3, h4, h5, h6 {&lt;br /&gt;
  font-family: 'Montserrat', sans-serif;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#mw-page-base {&lt;br /&gt;
  background-image: none;&lt;br /&gt;
  background-color: #FFF;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** IDENTIFIERS ***/&lt;br /&gt;
&lt;br /&gt;
#pt-login-private a {&lt;br /&gt;
  color: #EC228F !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#p-logo {&lt;br /&gt;
    height: 70px !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** CLASSES ***/&lt;br /&gt;
&lt;br /&gt;
/* RESETTING GRADIENTS AND HEADINGD */&lt;br /&gt;
.vectorTabs, .vectorTabs span, #mw-head .vectorMenu h3, .vectorTabs li {&lt;br /&gt;
  background-image: none !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* LOGO */&lt;br /&gt;
.mw-wiki-logo {&lt;br /&gt;
    background-position: left 20px top 20px !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-body h1, .mw-body-content h1, .mw-body-content h2 {&lt;br /&gt;
  font-family: 'Montserrat', sans-serif;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
.vectorTabs .selected {&lt;br /&gt;
  border-bottom: 2px solid #4B23A0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mw-body {&lt;br /&gt;
  border-color: #C8C8C8 !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.toc {&lt;br /&gt;
  background: #F8F9FA;&lt;br /&gt;
  border-color: #F2F2F2;&lt;br /&gt;
  margin: 15px 0;&lt;br /&gt;
  padding: 15px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/*** SKIN: TWEEKI CUSTOMIZATIONS ***/&lt;br /&gt;
&lt;br /&gt;
.navbar-brand img {&lt;br /&gt;
  margin-top: -5px;&lt;br /&gt;
  width: 136.5px;&lt;br /&gt;
  height: 35px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1, .h1 {&lt;br /&gt;
  font-size: 30px;&lt;br /&gt;
}&lt;br /&gt;
h2, .h2 {&lt;br /&gt;
  font-size: 27px;&lt;br /&gt;
}&lt;br /&gt;
h3, .h3 {&lt;br /&gt;
  font-size: 24px;&lt;br /&gt;
}&lt;br /&gt;
h4, .h4 {&lt;br /&gt;
  font-size: 20px;&lt;br /&gt;
}&lt;br /&gt;
h5, .h5 {&lt;br /&gt;
  font-size: 18px;&lt;br /&gt;
}&lt;br /&gt;
h6, .h6 {&lt;br /&gt;
  font-size: 16px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
h1, .h1, h2, .h2, h3, .h3 {&lt;br /&gt;
    margin-top: 25px;&lt;br /&gt;
    margin-bottom: 15px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.firstHeading, .tweekiFirstHeading {&lt;br /&gt;
  text-align: left;&lt;br /&gt;
  margin-bottom: 30px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar-default {&lt;br /&gt;
  background-image: none !important;&lt;br /&gt;
  background-color: #FFF !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn, #wpSave {&lt;br /&gt;
  border: 0px !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-default, .btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger, #wpSave {&lt;br /&gt;
  text-shadow: none !important;&lt;br /&gt;
  -webkit-box-shadow: none !important;&lt;br /&gt;
  box-shadow: none !important;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-primary, .mw-ui-button.mw-ui-progressive, #wpSave {&lt;br /&gt;
  background-image: none;&lt;br /&gt;
  background-color: #513392;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-primary:hover, .btn-primary:focus, .mw-ui-button.mw-ui-progressive:hover, mw-ui-button.mw-ui-progressive:focus, #wpSave:hover, #wpSave:focus {&lt;br /&gt;
  background-color: #6556A4;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.btn-primary:active, .mw-ui-button.mw-ui-progressive:active, #wpSave:active {&lt;br /&gt;
  background-color: #453A70;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
a:hover, a:focus {&lt;br /&gt;
  color: #6556A4;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar-right {&lt;br /&gt;
  margin-top: 7px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#searchInput {&lt;br /&gt;
  margin-top: 5px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#searchInput:focus {&lt;br /&gt;
  border: 1px solid #4B23A0;&lt;br /&gt;
  background-image: none;&lt;br /&gt;
  outline: 0;&lt;br /&gt;
  -webkit-box-shadow: none;&lt;br /&gt;
  box-shadow: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#footer {&lt;br /&gt;
  background-color: #F8F8F8;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#footer-icons li:last-child::before {&lt;br /&gt;
  content: &amp;quot; • &amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
td.mw-label {&lt;br /&gt;
  padding-right: 10px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media only screen and (min-width: 1000px){&lt;br /&gt;
  #contentwrapper {&lt;br /&gt;
    margin-bottom: 190px !important;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.oo-ui-panelLayout-framed {&lt;br /&gt;
  border: 0 none #FFF;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-navbar-brand&amp;diff=70</id>
		<title>MediaWiki:Tweeki-navbar-brand</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=MediaWiki:Tweeki-navbar-brand&amp;diff=70"/>
		<updated>2020-03-10T19:56:42Z</updated>

		<summary type="html">&lt;p&gt;Kamal: Created page with &amp;quot;File:Logo.wiki.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File:Logo.wiki.png&lt;/div&gt;</summary>
		<author><name>Kamal</name></author>
		
	</entry>
</feed>