CUBE Trade Connector
Features
crypto-cubeConnector KeyNotes
Lot Trading
All orders are placed on a single market, specified by the market-id.
The market definition specifies the base and quote assets and their respective lot sizes for the particular market.
Prices and quantities in this API are in units of base and quote lots.
That is, a quantity of 1 equals 1 base lot, and a price of 10 equals 10 quote lots / base lot (read as quote lots per base lot).
Rounding
Prices and quantities can be silently rounded if not matched to tick size or qty increment.
This can lead to "overfills" and functionality misbehavior.
Self Trade Prevention
Self-trade-prevention (STP) allows market participants to prevent the matching of orders for accounts with common ownership.
Currently, STP only applies for orders with the same subaccount_id.
STP will only be applied when a match is about to occur between the two orders.
That is, if the aggressing order is fully filled before reaching the resting order in FIFO order, no STP cancels will happen.
selfTradePrevention = ALLOW_SELF_TRADE
Cancel On Disconnect
When enabled, orders are automatically cancelled if the network connection to Cube's servers is closed.
The exchange does not support order status requests, so keeping cancelOnDisconnect enabled is strongly recommended.
SubAccountId
SubAccountId can be retrieved from the CUBE GUI. If not specified, the connector uses the first subAccountId encountered. If invalid API keys are specified, the connector will be disconnected when an order is sent.
Symbology
Cube uses marketId as the symbol identifier.
Market IDs can be retrieved via the API: https://api.cube.exchange/ir/v0/markets
Configuration
Connector settings
| Parameter | Default Value | Description |
|---|---|---|
cancelOnDisconnect | true | Mark orders to cancel in case of any disconnect. |
selfTradePrevention | ALLOW_SELF_TRADE | Self-trade-prevention (STP) allows market participants to prevent the matching of orders for accounts with common ownership. Allowed value:CANCEL_RESTING, CANCEL_AGGRESSING, ALLOW_SELF_TRADE |
subAccountId | Id of the account for trading |
Supported order attributes
| Key | Description |
|---|---|
| 18 | '6' value used for PostOnly orders submission |
Config sample
connectors {
CUBE : ${template.connector.crypto.cube}{
settings: {
restUrl = "https://api.cube.exchange"
websocketUrl = "wss://api.cube.exchange/os"
cancelOnDisconnect = true
selfTradePrevention = ALLOW_SELF_TRADE # Valid values: ALLOW_SELF_TRADE, CANCEL_AGGRESSING, CANCEL_RESTING
apiKeys: [{
apiKey = "<API_KEY>"
apiSecret = "<API_SECRET>"
}]
}
}
}