Objects
About objects
Objects in GraphQL represent the resources you can access. An object can contain a list of fields, which are specifically typed.
Account
User account.
Fields
| Name | Description |
|---|---|
| accountId (String!) | A unique identifier for this account. |
| balances ([Balance]) | The balances of each currency owned by this account. |
| name (String) | A descriptive name for this account. |
Balance
User’s balance for a specific currency.
Fields
| Name | Description |
|---|---|
| available (BigDecimal) | Returns the amount of the currency in this balance that is available to trade. |
| borrowed (BigDecimal) | Returns the borrowed amount of the available currency in this balance that must be repaid. |
| currency (Currency!) | Currency. |
| depositing (BigDecimal) | Returns the amount of the currency in this balance that is locked in the deposit. |
| frozen (BigDecimal) | Returns the frozen amount of the currency in this balance that is locked in trading. |
| loaned (BigDecimal) | Returns the loaned amount of the total currency in this balance that will be returned. |
| total (BigDecimal) | Returns the total amount of the currency in this balance. |
| withdrawing (BigDecimal) | Returns the amount of the currency in this balance that is locked in withdrawal. |
Configuration
Server configuration.
Fields
| Name | Description |
|---|---|
| apiVersion (String!) | API Version. |
Currency
Currency.
Fields
| Name | Description |
|---|---|
| code (ID!) | Code (Example : ETH). |
CurrencyAmount
Currency amount (amount value and currency).
Fields
| Name | Description |
|---|---|
| currency (Currency) | Amount currency. |
| value (BigDecimal) | Amount value. |
CurrencyPair
Currency pair for trading.
Fields
| Name | Description |
|---|---|
| baseCurrency (Currency!) | The base currency is the first currency appearing in a currency pair quotation. |
| quoteCurrency (Currency!) | The quote currency is the second currency appearing in a currency pair quotation. |
Gain
Gain.
Fields
| Name | Description |
|---|---|
| amount (CurrencyAmount) | Gain amount. |
| fees ([CurrencyAmount]) | Fees (from opening and closing orders). |
| percentage (Float) | Gain percentage. |
Order
An order is a request by an investor to buy or sell.
Fields
| Name | Description |
|---|---|
| amount (CurrencyAmount!) | Amount to be ordered / amount that was ordered. |
| averagePrice (CurrencyAmount) | Weighted average price of the fills in the order. |
| cumulativeAmount (CurrencyAmount) | Amount to be ordered / amount that has been matched against order on the order book/filled. |
| currencyPair (CurrencyPair!) | Currency pair. |
| leverage (String) | The leverage to use for margin related to this order. |
| limitPrice (CurrencyAmount) | Limit price. |
| marketPrice (CurrencyAmount) | Market price - The price Cassandre had when the order was created. |
| orderId (String!) | An identifier set by the exchange that uniquely identifies the order. |
| status (OrderStatus!) | Order status. |
| strategy (Strategy!) | The strategy that created the order. |
| timestamp (DateTime) | The timestamp of the order. |
| trades ([Trade]) | All trades related to this order. |
| type (OrderType!) | Order type i.e. bid (buy) or ask (sell). |
| uid (Int!) | Order unique ID. |
| userReference (String) | An identifier provided by the user on placement that uniquely identifies the order. |
Position
A position is the amount of a security, commodity or currency which is owned by an individual, dealer, institution, or other fiscal entity.
Fields
| Name | Description |
|---|---|
| amount (CurrencyAmount!) | Position amount. |
| autoClose (Boolean!) | Indicates if the position should be closed automatically by Cassandre. |
| closingOrder (Order) | The order created to close the position. |
| currencyPair (CurrencyPair!) | Currency pair. |
| forceClosing (Boolean!) | Indicates that the position must be closed no matter the rules. |
| gain (Gain) | If closed, returns the gain made. |
| highestCalculatedGain (Gain) | Highest calculated gain. |
| latestCalculatedGain (Gain) | Latest calculated gain. |
| lowestCalculatedGain (Gain) | Lowest calculated gain. |
| openingOrder (Order!) | The order created to open the position. |
| positionId (Int!) | An identifier that uniquely identifies this position for a strategy. |
| rules (PositionRules!) | Position rules. |
| status (PositionStatus!) | Position status. |
| strategy (Strategy!) | The strategy that created the position. |
| type (PositionType!) | Position type (Long or Short). |
| uid (Int!) | Position unique ID. |
PositionRules
Position rules is used to know when cassandre should close a position.
Fields
| Name | Description |
|---|---|
| stopGainPercentage (Float) | Stop gain percentage. |
| stopLossPercentage (Float) | Stop loss percentage. |
Strategy
Strategies.
Fields
| Name | Description |
|---|---|
| name (String) | Strategy name - Comes from the Java annotation. |
| strategyId (String!) | An identifier that uniquely identifies the strategy - Comes from the Java annotation. |
| uid (Int!) | Strategy unique ID. |
Trade
A trade is the action of buying and selling (linked to an order).
Fields
| Name | Description |
|---|---|
| amount (CurrencyAmount!) | Amount to be ordered / amount that was ordered. |
| currencyPair (CurrencyPair!) | Currency pair. |
| fee (CurrencyAmount) | The fee that was charged by the exchange for this trade. |
| order (Order) | The order responsible for this trade. |
| orderId (String!) | The order id of the order responsible for this trade. |
| price (CurrencyAmount) | The price. |
| timestamp (DateTime) | The timestamp of the trade. |
| tradeId (String!) | An identifier set by the exchange that uniquely identifies the trade. |
| type (TradeType!) | Trade type i.e. bid (buy) or ask (sell). |
| uid (Int!) | Trade unique ID. |
| userReference (String) | An identifier provided by the user on placement that uniquely identifies the order. |