This subscription feed publishes account information.
Authentication is required.
Feed |
Event Type |
API Keys | Original & Signed Challenge |
account_log |
subscribe / unsubscribe
|
Any | Yes |
Sample Sent Message |
{ "event":"subscribe", "feed":"account_log", "api_key":"CMl2SeSn09Tz+2tWuzPiPUjaXEQRGq6qv5UaexXuQ3SnahDQU/gO3aT+", "original_challenge":"226aee50-88fc-4618-a42a-34f7709570b2", "signed_challenge":"RE0DVOc7vS6pzcEjGWd/WJRRBWb54RkyvV+AZQSRl4+rap8Rlk64diR+ Z9DQILm7qxncswMmJyvP/2vgzqqh+g==" } |
Sample Return if Successful. |
{ |
Field |
Type | Description |
event
|
string | The result, subscribed or subscribed_failed or unsubscribed or unsubscribed_failed |
feed | string | The requested subscription feed |
api_key | string | The user api key |
original_challenge | string | The message that is received from a challenge request |
signed_challenge | string | The signed challenge message with user api secret |
Sample Subscription Snapshot Data |
{ 'feed':'account_log_snapshot', 'logs':[ { 'id':1690, 'date':'2019-07-11T08:00:00.000Z', 'asset':'bch', 'info':'funding rate change', 'booking_uid':'86fdc252-1b6e-40ec-ac1d-c7bd46ddeebf', 'margin_account':'f-bch:usd', 'old_balance':0.01215667051, 'new_balance':0.01215736653, 'old_average_entry_price':0.0, 'new_average_entry_price':0.0, 'trade_price':0.0, 'mark_price':0.0, 'realized_pnl':0.0, 'fee':0.0, 'execution':'', 'collateral':'bch', 'funding_rate':-8.7002552653e-08, 'realized_funding':6.9602e-07 }, { 'id':1689, 'date':'2019-07-11T04:00:00.000Z', 'asset':'bch', 'info':'funding rate change', 'booking_uid':'680d3973-5774-4a9d-b807-ab8aa73f95c3', 'margin_account':'f-bch:usd', 'old_balance':0.01215715298, 'new_balance':0.01215667051, 'old_average_entry_price':0.0, 'new_average_entry_price':0.0, 'trade_price':0.0, 'mark_price':0.0, 'realized_pnl':0.0, 'fee':0.0, 'execution':'', 'collateral':'bch', 'funding_rate':6.0309345058e-08, 'realized_funding':-4.8247e-07 }, { 'id':1688, 'date':'2019-07-11T00:00:00.000Z', 'asset':'bch', 'info':'funding rate change', 'booking_uid':'72e3396e-8fc4-4bd9-9379-8e2b2225af85', 'margin_account':'f-bch:usd', 'old_balance':0.01215847263, 'new_balance':0.01215715298, 'old_average_entry_price':0.0, 'new_average_entry_price':0.0, 'trade_price':0.0, 'mark_price':0.0, 'realized_pnl':0.0, 'fee':0.0, 'execution':'', 'collateral':'bch', 'funding_rate':1.64955714332e-07, 'realized_funding':-1.31965e-06 } ] } |
Field |
Type | Description |
feed | string | The subscribed feed |
logs | list of structures | A list containing the account logs |
id | positive integer | The identifier of the log |
date | ISO8601 datetime | The creation time of the log according to server date and time |
asset | string | The asset related of the booking |
info | string | A description of the booking |
booking_uid | string | The unique id of the booking |
margin_account | string | The account name |
old_balance | float | The account balance before the described in info action |
new_balance | float |
The portfolio value calculated as balance plus unrealized pnl value |
old_average_entry_price | positive float |
The average entry price of the position prior to this trade |
new_average_entry_price | positive float |
The average entry price of the position after this trade |
trade_price | positive float |
The price the trade was executed at |
mark_price | positive float |
The mark price at the time the trade was executed |
realized_pnl | float |
The pnl that is realized by reducing the position |
fee | float |
The fee paid |
execution | string |
The uid of the associated execution |
collateral | string |
The currency of the associated entry |
funding_rate | float |
The absolute funding rate |
realized_funding | float |
The funding rate realized due to change in position size or end of funding rate period |
Sample Subscription Delta Data |
{ 'feed':'account_log', 'new_entry':{ 'id':1697, 'date':'2019-07-11T13:00:27.632Z', 'asset':'pi_bchusd', 'info':'futures trade', 'booking_uid':'55a02b5b-2c90-4d43-b0eb-eb3801d50e3f', 'margin_account':'f-bch:usd', 'old_balance':1.0, 'new_balance':2.0, 'old_average_entry_price':413.3, 'new_average_entry_price':374.3445326979084, 'trade_price':342.1, 'mark_price':342.4, 'realized_pnl':0.0, 'fee':0.0, 'execution':'fc49fea9-8827-4a2e-8e36-c047523ddc30', 'collateral':'bch' } } |
Field |
Type | Description |
feed | string | The subscribed feed |
logs | list of structures | A list containing the account logs |
id | positive integer | The identifier of the log |
date | ISO8601 datetime | The creation time of the log according to server date and time |
asset | string | The asset related of the booking |
info | string | A description of the booking |
booking_uid | string | The unique id of the booking |
margin_account | string | The account name |
old_balance | float | The account balance before the described in info action |
new_balance | float |
The portfolio value calculated as balance plus unrealized pnl value |
old_average_entry_price | positive float |
The average entry price of the position prior to this trade |
new_average_entry_price | positive float |
The average entry price of the position after this trade |
trade_price | positive float |
The price the trade was executed at |
mark_price | positive float |
The mark price at the time the trade was executed |
realized_pnl | float |
The pnl that is realized by reducing the position |
fee | float |
The fee paid |
execution | string |
The uid of the associated execution |
collateral | string |
The currency of the associated entry |
funding_rate | float |
The absolute funding rate |
realized_funding | float |
The funding rate realized due to change in position size or end of funding rate period |
Sample Return if Unsuccessful |
{ "event":"error", "message":"Invalid product id" } |
Field |
Type | Description |
event | string | Always error |
message | string |
An error message out of:
|