Track portfolio position and monitor margin risk, updating with every trade or component price change

View the Project on GitHub VoltDB/app-positionkeeper

VoltDB Example App: Position Keeper

Use Case

This application simulates a simple position keeper applicaton that maintains the positions of portfolios that are updated frequently as trades and price changes occur.

Code organization

The code is divided into two projects:

See below for instructions on running these applications. For any questions, please contact


Before running these scripts you need to have VoltDB 4.0 (Enterprise or Community) or later installed, and you should add the voltdb-$(VERSION)/bin directory to your PATH environment variable, for example:

export PATH="$PATH:$HOME/voltdb-ent-4.0.2/bin"


  1. Start the database in the background


  2. Run the client application


Note: this client can only be run once, not repeatedly, or it will stop with unique constraint violations. To run it again, the database needs to be stopped and restarted, or all of the tables need to be truncated.

  1. To stop the database and clean up temp files

    voltadmin shutdown ./


You can control various characteristics of the demo by modifying the parameters passed into the InvestmentBenchmark java application in the script.

Speed & Duration:

--duration=120                (benchmark duration in seconds)
--autotune=true               (true = ignore rate limit, run at max throughput until latency is impacted)
                              (false = run at the specified rate limit)
--ratelimit=20000             (when autotune=false, run up to this rate of requests/second)

Use case parameters:

--traders=1000                 (number of traders)
--secpercnt=10                 (number of securities each trader has in their portfolio)

Instructions for running on a cluster

Before running this demo on a cluster, make the following changes:

  1. On each server, edit the file to set the HOST variable to the name of the first server in the cluster:


  2. On each server, edit db/deployment-cluster.xml to set hostcount to the correct number of servers:

Also, in the same file, set the voltdbroot path to an appropriate path for your servers.

  1. On each server, run the start script:


  2. On one server, Edit the script to set the SERVERS variable to a comma-separated list of the servers in the cluster


  3. Run the client script: