Objects

About objects

Objectsopen in new window in GraphQL represent the resources you can access. An object can contain a list of fields, which are specifically typed.

Account

User account.

Fields

NameDescription
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

NameDescription
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

NameDescription
apiVersion (String!)

API Version.


Currency

Currency.

Fields

NameDescription
code (ID!)

Code (Example : ETH).


CurrencyAmount

Currency amount (amount value and currency).

Fields

NameDescription
currency (Currency)

Amount currency.

value (BigDecimal)

Amount value.


CurrencyPair

Currency pair for trading.

Fields

NameDescription
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

NameDescription
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

NameDescription
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

NameDescription
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

NameDescription
stopGainPercentage (Float)

Stop gain percentage.

stopLossPercentage (Float)

Stop loss percentage.


Strategy

Strategies.

Fields

NameDescription
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

NameDescription
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.