Receive a snapshot and updates for any funding loans (funds not used in active positions) on your account.
Subscribe to the account information channel to keep track of your funding loans. The account information channel provides a snapshot and updates on the funding loans in your account. The snapshot is delivered upon subscribing and any changes to your funding loans 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 loan events are sent with CHAN_ID = 0 and can be identified by looking at the TYPE stream field. Funding loan events will use one of the following abbreviations: 'fls' (funding loans snapshot), 'fln' (funding loan new), 'flu' (funding loans update), 'flc' (funding loan close).
[
0, //CHAN_ID
"fls", //MSG_TYPE
[
[
26223578, //LOAN_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_LOAN_ARRAY
...
] //FUNDING_LOANS_SNAPSHOT
]
[0,"fls",[[2995442,"fUSD",-1,1575291961000,1575295850000,820,0,"ACTIVE",null,null,null,0.002,7,1575282446000,1575295850000,0,0,null,0,null,0]]]
[
0, //CHAN_ID
"fln", //MSG_TYPE
[
26223578, //LOAN_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_LOAN_ARRAY
]
Funding loans 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 | 'fls' (funding loans snapshot) |
[2] | FUNDING_LOANS_SNAPSHOT | Array | Array with an array of active funding loans(Indices [0...n] will be funding loans) |
[2][0...n] | FUNDING_LOAN_ARRAY | Array | Funding loan array |
Funding loans 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 | 'fln' (funding loan new), 'flu' (funding loan update), 'flc' (funding loan cancel (cancelled or fully executed)) |
[2] | FUNDING_CREDIT_ARRAY | Array | Funding credit array |
Funding loan arrays
Index | Field | Type | Description |
---|---|---|---|
[0] | LOAN_ID | Integer | Loan ID |
[1] | SYMBOL | String | The currency of the loan (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 loan was created |
[4] | MTS_UPDATE | Int | Millisecond Time Stamp when the loan was updated |
[5] | AMOUNT | Float | Amount the loan 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 loan |
[12] | PERIOD | Int | Period of the loan |
[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 |