Skip to end of metadata
Go to start of metadata

 

Use Case 1. Creating a New Portfolio

Margin Service API Flow

Requests
Description 
Create Portfolio
  • Client submits required attributes for a portfolio
  • Server validates request, including checks for uniqueness (name is unique)
  • If the request is valid, an internal identifier and status are returned
  • If the request is invalid, a status and error message/error code are returned
  • Does not include transactions (trades)
Alter Transactions
  • Allows transactions to be uploaded in bulk (multiple transactions in a single request)
  • Supports a "mixed mode" allowing transactions to be created, updated, and deleted
  • A valid portfolio identifier must be specified
  • All transactions must be in a single portfolio
  • Transactions being created must be specified with all the required attributes.
  • Transactions being updated must have the attributes being updated and the system internal identifier
  • Transactions being deleted must have the internal identifier of the transaction
  • The sever will return a request identifier

Workflow 

Create Portfolio Usecase2

 

Use Case 2. Calculating Margin on an Existing Portfolio

Margin Service API Flow

Requests
Description 
Calculate Margin
  • Client submits margin type (full, incremental)
  • Client must submit portfolio identifier
  • Client may submit additional (transient) transactions by value
  • Client may submit transactions to exclude by identifier from the portfolio
  • Client may submit additional portfolio by reference
  • Client may submit transaction IDs by reference (allowed for their user)
  • The server will queue up the request for execution
  • If the portfolio does not exist, referenced transactions do not exist, or there are other errors an error message/code will be returned
  • If the request is valid, then after the request is submitted to the risk engine for processing a request identifier and status are returned.
Get Calculate Margin Result
  • Client submits margin request identifier
  • Server returns the identifier, status, error (if applicable), and result (if available)

Workflow

Calculating Margin on Existing Portfolio usecase2

Use Case 3. Calculating Margin on an Existing Portfolio with Additions/Subtractions

Margin Service API Flow

Requests
Description 
Alter Transactions
  • Allows transactions to be uploaded in bulk (multiple transactions in a single request)
  • Supports a "mixed mode" allowing transactions to be created, updated, and deleted
  • A valid portfolio identifier must be specified
  • All transactions must be in a single portfolio
  • Transactions being created must be specified with all the required attributes
  • Transactions being updated must have the attributes being updated and the system internal identifier
  • Transactions being deleted must have the internal identifier of the transaction
  • The sever will return a request identifier
Calculate Margin
  • Client submits margin type (full, incremental)
  • Client must submit portfolio identifier
  • Client may submit additional (transient) transactions by value
  • Client may submit transactions to exclude by identifier from the portfolio
  • Client may submit additional portfolio by reference
  • Client may submit transaction IDs by reference (allowed for their user)
  • The server will queue up the request for execution
  • If the portfolio does not exist, referenced transactions do not exist, or there are other errors an error message/code will be returned
  • If the request is valid, then after the request is submitted to the risk engine for processing a request identifier and status are returned
Get Alter Transactions Result
  • The client submits an identifier from the alter transactions request
  • The server returns the overall status of the request, and results for all transactions if all have completed processing.
  • The server will return an identifier (if available), status, and error message/error code (if applicable)
Get Calculate Margin Result
  • Client submits margin request identifier
  • Server returns the identifier, status, error (if applicable), and result (if available)

Workflow

Calculating Margin on Existing Portfolio with Ad2

Use Case 4. List All Margin Results for a Portfolio

Margin Service API Flow

Requests
Description 
List Margins
  • Client submits query criteria (portfolio ID, time range, etc.)
  • Server returns identifier, status, error (if applicable), and result (if available) for all matching requests
  • This is similar to the functionality in the MHQ Grid in the UI

Workflow

List All Margin Results for a Portfolio usecase2

Use Case 5. List All Portfolios

Margin Service API Flow

 

Requests
Description 
List Portfolios
  • Client can optionally submit search parameters (TBD)
  • The server returns all portfolios matching the criteria
  • Does not include transactions or other data
  • Since this is querying local data, it is assumed that this can be returned synchronously

Workflow

List all Portfolios usecase2

Use Case 6. Update an Existing Portfolio

Margin Service API Flow

Requests
Description 
Update Portfolio
  • Client submits an internal portfolio identifier and updated attributes
  • If no portfolio is found with the identifier an error is returned
  • If the user is not authorized to modify the portfolio an error is returned
  • If the request is valid and successful, the internal identifier and status are returned
  • Transactions must be submitted separately

Workflow

Update portfolio usecase2

 

Use Case 7. Delete an Existing Portfolio

Margin Service API Flow

Requests
Description 
Delete Portfolio
  • Client submits an internal portfolio identifier
  • If no portfolio is found with the identifier, an error is returned
  • If the user is not authorized to delete the portfolio, an error is returned
  • The server will delete the portfolio and all associated data (transactions, margins, etc.).  This is known as a "cascading delete"

 Workflow

Delete Portfolio usecase2

 

Use Case 8. List Transactions

 Margin Service API Flow

Requests
Description 
List Transaction
  • Client can optionally submit search criteria
  • The server returns all portfolios matching the criteria
  • Does not include transactions or other data
  • The results of this request are returned synchronously

 Workflow

List transaction usecas2

Use Case 9. Get Transactions

Margin Service API Flow

Requests
Description 
Get Transaction
  • Client submits an internal transaction identifier
  • If no transaction is found with the identifier, an error is returned
  • If the user is not authorized to get the transaction, an error is returned
  • If the transaction is found it is returned

 Workflow

Get transaction usecase2

 

  • No labels