67 lines
1.9 KiB
Protocol Buffer
67 lines
1.9 KiB
Protocol Buffer
syntax="proto3";
|
|
package bts.api.position;
|
|
option csharp_namespace="bts.api.position";
|
|
import "lib/api/apioptions.proto";
|
|
import "lib/api/apicore.proto";
|
|
import "lib/api/services/PositionService.proto";
|
|
|
|
message MarginResult {
|
|
enum ResultStatus { NewValid = 0; CachedValid = 1; Error = 2; }
|
|
|
|
string account = 10 [(bts.api.key)=true];
|
|
ResultStatus status = 12;
|
|
string portfolio_id = 15;
|
|
string settle_indicator = 20;
|
|
string settle_qualifier = 30;
|
|
string as_of_time = 40;
|
|
string calculation_id = 50;
|
|
|
|
double opt_value = 100;
|
|
double nonopt_value = 110;
|
|
double maint_margin = 120;
|
|
double initial_margin = 130;
|
|
}
|
|
|
|
message ExcessLiquidityReport {
|
|
string account = 10 [(bts.api.key)=true];
|
|
uint32 account_id = 11;
|
|
double leverage_factor = 20;
|
|
double cash_balance = 30;
|
|
MarginResult margin_result = 40;
|
|
AccountPNL account_pnl = 50;
|
|
bool should_enforce_margin = 60;
|
|
double excess_liquidity = 100;
|
|
}
|
|
|
|
|
|
message MarginRequest {
|
|
string account = 10;
|
|
}
|
|
|
|
message CashFactorUpdate {
|
|
string account = 10;
|
|
double leverage_factor = 20;
|
|
}
|
|
|
|
message CashBalanceUpdate {
|
|
string account = 10;
|
|
double cash_balance = 20;
|
|
}
|
|
|
|
message EnforceUpdate {
|
|
string account = 10;
|
|
bool should_enforce_margin = 20;
|
|
}
|
|
|
|
service MarginService {
|
|
option (bts.api.service_description) = "Provides CME Margin Information per account";
|
|
|
|
rpc get_margin(MarginRequest) returns (MarginResult);
|
|
rpc get_excess_liquidity_report(MarginRequest) returns (ExcessLiquidityReport);
|
|
rpc set_should_enforce_margin(EnforceUpdate) returns (bts.api.ResultMessage);
|
|
rpc set_cash_factor(CashFactorUpdate) returns (bts.api.ResultMessage);
|
|
rpc set_cash_balance(CashBalanceUpdate) returns (bts.api.ResultMessage);
|
|
|
|
rpc margin_data(bts.api.VoidMessage) returns (stream MarginResult);
|
|
rpc excess_liquidity_report(bts.api.VoidMessage) returns (stream ExcessLiquidityReport);
|
|
} |