Funding Loans

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

IndexFieldTypeDescription
[0]CHANNEL_IDIntIdentification number assigned to the channel for the duration of this connection.
[1]MSG_TYPEString'fls' (funding loans snapshot)
[2]FUNDING_LOANS_SNAPSHOTArrayArray with an array of active funding loans(Indices [0...n] will be funding loans)
[2][0...n]FUNDING_LOAN_ARRAYArrayFunding loan array

Funding loans update data

IndexFieldTypeDescription
[0]CHANNEL_IDIntIdentification number assigned to the channel for the duration of this connection.
[1]MSG_TYPEString'fln' (funding loan new), 'flu' (funding loan update), 'flc' (funding loan cancel (cancelled or fully executed))
[2]FUNDING_CREDIT_ARRAYArrayFunding credit array

Funding loan arrays

Index Field Type Description
[0]LOAN_IDIntegerLoan ID
[1]SYMBOLStringThe currency of the loan (fUSD, etc)
[2]SIDEInt1 if you are the lender, 0 if you are both the lender and borrower, -1 if you're the borrower
[3]MTS_CREATEIntMillisecond Time Stamp when the loan was created
[4]MTS_UPDATEIntMillisecond Time Stamp when the loan was updated
[5]AMOUNTFloatAmount the loan is for
[6]FLAGSObjectFuture params object (stay tuned)
[7]STATUSStringCredit Status: ACTIVE, EXECUTED, PARTIALLY FILLED, CANCELED
[ . . . ]
[11]RATEFloatRate of the loan
[12]PERIODIntPeriod of the loan
[13]MTS_OPENINGIntMillisecond Time Stamp when the funding was opened
[14]MTS_LAST_PAYOUTIntMillisecond Time Stamp when the last payout was received
[15]NOTIFYInt0 if false, 1 if true
[16]HIDDENInt0 if false, 1 if true
[ . . . ]
[18]RENEWInt0 if false, 1 if true
[19]RATE_REALFloatThe calculated rate for FRR and FRRDELTAFIX
[20]NO_CLOSEInt0 if false, 1 if true (whether the funding should be closed when the position is closed)
[21]POSITION_PAIRStringThe pair of the position that the funding is used for