Page Last Updated 2/21/2000
 DealRate
User Manual

Table of Contents

Synopsis
General
File Synchronization Details
Critical-Message Notification

System Command

Environment Variables
File Formats

Log File
Critical Message File

Operator Interaction

Daemon Mode
Interactive Mode
Signal Handling

Periodic Cleanup

Installation Notes

Installing TraderClient
Troubleshooting TraderClient


DealRate
User Manual

Synopsis

DealRate [InputDir [data_ext]]

General

DealRate manages the data transfer of FX deals requested via an external (SteelPoint) WWW Server Application and stores this deal data in a holding area for another application (TraderClient) to pick up and process.

TraderClient picks up these deals and presents them to a pool of traders each on their own workstation. Any trader may select a listed deal and provide a rate for it, at which time the deal is removed from the pool and sent back to the WWW Server Application for further downstream processing.

DealRate handles all the transfer of data and synchronization into and out of the FileMaker application TraderClient. The data transfers are all done via flat-file and environment variables are used to determine the file "drop locations".

DealRate runs on any hardware and operating system that supports an ANSI C compiler. TraderClient runs on any platform for which a FileMaker runtime is available (currently only WIN32 or Macintosh).

The parameters for DealRate are as follows:

InputDir The name of the directory into which deal files will be placed by the WWW server application. This program argument overrides the DL_DLSDIR environment variable.

data_ext The 3 character extension of the files, placed in the InputDir directory by the WWW server application, each of which contain a deal record.

File Syncronization Details

When a deal has been requested through the WWW server application a deal file ending in the characters specified by the data_ext program argument is placed in the directory specified by the InputDir argument. As soon as possible, after this deal file is written, the WWW server application places another file in this same directory with the same root name but an extension of ".lok". The presence of both the data file and the ".lok" file indicates to DealRate that a deal file, containing a single deal record is available for processing. Once the deal file has been processed and the associated trade request has been sent to TraderClient, DealRate deletes the corresponding ".lok" file.

Before a deal record may be sent to TraderClient, DealRate checks that the FileMaker application is ready to receive a deal. It does this by checking the DL_DLSDBDIR directory. If this directory does not contain a file called "indata.lk2", DealRate waits until this file appears, at which time DealRate copies an available "<root>.dlr" file from the DL_DLSDIR into the DL_DLSDBDIR directory into the file named "indata.dat". and deletes the "indata.lk2" file from this directory. The corresponding "<root>.lok" file is also deleted from the DL_DLSDIR directory.

The TraderClient server application imports any deal records from its "indata.dat" file providing its "indata.lk2" file is *not* present, immediately creating "indata.lk2" to signal to DealRate that the "indata.dat" file may now be reused. TraderClient gathers deals for which traders have provided a legal rate, on roughly a 3-second cycle time. If any completed records are found and providing the file "outdata.lk1" is *not* present, the TraderClient server exports all completed deals into the file "outdata.dat" and creates the file "outdata.lk1" to signal to DealRate that data is now available to be processed.

When the file "outdata.lk1" appears in the DL_DLSDBDIR directory, DealRate checks for the absence of a file called "SteelPoint.lck" in the DL_DLSODIR directory. If this file is *absent*, DealRate writes the contents of the "outdata.dat" file to the file named "SteelPoint.dat" in the DL_DLSODIR directory. DealRate then creates the file "SteelPoint.lck" in the DL_DLSODIR directory and deletes the "outdata.lk1" file from the DL_DLSDBDIR directory.

Phew!!

Critical-Message Notification

System Command

Critical Messages are delivered by a “system” command which is driven by the environment variable DL_ECMD. The shell command specified in this variable is executed with a minimum granularity of 10 minutes and is passed any critical messages issued since the last time the command was executed. Unsent critical messages are stored in the file <TCID>.msg which is passed on the standard-input to the command in the DL_ECMD environment variable. The execution of this command is noted in the logfile (see later). To prevent unnecessary repetition of identical messages, critical messages stored in <TCID>.msg may be processed with “uniq” for example, as follows:
setenv DL_ECMD “(uniq -6 | cat > /dev/console)”
Each line in the <TCID>.msg file is timestamped and its process-origin is identified. <TCID>.msg is deleted each time after the command in DL_ECMD is executed.

To prevent short-term error conditions from producing “orphaned notifications” a 45 second delay is implemented for new batches of error notifications.

Environment Variables

The default behaviour for certain interface functions may be modified by the use of “environment variables”. These variables must be set prior to the interface execution (usually in a “shell” or “batch” file). Command parameters take precendence over equivalent environment variables. The environment variables, used by the interface, all start with “DL_” and are as follows:

DL_ECMD The command to be used to process critical (information and error) messages (including all arguments to run the command) is taken from this variable. The command must take its input from the “standard input” stream.
DL_DLSODIR The full path to the directory where DealRate will put its data files once a rate has been assigned by a trader.
DL_DLSDIR The directory where the SteelPoint Server Application will place deal record files for processing. This variable is superseeded by the optional InputDir program argument.
DL_DLSDBDIR The directory where DealRate will place deal record files for the TraderClient GUI to process. DealRate also expects to pick up completed deal files from this location.
DL_REGEXP The extension (including the '.') of files in the directory, specified by the optional InputDir argument or the DL_DLSDIR environment variable, that will contain deal records for processing. These records having been placed in this location by the Steelpoint WWW Server Application.This variable is superseeded by the optional data_ext program argument.
DL_PRINT The number of days into the past from which this mimic will serve deals.

File Formats

Log File

A logfile named MANY<mmdd>.log (where <mmdd> stands for the digits representing the month and day that the file was created) is appended to as log-events occur. All “critical messages” are logged.

If DealRate is left running overnight, a new logfile is automatically created as soon as necessary after midnight.

Critical Message File

(UNIX and NT installations only, see “Critical-Message Notification” above)
The file MANY<mmdd>.msg contains one line for each critical message. Each line comprises four sections:

  1. <application name>
  2. [<DateTime>]
  3. <a critical message>
  4. #<a critical message number>. Error numbers for DealRate are in the 130,000 to 139,999 range.

For Example:
mtadlr [Tue Nov 14 19:03:06 1995] /usr/pub/pear_shaped...No such directory #131102

Operator Interaction

Daemon Mode

The program automatically detects if it is to be run non-interactively. If the standard-input is closed during program execution or is redirected to /dev/null at startup, DealRate stops reading the standard-input and stops delivering output to the standard-output and standard-error channels.

Interactive Mode

When the program is run in interactive mode, the following commands are available, all operating systems except MacOS and Windows NT require a <CR> to be appended for the command to be accepted:

q or Q quit the program gracefully
eof DealRate enters Daemon Mode (see above).

Signal Handling

On UNIX operating systems, the program catches SIGINT, SIGHUP, and SIGTERM. When one of these signals is detected, the program exits cleanly, closing sockets and writing shutdown information to the logfile. A Critical Message is also generated. On MacOS, only SIGINT is caught, causing clean program termination. Under MSWindows, both SIGINT and SIGTERM receive this treatment.

On UNIX operating systems, SIGPIPE is caught and its passage is noted in the logfile.

Periodic Cleanup

Disk space is consumed according to the number of errors detected by DealRate. Each day that DealRate is executed, a new file (a log file) is created in the DealRate execution directory. It is suggested that these files are archived and deleted from the drive every few months.

Installation Notes

The contents of the NT command file that sets up the environment variables and starts the DealRate process is:

set MTA=F:\softek\RateFiller
set DL_DLSODIR=%MTA%\Steelpoint
set DL_DLSDIR=%MTA%\Steelpoint
set DL_DLSDBDIR=%MTA%\TraderClient
set DL_REGEXP=.dlr
set DL_PRINT=no
cd %MTA%
start %MTA%\dealrate\debug\dealrate.exe
cd ..\TraderClient
start TraderClient.exe
exit

Since all the arguments to DealRate are optional (and satisfiable from environment variables), DealRate may be turned into an "always on" NT service (with the application of a suitable "service layer"). The above command file serves as an illustration for the required environment settings and doubles as an example of the command script that may be associated with a manually activated shortcut, or placed in the NT directory for automatic startup on user-login.

Installing TraderClient

Installation of the TraderClient software is a little tricky but quite quick:

  1. Locate the TraderClient distribution directory provided by Softek.
  2. Copy this entire directory to the client workstation to be installed.
  3. Run the TraderClient application by activating the "SOFTEK PARTNERS SOLUTION.EXE" on the newly installed client.
  4. Hit the "Find" button when the normal trader window has appeared.
  5. Within 2 seconds, hit the "Find" button in the new find dialog window (this will halt the scripts and allow menu interaction).
  6. Pull the "Edit" menu down to "Preferences" and set up the network preferences to be TCP-IP. This same dialog box has a text-box for a machine name which should be set up with the unique trader id for this workstation.
  7. Dismiss the dialog box and quit the application.
  8. *MOST IMPORTANT* the 2 files "Loadtest" and Softek Partners" **must** now be deleted from the trader's workstation before the TraderClient software is re-activated.

Troubleshooting TraderClient

On reactivation of the TraderClient software ("SOFTEK PARTNERS SOLUTION.EXE") you should see a message that indicates that two databases are being opened as a client of the main server machine. If you do not see this message then one or more of the following has happened and you should attempt to remedy the situation before leaving the application in the hands of the trader.

  1. The last step (see *MOST IMPORTANT* above) was not performed and the 2 database files are still present in the workstation's TraderClient directory.
  2. The server TraderClient application is not running on the server machine.
  3. A TCP-IP network failure has occurred or the TraderClient installation was not performed as described above..

The last two cases above would result in a message stating that the necessary databases could not be found and inviting the user to locate them manually. It is always advisable to decline this invitation and either start up the server application or set up the local network or TraderClient properly.

The only difference between a client (workstation based) version of the TraderClient software and the server version is that the server version has the two extra database files "Loadtest" and "Softek Partners" in the same directory as the TraderClient executable ("SOFTEK PARTNERS SOLUTION.EXE").