Receive a snapshot and updates for any funding credits (funds used in active positions) on your account.
Subscribe to the account information channel to keep track of your funding credits. The account information channel provides a snapshot and updates on the funding credits in your account. The snapshot is delivered upon subscribing and any changes to your funding credits will be provided as updates for as long as the channel remains open. Any authenticated connection is automatically subscribed to the account information channel.
Example code to open an authenticated connection can be found on our Authenticated Channels Page.
Funding credits events are sent with CHAN_ID = 0 and can be identified by looking at the TYPE stream field. Funding credits events will use one of the following abbreviations: 'fcs' (funding credits snapshot), 'fcn' (funding credits new), 'fcu' (funding credits update), 'fcc' (funding credits close).
[
0, //CHAN_ID
"fcs", //MSG_TYPE
[
[
26223578, //CREDIT_ID
"fUST", //SYMBOL
1, //SIDE
1575052261000, //MTS_CREATE
1575296187000, //MTS_UPDATE
350, //AMOUNT
0, //FLAGS
"ACTIVE", //STATUS
null, //PLACEHOLDER
null, //PLACEHOLDER
null, //PLACEHOLDER
0, //RATE
30, //PERIOD
1575052261000, //MTS_OPENING
1575293487000, //MTS_LAST_PAYOUT
0, //NOTIFY
0, //HIDDEN
null, //PLACEHOLDER
0, //RENEW
null, //RATE_REAL
0, //NO_CLOSE
"tBTCUST" //POSITION_PAIR
], //FUNDING_CREDIT_ARRAY
...
] //FUNDING_CREDITS_SNAPSHOT
]
[
0, //CHAN_ID
"fcu", //MSG_TYPE
[
26223578, //CREDIT_ID
"fUST", //SYMBOL
1, //SIDE
1575052261000, //MTS_CREATE
1575296787000, //MTS_UPDATE
350, //AMOUNT
0, //FLAGS
"ACTIVE", //STATUS
null, //PLACEHOLDER
null, //PLACEHOLDER
null, //PLACEHOLDER
0, //RATE
30, //PERIOD
1575052261000, //MTS_OPENING
1575293487000, //MTS_LAST_PAYOUT
0, //NOTIFY
0, //HIDDEN
null, //PLACEHOLDER
0, //RENEW
null, //RATE_REAL
0, //NO_CLOSE
"tBTCUST" //POSITION_PAIR
] //FUNDING_CREDIT_ARRAY
]
Funding credits snapshot data
Index | Field | Type | Description |
---|---|---|---|
[0] | CHANNEL_ID | Int | Identification number assigned to the channel for the duration of this connection. |
[1] | MSG_TYPE | String | 'fcs' (funding credits snapshot) |
[2] | FUNDING_CREDITS_SNAPSHOT | Array | Array with an array of active funding credits(Indices [0...n] will be funding credits) |
[2][0...n] | FUNDING_CREDIT_ARRAY | Array | Funding credit array |
Funding credits update data
Index | Field | Type | Description |
---|---|---|---|
[0] | CHANNEL_ID | Int | Identification number assigned to the channel for the duration of this connection. |
[1] | MSG_TYPE | String | 'fcn' (funding credit new), 'fcu' (funding credit update), 'foc' (funding credit cancel (cancelled or fully executed)) |
[2] | FUNDING_CREDIT_ARRAY | Array | Funding credit array |
Funding credit arrays
Index | Field | Type | Description |
---|---|---|---|
[0] | CREDIT_ID | Integer | Credit ID |
[1] | SYMBOL | String | The currency of the credit (fUSD, etc) |
[2] | SIDE | Int | 1 if you are the lender, 0 if you are both the lender and borrower, -1 if you're the borrower |
[3] | MTS_CREATE | Int | Millisecond Time Stamp when the credit was created |
[4] | MTS_UPDATE | Int | Millisecond Time Stamp when the credit was updated |
[5] | AMOUNT | Float | Amount the credit is for |
[6] | FLAGS | Object | Future params object (stay tuned) |
[7] | STATUS | String | Credit Status: ACTIVE, EXECUTED, PARTIALLY FILLED, CANCELED |
[ . . . ] | |||
[11] | RATE | Float | Rate of the credit |
[12] | PERIOD | Int | Period of the credit |
[13] | MTS_OPENING | Int | Millisecond Time Stamp when the funding was opened |
[14] | MTS_LAST_PAYOUT | Int | Millisecond Time Stamp when the last payout was received |
[15] | NOTIFY | Int | 0 if false, 1 if true |
[16] | HIDDEN | Int | 0 if false, 1 if true |
[ . . . ] | |||
[18] | RENEW | Int | 0 if false, 1 if true |
[19] | RATE_REAL | Float | The calculated rate for FRR and FRRDELTAFIX |
[20] | NO_CLOSE | Int | 0 if false, 1 if true (whether the funding should be closed when the position is closed) |
[21] | POSITION_PAIR | String | The pair of the position that the funding is used for |