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":5796184, "date":"2022-06-22T15:00:00.000Z", "asset":"usd", "contract":"pf_trxusd", "info":"funding rate change", "booking_uid":"55f48e86-3401-4cc5-bad5-d85287d978b9", "margin_account":"flex", "old_balance":6284755.3826696295, "new_balance":6284753.125626004, "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":"", "funding_rate":0.000161275, "realized_funding":-2.257043625 }, { "id":5796183, "date":"2022-06-22T15:00:00.000Z", "asset":"usd", "contract":"pf_opusd", "info":"funding rate change", "booking_uid":"e35c7e3d-03ab-4b0a-880a-86f4c6d57e3f", "margin_account":"flex", "old_balance":6284755.38393438, "new_balance":6284755.3826696295, "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":"", "funding_rate":0.00126475, "realized_funding":-0.00126475 }, ... ] } |
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 |
contract | string | The contract associated with 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 unrealised 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 realised 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 realised due to change in position size or end of funding rate period |
conversion_spread_percentage | float |
The percentage conversion spread used in a currency conversion |
Sample Subscription Delta Data |
{ "feed":"account_log", "new_entry":{ "id":5796185, "date":"2022-06-22T15:09:22.958Z", "asset":"pf_xbtusd", "contract":"pf_xbtusd", "info":"futures trade", "booking_uid":"99f153e6-28b7-4edd-b747-342bae521453", "margin_account":"flex","old_balance":-84.4556, "new_balance":-85.4556, "old_average_entry_price":39147.59014879748, "new_average_entry_price":38952.780327688066, "trade_price":22500.0, "mark_price":20739.7541, "realized_pnl":0.0, "fee":0.0, "execution":"35302983-48cf-4723-a127-0ed20241faec", "collateral":"" } } { "feed":"account_log", "new_entry":{ "id":5796186, "date":"2022-06-22T15:09:22.958Z", "asset":"usd", "contract":"pf_xbtusd", "info":"futures trade", "booking_uid":"3e5ac800-dc10-4e46-a833-69027717e30e", "margin_account":"flex", "old_balance":6284753.125626004, "new_balance":6285433.406906877, "old_average_entry_price":0.0, "new_average_entry_price":0.0, "trade_price":22500.0, "mark_price":20739.7541, "realized_pnl":0.0, "fee":2.25, "execution":"35302983-48cf-4723-a127-0ed20241faec", "collateral":"", "funding_rate":51.679775, "realized_funding":682.53128087216 } } { "feed":"account_log", "new_entry":{ "id":5796187, "date":"2022-06-22T15:09:51.862Z", "asset":"usd", "contract":"", "info":"transfer", "booking_uid":"077371b3-4911-423b-978e-07fdfcaf4caa", "margin_account":"flex", "old_balance":6285433.406906877, "new_balance":6275433.406906877, "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":"" } } { "feed":"account_log", "new_entry":{ "id":5796188, "date":"2022-06-22T15:09:51.862Z", "asset":"usd", "contract":"", "info":"transfer", "booking_uid":"789617ea-8ab3-4399-936e-df83b1e1c954", "margin_account":"usd", "old_balance":1098.88, "new_balance":11098.88, "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":"" } |
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 |
contract | string | The contract associated with 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 |
conversion_spread_percentage | float |
The percentage conversion spread used in a currency conversion |
Sample Return if Unsuccessful |
{ "event":"error", "message":"Invalid product id" } |
Field |
Type | Description |
event | string | Always error |
message | string |
An error message out of:
|