From 64640f449403d7097a99f09e69660d84af7575ac Mon Sep 17 00:00:00 2001 From: discountry Date: Sat, 27 Sep 2025 02:10:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=92=8C=E4=BF=AE=E6=94=B9=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?API=E6=8E=A5=E5=8F=A3=E7=9A=84=E6=8F=8F=E8=BF=B0=EF=BC=8C?= =?UTF-8?q?=E7=A1=AE=E4=BF=9D=E6=96=87=E6=A1=A3=E5=86=85=E5=AE=B9=E7=9A=84?= =?UTF-8?q?=E5=87=86=E7=A1=AE=E6=80=A7=E5=92=8C=E5=AE=8C=E6=95=B4=E6=80=A7?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E5=8D=87=E5=BC=80=E5=8F=91=E8=80=85=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E4=BD=93=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bun.lock | 133 +- docs/{ => aster}/v2-api.md | 0 docs/grvt/market_data_api.md | 3636 +++++ docs/grvt/market_data_streams.md | 4535 ++++++ docs/grvt/schemas/ack.md | 4 + docs/grvt/schemas/ack_response.md | 10 + .../schemas/aggregated_account_summary.md | 21 + ...api_aggregated_account_summary_response.md | 27 + .../schemas/api_cancel_all_orders_request.md | 18 + .../schemas/api_cancel_all_orders_response.md | 4 + .../api_cancel_on_disconnect_request.md | 7 + docs/grvt/schemas/api_cancel_order_request.md | 9 + .../grvt/schemas/api_cancel_order_response.md | 147 + docs/grvt/schemas/api_candlestick_request.md | 40 + docs/grvt/schemas/api_candlestick_response.md | 20 + .../api_category_affinity_score_request.md | 5 + .../api_category_affinity_score_response.md | 12 + .../schemas/api_create_bulk_orders_request.md | 149 + .../api_create_bulk_orders_response.md | 147 + docs/grvt/schemas/api_create_order_request.md | 160 + .../grvt/schemas/api_create_order_response.md | 158 + .../schemas/api_dedust_position_request.md | 0 .../schemas/api_dedust_position_response.md | 0 .../schemas/api_deposit_history_request.md | 11 + .../schemas/api_deposit_history_response.md | 16 + docs/grvt/schemas/api_deposit_request.md | 18 + .../schemas/api_drop_client_ws_request.md | 4 + .../schemas/api_drop_client_ws_response.md | 4 + docs/grvt/schemas/api_fill_history_request.md | 22 + .../grvt/schemas/api_fill_history_response.md | 45 + ...pi_find_ecosystem_epoch_metric_response.md | 17 + ...api_find_ecosystem_leaderboard_response.md | 11 + .../api_find_first_epoch_metric_response.md | 25 + .../api_find_trader_epoch_metric_response.md | 12 + .../api_find_trader_leaderboard_response.md | 11 + .../api_funding_account_summary_response.md | 38 + .../api_funding_payment_history_request.md | 11 + .../api_funding_payment_history_response.md | 14 + docs/grvt/schemas/api_funding_rate_request.md | 10 + .../grvt/schemas/api_funding_rate_response.md | 13 + .../api_get_all_initial_leverage_request.md | 6 + .../api_get_all_initial_leverage_response.md | 13 + .../api_get_all_instruments_request.md | 6 + .../api_get_all_instruments_response.md | 44 + docs/grvt/schemas/api_get_currency_request.md | 5 + .../grvt/schemas/api_get_currency_response.md | 13 + .../api_get_ecosystem_leaderboard_request.md | 5 + .../api_get_ecosystem_leaderboard_response.md | 25 + ...pi_get_ecosystem_referral_stat_response.md | 7 + .../api_get_filtered_instruments_request.md | 19 + .../api_get_filtered_instruments_response.md | 44 + .../schemas/api_get_instrument_request.md | 6 + .../schemas/api_get_instrument_response.md | 44 + .../api_get_latest_lp_snapshot_request.md | 45 + .../api_get_latest_lp_snapshot_response.md | 14 + .../api_get_list_epoch_badge_response.md | 54 + .../api_get_list_flat_referral_request.md | 9 + .../api_get_list_flat_referral_response.md | 20 + .../api_get_list_reward_epoch_response.md | 31 + .../grvt/schemas/api_get_lp_config_request.md | 24 + .../schemas/api_get_lp_config_response.md | 7 + docs/grvt/schemas/api_get_lp_info_request.md | 45 + docs/grvt/schemas/api_get_lp_info_response.md | 11 + .../schemas/api_get_lp_leaderboard_request.md | 47 + .../api_get_lp_leaderboard_response.md | 10 + docs/grvt/schemas/api_get_lp_point_request.md | 46 + .../grvt/schemas/api_get_lp_point_response.md | 11 + .../schemas/api_get_margin_tiers_response.md | 14 + .../schemas/api_get_order_group_request.md | 6 + .../schemas/api_get_order_group_response.md | 12 + docs/grvt/schemas/api_get_order_request.md | 8 + docs/grvt/schemas/api_get_order_response.md | 158 + .../schemas/api_get_trader_stat_response.md | 4 + .../api_get_user_ecosystem_point_request.md | 6 + .../api_get_user_ecosystem_point_response.md | 25 + ..._verified_ecosystem_leaderboard_request.md | 5 + .../api_latest_snap_sub_accounts_request.md | 6 + .../api_latest_snap_sub_accounts_response.md | 110 + ...list_aggregated_account_summary_request.md | 4 + ...ist_aggregated_account_summary_response.md | 53 + docs/grvt/schemas/api_mini_ticker_request.md | 6 + docs/grvt/schemas/api_mini_ticker_response.md | 18 + docs/grvt/schemas/api_open_orders_request.md | 16 + docs/grvt/schemas/api_open_orders_response.md | 160 + .../grvt/schemas/api_order_history_request.md | 22 + .../schemas/api_order_history_response.md | 159 + docs/grvt/schemas/api_order_state_request.md | 8 + docs/grvt/schemas/api_order_state_response.md | 55 + .../schemas/api_orderbook_levels_request.md | 7 + .../schemas/api_orderbook_levels_response.md | 23 + docs/grvt/schemas/api_positions_request.md | 18 + docs/grvt/schemas/api_positions_response.md | 22 + .../schemas/api_pre_deposit_check_request.md | 42 + .../schemas/api_pre_deposit_check_response.md | 36 + .../schemas/api_pre_order_check_request.md | 150 + .../schemas/api_pre_order_check_response.md | 49 + .../api_query_flat_referral_stat_request.md | 6 + .../api_query_flat_referral_stat_response.md | 5 + .../api_query_trading_performance_request.md | 7 + .../api_query_trading_performance_response.md | 7 + ..._vault_manager_investor_history_request.md | 7 + ...vault_manager_investor_history_response.md | 26 + ...resolve_epoch_ecosystem_metric_response.md | 6 + ...isk_to_maintenance_margin_ratio_request.md | 17 + ...sk_to_maintenance_margin_ratio_response.md | 6 + .../api_set_initial_leverage_request.md | 8 + .../api_set_initial_leverage_response.md | 6 + docs/grvt/schemas/api_settlement_price.md | 69 + .../schemas/api_settlement_price_request.md | 73 + .../schemas/api_settlement_price_response.md | 74 + .../api_socialized_loss_status_response.md | 7 + .../api_sub_account_history_request.md | 10 + .../api_sub_account_history_response.md | 53 + .../api_sub_account_summary_request.md | 4 + .../api_sub_account_summary_response.md | 54 + ...i_sub_account_trade_aggregation_request.md | 22 + ..._sub_account_trade_aggregation_response.md | 17 + .../schemas/api_sub_account_trade_request.md | 16 + .../schemas/api_sub_account_trade_response.md | 14 + docs/grvt/schemas/api_ticker_feed_data_v1.md | 33 + docs/grvt/schemas/api_ticker_request.md | 6 + docs/grvt/schemas/api_ticker_response.md | 33 + .../grvt/schemas/api_trade_history_request.md | 10 + .../schemas/api_trade_history_response.md | 29 + docs/grvt/schemas/api_trade_request.md | 7 + docs/grvt/schemas/api_trade_response.md | 28 + docs/grvt/schemas/api_transfer_ack.md | 5 + .../schemas/api_transfer_history_request.md | 12 + .../schemas/api_transfer_history_response.md | 37 + docs/grvt/schemas/api_transfer_request.md | 32 + docs/grvt/schemas/api_transfer_response.md | 11 + ...pi_user_category_affinity_score_request.md | 6 + ...i_user_category_affinity_score_response.md | 12 + .../schemas/api_vault_burn_tokens_request.md | 18 + docs/grvt/schemas/api_vault_invest_request.md | 18 + .../schemas/api_vault_investor_history.md | 20 + .../api_vault_investor_summary_request.md | 6 + .../api_vault_investor_summary_response.md | 28 + .../api_vault_redeem_cancel_request.md | 6 + docs/grvt/schemas/api_vault_redeem_request.md | 18 + ...api_vault_view_redemption_queue_request.md | 6 + ...pi_vault_view_redemption_queue_response.md | 58 + .../schemas/api_withdrawal_history_request.md | 11 + .../api_withdrawal_history_response.md | 24 + docs/grvt/schemas/api_withdrawal_request.md | 19 + docs/grvt/schemas/approximate_lp_point.md | 6 + docs/grvt/schemas/approximate_lp_snapshot.md | 10 + .../schemas/asset_margin_tier_response.md | 10 + docs/grvt/schemas/asset_max_qty.md | 6 + docs/grvt/schemas/bridge_type.md | 5 + docs/grvt/schemas/broker_tag.md | 9 + docs/grvt/schemas/cancel_status.md | 5 + docs/grvt/schemas/cancel_status_feed.md | 55 + docs/grvt/schemas/candlestick.md | 15 + docs/grvt/schemas/candlestick_interval.md | 21 + docs/grvt/schemas/candlestick_type.md | 7 + .../schemas/claim_ecosystem_badge_response.md | 54 + .../schemas/client_order_i_ds_by_group.md | 8 + docs/grvt/schemas/client_tier.md | 8 + docs/grvt/schemas/currency.md | 31 + docs/grvt/schemas/currency_detail.md | 7 + docs/grvt/schemas/deposit.md | 7 + docs/grvt/schemas/deposit_history.md | 11 + .../schemas/ecosystem_leaderboard_user.md | 7 + docs/grvt/schemas/ecosystem_metric.md | 8 + docs/grvt/schemas/ecosystem_point.md | 21 + docs/grvt/schemas/empty_request.md | 5 + docs/grvt/schemas/epoch.md | 6 + docs/grvt/schemas/epoch_badge.md | 50 + .../schemas/epoch_badge_point_distribution.md | 33 + docs/grvt/schemas/epoch_badge_type.md | 15 + docs/grvt/schemas/error.md | 7 + docs/grvt/schemas/fill.md | 40 + docs/grvt/schemas/flat_referral.md | 16 + docs/grvt/schemas/funding_account_summary.md | 23 + docs/grvt/schemas/funding_payment.md | 9 + docs/grvt/schemas/funding_rate.md | 8 + .../get_claimable_ecosystem_badge_response.md | 56 + docs/grvt/schemas/initial_leverage_result.md | 7 + docs/grvt/schemas/instrument.md | 40 + .../schemas/instrument_settlement_period.md | 8 + docs/grvt/schemas/jsonrpc_request.md | 9 + docs/grvt/schemas/jsonrpc_response.md | 17 + docs/grvt/schemas/kind.md | 9 + docs/grvt/schemas/lp_point.md | 6 + docs/grvt/schemas/lp_snapshot.md | 11 + docs/grvt/schemas/margin_tier_response.md | 5 + docs/grvt/schemas/margin_type.md | 5 + docs/grvt/schemas/mini_ticker.md | 14 + docs/grvt/schemas/order.md | 154 + docs/grvt/schemas/order_leg.md | 7 + docs/grvt/schemas/order_metadata.md | 51 + docs/grvt/schemas/order_reject_reason.md | 41 + docs/grvt/schemas/order_state.md | 58 + docs/grvt/schemas/order_state_feed.md | 64 + docs/grvt/schemas/order_status.md | 8 + docs/grvt/schemas/orderbook_level.md | 6 + docs/grvt/schemas/orderbook_levels.md | 19 + docs/grvt/schemas/positions.md | 18 + docs/grvt/schemas/pre_min_redemptions.md | 27 + docs/grvt/schemas/pre_order_check_result.md | 45 + ..._epoch_badge_point_distribution_request.md | 13 + ...epoch_badge_point_distribution_response.md | 37 + .../grvt/schemas/query_epoch_badge_request.md | 16 + .../schemas/query_epoch_badge_response.md | 55 + docs/grvt/schemas/query_find_epoch_request.md | 7 + .../grvt/schemas/query_find_epoch_response.md | 10 + .../query_get_latest_lp_snapshot_response.md | 15 + .../schemas/query_get_list_epoch_request.md | 4 + .../schemas/query_get_list_epoch_response.md | 10 + docs/grvt/schemas/reward_epoch_info.md | 13 + docs/grvt/schemas/reward_epoch_status.md | 6 + docs/grvt/schemas/reward_program_type.md | 6 + docs/grvt/schemas/session_information.md | 8 + docs/grvt/schemas/signature.md | 9 + .../schemas/snap_funding_account_summary.md | 47 + docs/grvt/schemas/spot_balance.md | 6 + docs/grvt/schemas/stream_reference.md | 5 + docs/grvt/schemas/sub_account.md | 48 + docs/grvt/schemas/sub_account_trade.md | 10 + .../schemas/sub_account_trade_aggregation.md | 12 + .../schemas/sub_account_trade_interval.md | 7 + docs/grvt/schemas/ticker.md | 29 + docs/grvt/schemas/time_in_force.md | 14 + docs/grvt/schemas/time_interval.md | 9 + docs/grvt/schemas/tpsl_order_metadata.md | 18 + docs/grvt/schemas/trade.md | 24 + docs/grvt/schemas/trader_leaderboard_user.md | 7 + docs/grvt/schemas/trader_metric.md | 5 + docs/grvt/schemas/transfer.md | 46 + docs/grvt/schemas/transfer_history.md | 32 + docs/grvt/schemas/transfer_type.md | 9 + docs/grvt/schemas/trigger_by.md | 10 + docs/grvt/schemas/trigger_order_metadata.md | 33 + docs/grvt/schemas/trigger_type.md | 8 + .../schemas/user_category_affinity_score.md | 8 + docs/grvt/schemas/user_tracking_event.md | 21 + .../user_vault_category_event_pay_load.md | 7 + docs/grvt/schemas/vault_investment.md | 8 + docs/grvt/schemas/vault_investor_action.md | 7 + docs/grvt/schemas/vault_investor_summary.md | 22 + docs/grvt/schemas/vault_redemption.md | 9 + .../vault_redemption_req_age_category.md | 9 + .../grvt/schemas/vault_redemption_req_view.md | 19 + docs/grvt/schemas/vault_redemption_request.md | 20 + docs/grvt/schemas/vault_type.md | 5 + docs/grvt/schemas/venue.md | 7 + docs/grvt/schemas/withdrawal.md | 17 + docs/grvt/schemas/withdrawal_history.md | 19 + docs/grvt/schemas/ws_cancel_feed_data_v1.md | 62 + .../schemas/ws_cancel_feed_selector_v1.md | 6 + .../schemas/ws_candlestick_feed_data_v1.md | 22 + .../ws_candlestick_feed_selector_v1.md | 36 + docs/grvt/schemas/ws_deposit_feed_data_v1.md | 16 + .../schemas/ws_deposit_feed_selector_v1.md | 6 + docs/grvt/schemas/ws_fill_feed_data_v1.md | 47 + docs/grvt/schemas/ws_fill_feed_selector_v1.md | 7 + docs/grvt/schemas/ws_list_streams_params.md | 5 + docs/grvt/schemas/ws_list_streams_result.md | 11 + .../schemas/ws_mini_ticker_feed_data_v1.md | 21 + .../ws_mini_ticker_feed_selector_v1.md | 7 + docs/grvt/schemas/ws_order_feed_data_v1.md | 161 + .../grvt/schemas/ws_order_feed_selector_v1.md | 7 + .../schemas/ws_order_group_feed_data_v1.md | 15 + .../ws_order_group_feed_selector_v1.md | 6 + .../schemas/ws_order_state_feed_data_v1.md | 71 + .../ws_order_state_feed_selector_v1.md | 7 + .../ws_orderbook_levels_feed_data_v1.md | 26 + .../ws_orderbook_levels_feed_selector_v1.md | 8 + .../grvt/schemas/ws_positions_feed_data_v1.md | 25 + .../schemas/ws_positions_feed_selector_v1.md | 7 + docs/grvt/schemas/ws_request_v1.md | 10 + docs/grvt/schemas/ws_response_v1.md | 11 + docs/grvt/schemas/ws_subscribe_params.md | 7 + .../schemas/ws_subscribe_request_v1_legacy.md | 10 + .../ws_subscribe_response_v1_legacy.md | 11 + docs/grvt/schemas/ws_subscribe_result.md | 10 + docs/grvt/schemas/ws_ticker_feed_data_v1.md | 36 + .../schemas/ws_ticker_feed_selector_v1.md | 7 + docs/grvt/schemas/ws_trade_feed_data_v1.md | 31 + .../grvt/schemas/ws_trade_feed_selector_v1.md | 7 + docs/grvt/schemas/ws_transfer_feed_data_v1.md | 41 + .../schemas/ws_transfer_feed_selector_v1.md | 7 + .../grvt/schemas/ws_unsubscribe_all_params.md | 5 + .../grvt/schemas/ws_unsubscribe_all_result.md | 11 + docs/grvt/schemas/ws_unsubscribe_params.md | 7 + docs/grvt/schemas/ws_unsubscribe_result.md | 7 + .../schemas/ws_withdrawal_feed_data_v1.md | 26 + .../schemas/ws_withdrawal_feed_selector_v1.md | 6 + docs/grvt/sdk-readme.md | 231 + docs/grvt/trading_api.md | 12674 ++++++++++++++++ docs/grvt/trading_streams.md | 4952 ++++++ package.json | 2 + src/exchanges/grvt/README.md | 2 + src/exchanges/grvt/client.ts | 28 + src/exchanges/grvt/gateway.ts | 269 + src/exchanges/types.ts | 151 + 297 files changed, 33451 insertions(+), 5 deletions(-) rename docs/{ => aster}/v2-api.md (100%) create mode 100644 docs/grvt/market_data_api.md create mode 100644 docs/grvt/market_data_streams.md create mode 100644 docs/grvt/schemas/ack.md create mode 100644 docs/grvt/schemas/ack_response.md create mode 100644 docs/grvt/schemas/aggregated_account_summary.md create mode 100644 docs/grvt/schemas/api_aggregated_account_summary_response.md create mode 100644 docs/grvt/schemas/api_cancel_all_orders_request.md create mode 100644 docs/grvt/schemas/api_cancel_all_orders_response.md create mode 100644 docs/grvt/schemas/api_cancel_on_disconnect_request.md create mode 100644 docs/grvt/schemas/api_cancel_order_request.md create mode 100644 docs/grvt/schemas/api_cancel_order_response.md create mode 100644 docs/grvt/schemas/api_candlestick_request.md create mode 100644 docs/grvt/schemas/api_candlestick_response.md create mode 100644 docs/grvt/schemas/api_category_affinity_score_request.md create mode 100644 docs/grvt/schemas/api_category_affinity_score_response.md create mode 100644 docs/grvt/schemas/api_create_bulk_orders_request.md create mode 100644 docs/grvt/schemas/api_create_bulk_orders_response.md create mode 100644 docs/grvt/schemas/api_create_order_request.md create mode 100644 docs/grvt/schemas/api_create_order_response.md create mode 100644 docs/grvt/schemas/api_dedust_position_request.md create mode 100644 docs/grvt/schemas/api_dedust_position_response.md create mode 100644 docs/grvt/schemas/api_deposit_history_request.md create mode 100644 docs/grvt/schemas/api_deposit_history_response.md create mode 100644 docs/grvt/schemas/api_deposit_request.md create mode 100644 docs/grvt/schemas/api_drop_client_ws_request.md create mode 100644 docs/grvt/schemas/api_drop_client_ws_response.md create mode 100644 docs/grvt/schemas/api_fill_history_request.md create mode 100644 docs/grvt/schemas/api_fill_history_response.md create mode 100644 docs/grvt/schemas/api_find_ecosystem_epoch_metric_response.md create mode 100644 docs/grvt/schemas/api_find_ecosystem_leaderboard_response.md create mode 100644 docs/grvt/schemas/api_find_first_epoch_metric_response.md create mode 100644 docs/grvt/schemas/api_find_trader_epoch_metric_response.md create mode 100644 docs/grvt/schemas/api_find_trader_leaderboard_response.md create mode 100644 docs/grvt/schemas/api_funding_account_summary_response.md create mode 100644 docs/grvt/schemas/api_funding_payment_history_request.md create mode 100644 docs/grvt/schemas/api_funding_payment_history_response.md create mode 100644 docs/grvt/schemas/api_funding_rate_request.md create mode 100644 docs/grvt/schemas/api_funding_rate_response.md create mode 100644 docs/grvt/schemas/api_get_all_initial_leverage_request.md create mode 100644 docs/grvt/schemas/api_get_all_initial_leverage_response.md create mode 100644 docs/grvt/schemas/api_get_all_instruments_request.md create mode 100644 docs/grvt/schemas/api_get_all_instruments_response.md create mode 100644 docs/grvt/schemas/api_get_currency_request.md create mode 100644 docs/grvt/schemas/api_get_currency_response.md create mode 100644 docs/grvt/schemas/api_get_ecosystem_leaderboard_request.md create mode 100644 docs/grvt/schemas/api_get_ecosystem_leaderboard_response.md create mode 100644 docs/grvt/schemas/api_get_ecosystem_referral_stat_response.md create mode 100644 docs/grvt/schemas/api_get_filtered_instruments_request.md create mode 100644 docs/grvt/schemas/api_get_filtered_instruments_response.md create mode 100644 docs/grvt/schemas/api_get_instrument_request.md create mode 100644 docs/grvt/schemas/api_get_instrument_response.md create mode 100644 docs/grvt/schemas/api_get_latest_lp_snapshot_request.md create mode 100644 docs/grvt/schemas/api_get_latest_lp_snapshot_response.md create mode 100644 docs/grvt/schemas/api_get_list_epoch_badge_response.md create mode 100644 docs/grvt/schemas/api_get_list_flat_referral_request.md create mode 100644 docs/grvt/schemas/api_get_list_flat_referral_response.md create mode 100644 docs/grvt/schemas/api_get_list_reward_epoch_response.md create mode 100644 docs/grvt/schemas/api_get_lp_config_request.md create mode 100644 docs/grvt/schemas/api_get_lp_config_response.md create mode 100644 docs/grvt/schemas/api_get_lp_info_request.md create mode 100644 docs/grvt/schemas/api_get_lp_info_response.md create mode 100644 docs/grvt/schemas/api_get_lp_leaderboard_request.md create mode 100644 docs/grvt/schemas/api_get_lp_leaderboard_response.md create mode 100644 docs/grvt/schemas/api_get_lp_point_request.md create mode 100644 docs/grvt/schemas/api_get_lp_point_response.md create mode 100644 docs/grvt/schemas/api_get_margin_tiers_response.md create mode 100644 docs/grvt/schemas/api_get_order_group_request.md create mode 100644 docs/grvt/schemas/api_get_order_group_response.md create mode 100644 docs/grvt/schemas/api_get_order_request.md create mode 100644 docs/grvt/schemas/api_get_order_response.md create mode 100644 docs/grvt/schemas/api_get_trader_stat_response.md create mode 100644 docs/grvt/schemas/api_get_user_ecosystem_point_request.md create mode 100644 docs/grvt/schemas/api_get_user_ecosystem_point_response.md create mode 100644 docs/grvt/schemas/api_get_verified_ecosystem_leaderboard_request.md create mode 100644 docs/grvt/schemas/api_latest_snap_sub_accounts_request.md create mode 100644 docs/grvt/schemas/api_latest_snap_sub_accounts_response.md create mode 100644 docs/grvt/schemas/api_list_aggregated_account_summary_request.md create mode 100644 docs/grvt/schemas/api_list_aggregated_account_summary_response.md create mode 100644 docs/grvt/schemas/api_mini_ticker_request.md create mode 100644 docs/grvt/schemas/api_mini_ticker_response.md create mode 100644 docs/grvt/schemas/api_open_orders_request.md create mode 100644 docs/grvt/schemas/api_open_orders_response.md create mode 100644 docs/grvt/schemas/api_order_history_request.md create mode 100644 docs/grvt/schemas/api_order_history_response.md create mode 100644 docs/grvt/schemas/api_order_state_request.md create mode 100644 docs/grvt/schemas/api_order_state_response.md create mode 100644 docs/grvt/schemas/api_orderbook_levels_request.md create mode 100644 docs/grvt/schemas/api_orderbook_levels_response.md create mode 100644 docs/grvt/schemas/api_positions_request.md create mode 100644 docs/grvt/schemas/api_positions_response.md create mode 100644 docs/grvt/schemas/api_pre_deposit_check_request.md create mode 100644 docs/grvt/schemas/api_pre_deposit_check_response.md create mode 100644 docs/grvt/schemas/api_pre_order_check_request.md create mode 100644 docs/grvt/schemas/api_pre_order_check_response.md create mode 100644 docs/grvt/schemas/api_query_flat_referral_stat_request.md create mode 100644 docs/grvt/schemas/api_query_flat_referral_stat_response.md create mode 100644 docs/grvt/schemas/api_query_trading_performance_request.md create mode 100644 docs/grvt/schemas/api_query_trading_performance_response.md create mode 100644 docs/grvt/schemas/api_query_vault_manager_investor_history_request.md create mode 100644 docs/grvt/schemas/api_query_vault_manager_investor_history_response.md create mode 100644 docs/grvt/schemas/api_resolve_epoch_ecosystem_metric_response.md create mode 100644 docs/grvt/schemas/api_set_derisk_to_maintenance_margin_ratio_request.md create mode 100644 docs/grvt/schemas/api_set_derisk_to_maintenance_margin_ratio_response.md create mode 100644 docs/grvt/schemas/api_set_initial_leverage_request.md create mode 100644 docs/grvt/schemas/api_set_initial_leverage_response.md create mode 100644 docs/grvt/schemas/api_settlement_price.md create mode 100644 docs/grvt/schemas/api_settlement_price_request.md create mode 100644 docs/grvt/schemas/api_settlement_price_response.md create mode 100644 docs/grvt/schemas/api_socialized_loss_status_response.md create mode 100644 docs/grvt/schemas/api_sub_account_history_request.md create mode 100644 docs/grvt/schemas/api_sub_account_history_response.md create mode 100644 docs/grvt/schemas/api_sub_account_summary_request.md create mode 100644 docs/grvt/schemas/api_sub_account_summary_response.md create mode 100644 docs/grvt/schemas/api_sub_account_trade_aggregation_request.md create mode 100644 docs/grvt/schemas/api_sub_account_trade_aggregation_response.md create mode 100644 docs/grvt/schemas/api_sub_account_trade_request.md create mode 100644 docs/grvt/schemas/api_sub_account_trade_response.md create mode 100644 docs/grvt/schemas/api_ticker_feed_data_v1.md create mode 100644 docs/grvt/schemas/api_ticker_request.md create mode 100644 docs/grvt/schemas/api_ticker_response.md create mode 100644 docs/grvt/schemas/api_trade_history_request.md create mode 100644 docs/grvt/schemas/api_trade_history_response.md create mode 100644 docs/grvt/schemas/api_trade_request.md create mode 100644 docs/grvt/schemas/api_trade_response.md create mode 100644 docs/grvt/schemas/api_transfer_ack.md create mode 100644 docs/grvt/schemas/api_transfer_history_request.md create mode 100644 docs/grvt/schemas/api_transfer_history_response.md create mode 100644 docs/grvt/schemas/api_transfer_request.md create mode 100644 docs/grvt/schemas/api_transfer_response.md create mode 100644 docs/grvt/schemas/api_user_category_affinity_score_request.md create mode 100644 docs/grvt/schemas/api_user_category_affinity_score_response.md create mode 100644 docs/grvt/schemas/api_vault_burn_tokens_request.md create mode 100644 docs/grvt/schemas/api_vault_invest_request.md create mode 100644 docs/grvt/schemas/api_vault_investor_history.md create mode 100644 docs/grvt/schemas/api_vault_investor_summary_request.md create mode 100644 docs/grvt/schemas/api_vault_investor_summary_response.md create mode 100644 docs/grvt/schemas/api_vault_redeem_cancel_request.md create mode 100644 docs/grvt/schemas/api_vault_redeem_request.md create mode 100644 docs/grvt/schemas/api_vault_view_redemption_queue_request.md create mode 100644 docs/grvt/schemas/api_vault_view_redemption_queue_response.md create mode 100644 docs/grvt/schemas/api_withdrawal_history_request.md create mode 100644 docs/grvt/schemas/api_withdrawal_history_response.md create mode 100644 docs/grvt/schemas/api_withdrawal_request.md create mode 100644 docs/grvt/schemas/approximate_lp_point.md create mode 100644 docs/grvt/schemas/approximate_lp_snapshot.md create mode 100644 docs/grvt/schemas/asset_margin_tier_response.md create mode 100644 docs/grvt/schemas/asset_max_qty.md create mode 100644 docs/grvt/schemas/bridge_type.md create mode 100644 docs/grvt/schemas/broker_tag.md create mode 100644 docs/grvt/schemas/cancel_status.md create mode 100644 docs/grvt/schemas/cancel_status_feed.md create mode 100644 docs/grvt/schemas/candlestick.md create mode 100644 docs/grvt/schemas/candlestick_interval.md create mode 100644 docs/grvt/schemas/candlestick_type.md create mode 100644 docs/grvt/schemas/claim_ecosystem_badge_response.md create mode 100644 docs/grvt/schemas/client_order_i_ds_by_group.md create mode 100644 docs/grvt/schemas/client_tier.md create mode 100644 docs/grvt/schemas/currency.md create mode 100644 docs/grvt/schemas/currency_detail.md create mode 100644 docs/grvt/schemas/deposit.md create mode 100644 docs/grvt/schemas/deposit_history.md create mode 100644 docs/grvt/schemas/ecosystem_leaderboard_user.md create mode 100644 docs/grvt/schemas/ecosystem_metric.md create mode 100644 docs/grvt/schemas/ecosystem_point.md create mode 100644 docs/grvt/schemas/empty_request.md create mode 100644 docs/grvt/schemas/epoch.md create mode 100644 docs/grvt/schemas/epoch_badge.md create mode 100644 docs/grvt/schemas/epoch_badge_point_distribution.md create mode 100644 docs/grvt/schemas/epoch_badge_type.md create mode 100644 docs/grvt/schemas/error.md create mode 100644 docs/grvt/schemas/fill.md create mode 100644 docs/grvt/schemas/flat_referral.md create mode 100644 docs/grvt/schemas/funding_account_summary.md create mode 100644 docs/grvt/schemas/funding_payment.md create mode 100644 docs/grvt/schemas/funding_rate.md create mode 100644 docs/grvt/schemas/get_claimable_ecosystem_badge_response.md create mode 100644 docs/grvt/schemas/initial_leverage_result.md create mode 100644 docs/grvt/schemas/instrument.md create mode 100644 docs/grvt/schemas/instrument_settlement_period.md create mode 100644 docs/grvt/schemas/jsonrpc_request.md create mode 100644 docs/grvt/schemas/jsonrpc_response.md create mode 100644 docs/grvt/schemas/kind.md create mode 100644 docs/grvt/schemas/lp_point.md create mode 100644 docs/grvt/schemas/lp_snapshot.md create mode 100644 docs/grvt/schemas/margin_tier_response.md create mode 100644 docs/grvt/schemas/margin_type.md create mode 100644 docs/grvt/schemas/mini_ticker.md create mode 100644 docs/grvt/schemas/order.md create mode 100644 docs/grvt/schemas/order_leg.md create mode 100644 docs/grvt/schemas/order_metadata.md create mode 100644 docs/grvt/schemas/order_reject_reason.md create mode 100644 docs/grvt/schemas/order_state.md create mode 100644 docs/grvt/schemas/order_state_feed.md create mode 100644 docs/grvt/schemas/order_status.md create mode 100644 docs/grvt/schemas/orderbook_level.md create mode 100644 docs/grvt/schemas/orderbook_levels.md create mode 100644 docs/grvt/schemas/positions.md create mode 100644 docs/grvt/schemas/pre_min_redemptions.md create mode 100644 docs/grvt/schemas/pre_order_check_result.md create mode 100644 docs/grvt/schemas/query_epoch_badge_point_distribution_request.md create mode 100644 docs/grvt/schemas/query_epoch_badge_point_distribution_response.md create mode 100644 docs/grvt/schemas/query_epoch_badge_request.md create mode 100644 docs/grvt/schemas/query_epoch_badge_response.md create mode 100644 docs/grvt/schemas/query_find_epoch_request.md create mode 100644 docs/grvt/schemas/query_find_epoch_response.md create mode 100644 docs/grvt/schemas/query_get_latest_lp_snapshot_response.md create mode 100644 docs/grvt/schemas/query_get_list_epoch_request.md create mode 100644 docs/grvt/schemas/query_get_list_epoch_response.md create mode 100644 docs/grvt/schemas/reward_epoch_info.md create mode 100644 docs/grvt/schemas/reward_epoch_status.md create mode 100644 docs/grvt/schemas/reward_program_type.md create mode 100644 docs/grvt/schemas/session_information.md create mode 100644 docs/grvt/schemas/signature.md create mode 100644 docs/grvt/schemas/snap_funding_account_summary.md create mode 100644 docs/grvt/schemas/spot_balance.md create mode 100644 docs/grvt/schemas/stream_reference.md create mode 100644 docs/grvt/schemas/sub_account.md create mode 100644 docs/grvt/schemas/sub_account_trade.md create mode 100644 docs/grvt/schemas/sub_account_trade_aggregation.md create mode 100644 docs/grvt/schemas/sub_account_trade_interval.md create mode 100644 docs/grvt/schemas/ticker.md create mode 100644 docs/grvt/schemas/time_in_force.md create mode 100644 docs/grvt/schemas/time_interval.md create mode 100644 docs/grvt/schemas/tpsl_order_metadata.md create mode 100644 docs/grvt/schemas/trade.md create mode 100644 docs/grvt/schemas/trader_leaderboard_user.md create mode 100644 docs/grvt/schemas/trader_metric.md create mode 100644 docs/grvt/schemas/transfer.md create mode 100644 docs/grvt/schemas/transfer_history.md create mode 100644 docs/grvt/schemas/transfer_type.md create mode 100644 docs/grvt/schemas/trigger_by.md create mode 100644 docs/grvt/schemas/trigger_order_metadata.md create mode 100644 docs/grvt/schemas/trigger_type.md create mode 100644 docs/grvt/schemas/user_category_affinity_score.md create mode 100644 docs/grvt/schemas/user_tracking_event.md create mode 100644 docs/grvt/schemas/user_vault_category_event_pay_load.md create mode 100644 docs/grvt/schemas/vault_investment.md create mode 100644 docs/grvt/schemas/vault_investor_action.md create mode 100644 docs/grvt/schemas/vault_investor_summary.md create mode 100644 docs/grvt/schemas/vault_redemption.md create mode 100644 docs/grvt/schemas/vault_redemption_req_age_category.md create mode 100644 docs/grvt/schemas/vault_redemption_req_view.md create mode 100644 docs/grvt/schemas/vault_redemption_request.md create mode 100644 docs/grvt/schemas/vault_type.md create mode 100644 docs/grvt/schemas/venue.md create mode 100644 docs/grvt/schemas/withdrawal.md create mode 100644 docs/grvt/schemas/withdrawal_history.md create mode 100644 docs/grvt/schemas/ws_cancel_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_cancel_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_candlestick_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_candlestick_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_deposit_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_deposit_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_fill_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_fill_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_list_streams_params.md create mode 100644 docs/grvt/schemas/ws_list_streams_result.md create mode 100644 docs/grvt/schemas/ws_mini_ticker_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_mini_ticker_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_order_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_order_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_order_group_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_order_group_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_order_state_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_order_state_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_orderbook_levels_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_orderbook_levels_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_positions_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_positions_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_request_v1.md create mode 100644 docs/grvt/schemas/ws_response_v1.md create mode 100644 docs/grvt/schemas/ws_subscribe_params.md create mode 100644 docs/grvt/schemas/ws_subscribe_request_v1_legacy.md create mode 100644 docs/grvt/schemas/ws_subscribe_response_v1_legacy.md create mode 100644 docs/grvt/schemas/ws_subscribe_result.md create mode 100644 docs/grvt/schemas/ws_ticker_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_ticker_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_trade_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_trade_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_transfer_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_transfer_feed_selector_v1.md create mode 100644 docs/grvt/schemas/ws_unsubscribe_all_params.md create mode 100644 docs/grvt/schemas/ws_unsubscribe_all_result.md create mode 100644 docs/grvt/schemas/ws_unsubscribe_params.md create mode 100644 docs/grvt/schemas/ws_unsubscribe_result.md create mode 100644 docs/grvt/schemas/ws_withdrawal_feed_data_v1.md create mode 100644 docs/grvt/schemas/ws_withdrawal_feed_selector_v1.md create mode 100644 docs/grvt/sdk-readme.md create mode 100644 docs/grvt/trading_api.md create mode 100644 docs/grvt/trading_streams.md create mode 100644 src/exchanges/grvt/README.md create mode 100644 src/exchanges/grvt/client.ts create mode 100644 src/exchanges/grvt/gateway.ts diff --git a/bun.lock b/bun.lock index 084e18a..1f8e600 100644 --- a/bun.lock +++ b/bun.lock @@ -4,10 +4,11 @@ "": { "name": "ritmex-bot", "dependencies": { + "@grvt/sdk": "^0.0.1-beta.17", + "axios": "^1.12.2", "ccxt": "^4.5.5", "dotenv": "^17.2.2", "ink": "^6.3.1", - "ink-table": "^3.1.0", "react": "^19.1.1", "ws": "^8.18.3", }, @@ -21,6 +22,8 @@ }, }, "packages": { + "@adraffy/ens-normalize": ["@adraffy/ens-normalize@1.10.1", "", {}, "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw=="], + "@alcalzone/ansi-tokenize": ["@alcalzone/ansi-tokenize@0.2.0", "", { "dependencies": { "ansi-styles": "^6.2.1", "is-fullwidth-code-point": "^5.0.0" } }, "sha512-qI/5TaaaCZE4yeSZ83lu0+xi1r88JSxUjnH4OP/iZF7+KKZ75u3ee5isd0LxX+6N8U0npL61YrpbthILHB6BnA=="], "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.10", "", { "os": "aix", "cpu": "ppc64" }, "sha512-0NFWnA+7l41irNuaSVlLfgNT12caWJVLzp5eAVhZ0z1qpxbockccEt3s+149rE64VUI3Ml2zt8Nv5JVc4QXTsw=="], @@ -75,8 +78,32 @@ "@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.10", "", { "os": "win32", "cpu": "x64" }, "sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw=="], + "@ethereumjs/common": ["@ethereumjs/common@3.2.0", "", { "dependencies": { "@ethereumjs/util": "^8.1.0", "crc-32": "^1.2.0" } }, "sha512-pksvzI0VyLgmuEF2FA/JR/4/y6hcPq8OUail3/AvycBaW1d5VSauOZzqGvJ3RTmR4MU35lWE8KseKOsEhrFRBA=="], + + "@ethereumjs/rlp": ["@ethereumjs/rlp@4.0.1", "", { "bin": { "rlp": "bin/rlp" } }, "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw=="], + + "@ethereumjs/tx": ["@ethereumjs/tx@4.2.0", "", { "dependencies": { "@ethereumjs/common": "^3.2.0", "@ethereumjs/rlp": "^4.0.1", "@ethereumjs/util": "^8.1.0", "ethereum-cryptography": "^2.0.0" } }, "sha512-1nc6VO4jtFd172BbSnTnDQVr9IYBFl1y4xPzZdtkrkKIncBCkdbgfdRV+MiTkJYAtTxvV12GRZLqBFT1PNK6Yw=="], + + "@ethereumjs/util": ["@ethereumjs/util@8.1.0", "", { "dependencies": { "@ethereumjs/rlp": "^4.0.1", "ethereum-cryptography": "^2.0.0", "micro-ftch": "^0.3.1" } }, "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA=="], + + "@grvt/client": ["@grvt/client@1.6.4", "", { "dependencies": { "axios": "^1.12.2" } }, "sha512-yZfEvsC/BtkcdMjoB7Eh6gshBraz/9810qCllvNXDx6OmdxR+NfxPO+ucNlPbyjEt1HfSVzHBWB1yGnVl1usNA=="], + + "@grvt/sdk": ["@grvt/sdk@0.0.1-beta.17", "", { "dependencies": { "@grvt/client": "^1.4.21", "@metamask/eth-sig-util": "^8.2.0", "@types/ws": "^8.18.1", "ethers": "^6.13.5", "set-cookie-parser": "^2.7.1", "ws": "^8.18.1" } }, "sha512-ADWGg7mM79xOu354DaYNZY3hyAEGEFC076vEK1dXFL6ykITyluKOPj2eetP3mkLeyLUyYvA7ct1pz6JmLC77Hw=="], + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="], + "@metamask/abi-utils": ["@metamask/abi-utils@3.0.0", "", { "dependencies": { "@metamask/superstruct": "^3.1.0", "@metamask/utils": "^11.0.1" } }, "sha512-a/l0DiSIr7+CBYVpHygUa3ztSlYLFCQMsklLna+t6qmNY9+eIO5TedNxhyIyvaJ+4cN7TLy0NQFbp9FV3X2ktg=="], + + "@metamask/eth-sig-util": ["@metamask/eth-sig-util@8.2.0", "", { "dependencies": { "@ethereumjs/rlp": "^4.0.1", "@ethereumjs/util": "^8.1.0", "@metamask/abi-utils": "^3.0.0", "@metamask/utils": "^11.0.1", "@scure/base": "~1.1.3", "ethereum-cryptography": "^2.1.2", "tweetnacl": "^1.0.3" } }, "sha512-LZDglIh4gYGw9Myp+2aIwKrj6lIJpMC4e0m7wKJU+BxLLBFcrTgKrjdjstXGVWvuYG3kutlh9J+uNBRPJqffWQ=="], + + "@metamask/superstruct": ["@metamask/superstruct@3.2.1", "", {}, "sha512-fLgJnDOXFmuVlB38rUN5SmU7hAFQcCjrg3Vrxz67KTY7YHFnSNEKvX4avmEBdOI0yTCxZjwMCFEqsC8k2+Wd3g=="], + + "@metamask/utils": ["@metamask/utils@11.8.1", "", { "dependencies": { "@ethereumjs/tx": "^4.2.0", "@metamask/superstruct": "^3.1.0", "@noble/hashes": "^1.3.1", "@scure/base": "^1.1.3", "@types/debug": "^4.1.7", "@types/lodash": "^4.17.20", "debug": "^4.3.4", "lodash": "^4.17.21", "pony-cause": "^2.1.10", "semver": "^7.5.4", "uuid": "^9.0.1" } }, "sha512-DIbsNUyqWLFgqJlZxi1OOCMYvI23GqFCvNJAtzv8/WXWzJfnJnvp1M24j7VvUe3URBi3S86UgQ7+7aWU9p/cnQ=="], + + "@noble/curves": ["@noble/curves@1.2.0", "", { "dependencies": { "@noble/hashes": "1.3.2" } }, "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw=="], + + "@noble/hashes": ["@noble/hashes@1.3.2", "", {}, "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ=="], + "@rollup/rollup-android-arm-eabi": ["@rollup/rollup-android-arm-eabi@4.52.0", "", { "os": "android", "cpu": "arm" }, "sha512-VxDYCDqOaR7NXzAtvRx7G1u54d2kEHopb28YH/pKzY6y0qmogP3gG7CSiWsq9WvDFxOQMpNEyjVAHZFXfH3o/A=="], "@rollup/rollup-android-arm64": ["@rollup/rollup-android-arm64@4.52.0", "", { "os": "android", "cpu": "arm64" }, "sha512-pqDirm8koABIKvzL59YI9W9DWbRlTX7RWhN+auR8HXJxo89m4mjqbah7nJZjeKNTNYopqL+yGg+0mhCpf3xZtQ=="], @@ -121,18 +148,32 @@ "@rollup/rollup-win32-x64-msvc": ["@rollup/rollup-win32-x64-msvc@4.52.0", "", { "os": "win32", "cpu": "x64" }, "sha512-6iKDCVSIUQ8jPMoIV0OytRKniaYyy5EbY/RRydmLW8ZR3cEBhxbWl5ro0rkUNe0ef6sScvhbY79HrjRm8i3vDQ=="], + "@scure/base": ["@scure/base@1.1.9", "", {}, "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg=="], + + "@scure/bip32": ["@scure/bip32@1.4.0", "", { "dependencies": { "@noble/curves": "~1.4.0", "@noble/hashes": "~1.4.0", "@scure/base": "~1.1.6" } }, "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg=="], + + "@scure/bip39": ["@scure/bip39@1.3.0", "", { "dependencies": { "@noble/hashes": "~1.4.0", "@scure/base": "~1.1.6" } }, "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ=="], + "@types/bun": ["@types/bun@1.2.22", "", { "dependencies": { "bun-types": "1.2.22" } }, "sha512-5A/KrKos2ZcN0c6ljRSOa1fYIyCKhZfIVYeuyb4snnvomnpFqC0tTsEkdqNxbAgExV384OETQ//WAjl3XbYqQA=="], "@types/chai": ["@types/chai@5.2.2", "", { "dependencies": { "@types/deep-eql": "*" } }, "sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg=="], + "@types/debug": ["@types/debug@4.1.12", "", { "dependencies": { "@types/ms": "*" } }, "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ=="], + "@types/deep-eql": ["@types/deep-eql@4.0.2", "", {}, "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw=="], "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], + "@types/lodash": ["@types/lodash@4.17.20", "", {}, "sha512-H3MHACvFUEiujabxhaI/ImO6gUrd8oOurg7LQtS7mbwIXA/cUqWrvBsaeJ23aZEPk1TAYkurjfMbSELfoCXlGA=="], + + "@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="], + "@types/node": ["@types/node@24.5.2", "", { "dependencies": { "undici-types": "~7.12.0" } }, "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ=="], "@types/react": ["@types/react@19.1.13", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-hHkbU/eoO3EG5/MZkuFSKmYqPbSVk5byPFa3e7y/8TybHiLMACgI8seVYlicwk7H5K/rI2px9xrQp/C+AUDTiQ=="], + "@types/ws": ["@types/ws@8.18.1", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="], + "@vitest/expect": ["@vitest/expect@3.2.4", "", { "dependencies": { "@types/chai": "^5.2.2", "@vitest/spy": "3.2.4", "@vitest/utils": "3.2.4", "chai": "^5.2.0", "tinyrainbow": "^2.0.0" } }, "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig=="], "@vitest/mocker": ["@vitest/mocker@3.2.4", "", { "dependencies": { "@vitest/spy": "3.2.4", "estree-walker": "^3.0.3", "magic-string": "^0.30.17" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" }, "optionalPeers": ["msw", "vite"] }, "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ=="], @@ -147,6 +188,8 @@ "@vitest/utils": ["@vitest/utils@3.2.4", "", { "dependencies": { "@vitest/pretty-format": "3.2.4", "loupe": "^3.1.4", "tinyrainbow": "^2.0.0" } }, "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA=="], + "aes-js": ["aes-js@4.0.0-beta.5", "", {}, "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q=="], + "ansi-escapes": ["ansi-escapes@7.1.0", "", { "dependencies": { "environment": "^1.0.0" } }, "sha512-YdhtCd19sKRKfAAUsrcC1wzm4JuzJoiX4pOJqIoW2qmKj5WzG/dL8uUJ0361zaXtHqK7gEhOwtAtz7t3Yq3X5g=="], "ansi-regex": ["ansi-regex@6.2.2", "", {}, "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg=="], @@ -155,12 +198,18 @@ "assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="], + "asynckit": ["asynckit@0.4.0", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="], + "auto-bind": ["auto-bind@5.0.1", "", {}, "sha512-ooviqdwwgfIfNmDwo94wlshcdzfO64XV0Cg6oDsDYBJfITDz1EngD2z7DkbvCWn+XIMsIqW27sEVF6qcpJrRcg=="], + "axios": ["axios@1.12.2", "", { "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.4", "proxy-from-env": "^1.1.0" } }, "sha512-vMJzPewAlRyOgxV2dU0Cuz2O8zzzx9VYtbJOaBgXFeLc4IV/Eg50n4LowmehOOR61S8ZMpc2K5Sa7g6A4jfkUw=="], + "bun-types": ["bun-types@1.2.22", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-hwaAu8tct/Zn6Zft4U9BsZcXkYomzpHJX28ofvx7k0Zz2HNz54n1n+tDgxoWFGB4PcFvJXJQloPhaV2eP3Q6EA=="], "cac": ["cac@6.7.14", "", {}, "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ=="], + "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="], + "ccxt": ["ccxt@4.5.5", "", { "dependencies": { "ws": "^8.8.1" } }, "sha512-AyhwTFLkx4sO985ImIOfumEBox7AHD/iqk5tPGICObUSZG6wTXg0aRzU8Hjz974aCMG4msFwLk3A/iXPKAU4wA=="], "chai": ["chai@5.3.3", "", { "dependencies": { "assertion-error": "^2.0.1", "check-error": "^2.1.1", "deep-eql": "^5.0.1", "loupe": "^3.1.0", "pathval": "^2.0.0" } }, "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw=="], @@ -177,22 +226,38 @@ "code-excerpt": ["code-excerpt@4.0.0", "", { "dependencies": { "convert-to-spaces": "^2.0.1" } }, "sha512-xxodCmBen3iy2i0WtAK8FlFNrRzjUqjRsMfho58xT/wvZU1YTM3fCnRjcy1gJPMepaRlgm/0e6w8SpWHpn3/cA=="], + "combined-stream": ["combined-stream@1.0.8", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="], + "convert-to-spaces": ["convert-to-spaces@2.0.1", "", {}, "sha512-rcQ1bsQO9799wq24uE5AM2tAILy4gXGIK/njFWcVQkGNZ96edlpY+A7bjwvzjYvLDyzmG1MmMLZhpcsb+klNMQ=="], + "crc-32": ["crc-32@1.2.2", "", { "bin": { "crc32": "bin/crc32.njs" } }, "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ=="], + "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], "debug": ["debug@4.4.3", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="], "deep-eql": ["deep-eql@5.0.2", "", {}, "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q=="], + "delayed-stream": ["delayed-stream@1.0.0", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="], + "dotenv": ["dotenv@17.2.2", "", {}, "sha512-Sf2LSQP+bOlhKWWyhFsn0UsfdK/kCWRv1iuA2gXAwt3dyNabr6QSj00I2V10pidqz69soatm9ZwZvpQMTIOd5Q=="], + "dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="], + "emoji-regex": ["emoji-regex@10.5.0", "", {}, "sha512-lb49vf1Xzfx080OKA0o6l8DQQpV+6Vg95zyCJX9VB/BqKYlhG7N4wgROUUHRA+ZPUefLnteQOad7z1kT2bV7bg=="], "environment": ["environment@1.1.0", "", {}, "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q=="], + "es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="], + + "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], + "es-module-lexer": ["es-module-lexer@1.7.0", "", {}, "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA=="], + "es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="], + + "es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="], + "es-toolkit": ["es-toolkit@1.39.10", "", {}, "sha512-E0iGnTtbDhkeczB0T+mxmoVlT4YNweEKBLq7oaU4p11mecdsZpNWOglI4895Vh4usbQ+LsJiuLuI2L0Vdmfm2w=="], "esbuild": ["esbuild@0.25.10", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.10", "@esbuild/android-arm": "0.25.10", "@esbuild/android-arm64": "0.25.10", "@esbuild/android-x64": "0.25.10", "@esbuild/darwin-arm64": "0.25.10", "@esbuild/darwin-x64": "0.25.10", "@esbuild/freebsd-arm64": "0.25.10", "@esbuild/freebsd-x64": "0.25.10", "@esbuild/linux-arm": "0.25.10", "@esbuild/linux-arm64": "0.25.10", "@esbuild/linux-ia32": "0.25.10", "@esbuild/linux-loong64": "0.25.10", "@esbuild/linux-mips64el": "0.25.10", "@esbuild/linux-ppc64": "0.25.10", "@esbuild/linux-riscv64": "0.25.10", "@esbuild/linux-s390x": "0.25.10", "@esbuild/linux-x64": "0.25.10", "@esbuild/netbsd-arm64": "0.25.10", "@esbuild/netbsd-x64": "0.25.10", "@esbuild/openbsd-arm64": "0.25.10", "@esbuild/openbsd-x64": "0.25.10", "@esbuild/openharmony-arm64": "0.25.10", "@esbuild/sunos-x64": "0.25.10", "@esbuild/win32-arm64": "0.25.10", "@esbuild/win32-ia32": "0.25.10", "@esbuild/win32-x64": "0.25.10" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ=="], @@ -201,38 +266,66 @@ "estree-walker": ["estree-walker@3.0.3", "", { "dependencies": { "@types/estree": "^1.0.0" } }, "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g=="], + "ethereum-cryptography": ["ethereum-cryptography@2.2.1", "", { "dependencies": { "@noble/curves": "1.4.2", "@noble/hashes": "1.4.0", "@scure/bip32": "1.4.0", "@scure/bip39": "1.3.0" } }, "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg=="], + + "ethers": ["ethers@6.15.0", "", { "dependencies": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", "@noble/hashes": "1.3.2", "@types/node": "22.7.5", "aes-js": "4.0.0-beta.5", "tslib": "2.7.0", "ws": "8.17.1" } }, "sha512-Kf/3ZW54L4UT0pZtsY/rf+EkBU7Qi5nnhonjUb8yTXcxH3cdcWrV2cRyk0Xk/4jK6OoHhxxZHriyhje20If2hQ=="], + "expect-type": ["expect-type@1.2.2", "", {}, "sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA=="], "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], + "follow-redirects": ["follow-redirects@1.15.11", "", {}, "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ=="], + + "form-data": ["form-data@4.0.4", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.2", "mime-types": "^2.1.12" } }, "sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow=="], + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], + "get-east-asian-width": ["get-east-asian-width@1.4.0", "", {}, "sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q=="], + "get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="], + + "get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="], + + "gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="], + + "has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="], + + "has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="], + + "hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="], + "indent-string": ["indent-string@5.0.0", "", {}, "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg=="], "ink": ["ink@6.3.1", "", { "dependencies": { "@alcalzone/ansi-tokenize": "^0.2.0", "ansi-escapes": "^7.0.0", "ansi-styles": "^6.2.1", "auto-bind": "^5.0.1", "chalk": "^5.6.0", "cli-boxes": "^3.0.0", "cli-cursor": "^4.0.0", "cli-truncate": "^4.0.0", "code-excerpt": "^4.0.0", "es-toolkit": "^1.39.10", "indent-string": "^5.0.0", "is-in-ci": "^2.0.0", "patch-console": "^2.0.0", "react-reconciler": "^0.32.0", "signal-exit": "^3.0.7", "slice-ansi": "^7.1.0", "stack-utils": "^2.0.6", "string-width": "^7.2.0", "type-fest": "^4.27.0", "widest-line": "^5.0.0", "wrap-ansi": "^9.0.0", "ws": "^8.18.0", "yoga-layout": "~3.2.1" }, "peerDependencies": { "@types/react": ">=19.0.0", "react": ">=19.0.0", "react-devtools-core": "^6.1.2" }, "optionalPeers": ["@types/react", "react-devtools-core"] }, "sha512-3wGwITGrzL6rkWsi2gEKzgwdafGn4ZYd3u4oRp+sOPvfoxEHlnoB5Vnk9Uy5dMRUhDOqF3hqr4rLQ4lEzBc2sQ=="], - "ink-table": ["ink-table@3.1.0", "", { "dependencies": { "object-hash": "^2.0.3" }, "peerDependencies": { "ink": ">=3.0.0", "react": ">=16.8.0" } }, "sha512-qxVb4DIaEaJryvF9uZGydnmP9Hkmas3DCKVpEcBYC0E4eJd3qNgNe+PZKuzgCERFe9LfAS1TNWxCr9+AU4v3YA=="], - "is-fullwidth-code-point": ["is-fullwidth-code-point@5.1.0", "", { "dependencies": { "get-east-asian-width": "^1.3.1" } }, "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ=="], "is-in-ci": ["is-in-ci@2.0.0", "", { "bin": { "is-in-ci": "cli.js" } }, "sha512-cFeerHriAnhrQSbpAxL37W1wcJKUUX07HyLWZCW1URJT/ra3GyUTzBgUnh24TMVfNTV2Hij2HLxkPHFZfOZy5w=="], "js-tokens": ["js-tokens@9.0.1", "", {}, "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ=="], + "lodash": ["lodash@4.17.21", "", {}, "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="], + "loupe": ["loupe@3.2.1", "", {}, "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ=="], "magic-string": ["magic-string@0.30.19", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw=="], + "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="], + + "micro-ftch": ["micro-ftch@0.3.1", "", {}, "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg=="], + + "mime-db": ["mime-db@1.52.0", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="], + + "mime-types": ["mime-types@2.1.35", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="], + "mimic-fn": ["mimic-fn@2.1.0", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="], "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], "nanoid": ["nanoid@3.3.11", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w=="], - "object-hash": ["object-hash@2.2.0", "", {}, "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw=="], - "onetime": ["onetime@5.1.2", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="], "patch-console": ["patch-console@2.0.0", "", {}, "sha512-0YNdUceMdaQwoKce1gatDScmMo5pu/tfABfnzEqeG0gtTmd7mh/WcwgUjtAeOU7N8nFFlbQBnFK2gXW5fGvmMA=="], @@ -245,8 +338,12 @@ "picomatch": ["picomatch@4.0.3", "", {}, "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q=="], + "pony-cause": ["pony-cause@2.1.11", "", {}, "sha512-M7LhCsdNbNgiLYiP4WjsfLUuFmCfnjdF6jKe2R9NKl4WFN+HZPGHJZ9lnLP7f9ZnKe3U9nuWD0szirmj+migUg=="], + "postcss": ["postcss@8.5.6", "", { "dependencies": { "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg=="], + "proxy-from-env": ["proxy-from-env@1.1.0", "", {}, "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="], + "react": ["react@19.1.1", "", {}, "sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ=="], "react-reconciler": ["react-reconciler@0.32.0", "", { "dependencies": { "scheduler": "^0.26.0" }, "peerDependencies": { "react": "^19.1.0" } }, "sha512-2NPMOzgTlG0ZWdIf3qG+dcbLSoAc/uLfOwckc3ofy5sSK0pLJqnQLpUFxvGcN2rlXSjnVtGeeFLNimCQEj5gOQ=="], @@ -257,6 +354,10 @@ "scheduler": ["scheduler@0.26.0", "", {}, "sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA=="], + "semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], + + "set-cookie-parser": ["set-cookie-parser@2.7.1", "", {}, "sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ=="], + "siginfo": ["siginfo@2.0.0", "", {}, "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g=="], "signal-exit": ["signal-exit@3.0.7", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="], @@ -289,12 +390,18 @@ "tinyspy": ["tinyspy@4.0.4", "", {}, "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q=="], + "tslib": ["tslib@2.7.0", "", {}, "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA=="], + + "tweetnacl": ["tweetnacl@1.0.3", "", {}, "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="], + "type-fest": ["type-fest@4.41.0", "", {}, "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA=="], "typescript": ["typescript@5.9.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A=="], "undici-types": ["undici-types@7.12.0", "", {}, "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ=="], + "uuid": ["uuid@9.0.1", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA=="], + "vite": ["vite@7.1.7", "", { "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-VbA8ScMvAISJNJVbRDTJdCwqQoAareR/wutevKanhR2/1EkoXVZVkkORaYm/tNVCjP/UDTKtcw3bAkwOUdedmA=="], "vite-node": ["vite-node@3.2.4", "", { "dependencies": { "cac": "^6.7.14", "debug": "^4.4.1", "es-module-lexer": "^1.7.0", "pathe": "^2.0.3", "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" }, "bin": { "vite-node": "vite-node.mjs" } }, "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg=="], @@ -311,8 +418,24 @@ "yoga-layout": ["yoga-layout@3.2.1", "", {}, "sha512-0LPOt3AxKqMdFBZA3HBAt/t/8vIKq7VaQYbuA8WxCgung+p9TVyKRYdpvCb80HcdTN2NkbIKbhNwKUfm3tQywQ=="], + "@scure/bip32/@noble/curves": ["@noble/curves@1.4.2", "", { "dependencies": { "@noble/hashes": "1.4.0" } }, "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw=="], + + "@scure/bip32/@noble/hashes": ["@noble/hashes@1.4.0", "", {}, "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg=="], + + "@scure/bip39/@noble/hashes": ["@noble/hashes@1.4.0", "", {}, "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg=="], + "cli-truncate/slice-ansi": ["slice-ansi@5.0.0", "", { "dependencies": { "ansi-styles": "^6.0.0", "is-fullwidth-code-point": "^4.0.0" } }, "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ=="], + "ethereum-cryptography/@noble/curves": ["@noble/curves@1.4.2", "", { "dependencies": { "@noble/hashes": "1.4.0" } }, "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw=="], + + "ethereum-cryptography/@noble/hashes": ["@noble/hashes@1.4.0", "", {}, "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg=="], + + "ethers/@types/node": ["@types/node@22.7.5", "", { "dependencies": { "undici-types": "~6.19.2" } }, "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ=="], + + "ethers/ws": ["ws@8.17.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ=="], + "cli-truncate/slice-ansi/is-fullwidth-code-point": ["is-fullwidth-code-point@4.0.0", "", {}, "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ=="], + + "ethers/@types/node/undici-types": ["undici-types@6.19.8", "", {}, "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw=="], } } diff --git a/docs/v2-api.md b/docs/aster/v2-api.md similarity index 100% rename from docs/v2-api.md rename to docs/aster/v2-api.md diff --git a/docs/grvt/market_data_api.md b/docs/grvt/market_data_api.md new file mode 100644 index 0000000..40de90d --- /dev/null +++ b/docs/grvt/market_data_api.md @@ -0,0 +1,3636 @@ +# MarketData APIs +All requests should be made using the `POST` HTTP method. + +## Instrument +### Get Instrument +``` +FULL ENDPOINT: full/v1/instrument +LITE ENDPOINT: lite/v1/instrument +``` + +=== "Request" +
+ -8<- "docs/schemas/api_get_instrument_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "instrument": "BTC_USDT_Perp" + } + ``` + **Lite Request** + ``` { .json .copy } + { + "i": "BTC_USDT_Perp" + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_get_instrument_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": { + "instrument": "BTC_USDT_Perp", + "instrument_hash": "0x030501", + "base": "BTC", + "quote": "USDT", + "kind": "PERPETUAL", + "venues": ["ORDERBOOK"], + "settlement_period": "PERPETUAL", + "base_decimals": 3, + "quote_decimals": 3, + "tick_size": "0.01", + "min_size": "0.01", + "create_time": "1697788800000000000", + "max_position_size": "100.0" + } + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": { + "i": "BTC_USDT_Perp", + "ih": "0x030501", + "b": "BTC", + "q": "USDT", + "k": "PERPETUAL", + "v": ["ORDERBOOK"], + "sp1": "PERPETUAL", + "bd": 3, + "qd": 3, + "ts": "0.01", + "ms": "0.01", + "ct": "1697788800000000000", + "mp": "100.0" + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1004|404|Data Not Found| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/instrument' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/instrument", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/instrument' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/instrument", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/instrument' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/instrument", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/instrument' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/instrument", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/instrument' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/instrument", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/instrument' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/instrument", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/instrument' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/instrument", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/instrument' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/instrument", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+
+### Get All Instruments +``` +FULL ENDPOINT: full/v1/all_instruments +LITE ENDPOINT: lite/v1/all_instruments +``` + +=== "Request" +
+ -8<- "docs/schemas/api_get_all_instruments_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "is_active": true + } + ``` + **Lite Request** + ``` { .json .copy } + { + "ia": true + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_get_all_instruments_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": [{ + "instrument": "BTC_USDT_Perp", + "instrument_hash": "0x030501", + "base": "BTC", + "quote": "USDT", + "kind": "PERPETUAL", + "venues": ["ORDERBOOK"], + "settlement_period": "PERPETUAL", + "base_decimals": 3, + "quote_decimals": 3, + "tick_size": "0.01", + "min_size": "0.01", + "create_time": "1697788800000000000", + "max_position_size": "100.0" + }] + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": [{ + "i": "BTC_USDT_Perp", + "ih": "0x030501", + "b": "BTC", + "q": "USDT", + "k": "PERPETUAL", + "v": ["ORDERBOOK"], + "sp1": "PERPETUAL", + "bd": 3, + "qd": 3, + "ts": "0.01", + "ms": "0.01", + "ct": "1697788800000000000", + "mp": "100.0" + }] + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/all_instruments' \ + --data '{ + "is_active": true + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/all_instruments", + "params": { + "is_active": true + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/all_instruments' \ + --data '{ + "ia": true + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/all_instruments", + "p": { + "ia": true + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/all_instruments' \ + --data '{ + "is_active": true + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/all_instruments", + "params": { + "is_active": true + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/all_instruments' \ + --data '{ + "ia": true + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/all_instruments", + "p": { + "ia": true + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/all_instruments' \ + --data '{ + "is_active": true + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/all_instruments", + "params": { + "is_active": true + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/all_instruments' \ + --data '{ + "ia": true + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/all_instruments", + "p": { + "ia": true + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/all_instruments' \ + --data '{ + "is_active": true + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/all_instruments", + "params": { + "is_active": true + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/all_instruments' \ + --data '{ + "ia": true + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/all_instruments", + "p": { + "ia": true + }, + "i": 123 + } + ' -w 360 + ``` +
+
+### Get Filtered Instruments +``` +FULL ENDPOINT: full/v1/instruments +LITE ENDPOINT: lite/v1/instruments +``` + +=== "Request" +
+ -8<- "docs/schemas/api_get_filtered_instruments_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "is_active": true, + "limit": 500 + } + ``` + **Lite Request** + ``` { .json .copy } + { + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "ia": true, + "l": 500 + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_get_filtered_instruments_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": [{ + "instrument": "BTC_USDT_Perp", + "instrument_hash": "0x030501", + "base": "BTC", + "quote": "USDT", + "kind": "PERPETUAL", + "venues": ["ORDERBOOK"], + "settlement_period": "PERPETUAL", + "base_decimals": 3, + "quote_decimals": 3, + "tick_size": "0.01", + "min_size": "0.01", + "create_time": "1697788800000000000", + "max_position_size": "100.0" + }] + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": [{ + "i": "BTC_USDT_Perp", + "ih": "0x030501", + "b": "BTC", + "q": "USDT", + "k": "PERPETUAL", + "v": ["ORDERBOOK"], + "sp1": "PERPETUAL", + "bd": 3, + "qd": 3, + "ts": "0.01", + "ms": "0.01", + "ct": "1697788800000000000", + "mp": "100.0" + }] + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/instruments' \ + --data '{ + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "is_active": true, + "limit": 500 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/instruments", + "params": { + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "is_active": true, + "limit": 500 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/instruments' \ + --data '{ + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "ia": true, + "l": 500 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/instruments", + "p": { + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "ia": true, + "l": 500 + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/instruments' \ + --data '{ + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "is_active": true, + "limit": 500 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/instruments", + "params": { + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "is_active": true, + "limit": 500 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/instruments' \ + --data '{ + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "ia": true, + "l": 500 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/instruments", + "p": { + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "ia": true, + "l": 500 + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/instruments' \ + --data '{ + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "is_active": true, + "limit": 500 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/instruments", + "params": { + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "is_active": true, + "limit": 500 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/instruments' \ + --data '{ + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "ia": true, + "l": 500 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/instruments", + "p": { + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "ia": true, + "l": 500 + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/instruments' \ + --data '{ + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "is_active": true, + "limit": 500 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/instruments", + "params": { + "kind": ["PERPETUAL"], + "base": ["BTC", "ETH"], + "quote": ["USDT", "USDC"], + "is_active": true, + "limit": 500 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/instruments' \ + --data '{ + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "ia": true, + "l": 500 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/instruments", + "p": { + "k": ["PERPETUAL"], + "b": ["BTC", "ETH"], + "q": ["USDT", "USDC"], + "ia": true, + "l": 500 + }, + "i": 123 + } + ' -w 360 + ``` +
+
+### Get Currency +``` +FULL ENDPOINT: full/v1/currency +LITE ENDPOINT: lite/v1/currency +``` + +=== "Request" +
+ -8<- "docs/schemas/api_get_currency_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + } + ``` + **Lite Request** + ``` { .json .copy } + { + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_get_currency_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": [{ + "id": 3, + "symbol": "USDT", + "balance_decimals": 6, + "quantity_multiplier": 1000000 + }] + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": [{ + "i": 3, + "s": "USDT", + "bd": 6, + "qm": 1000000 + }] + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1004|404|Data Not Found| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/currency' \ + --data '{ + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/currency", + "params": { + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/currency' \ + --data '{ + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/currency", + "p": { + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/currency' \ + --data '{ + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/currency", + "params": { + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/currency' \ + --data '{ + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/currency", + "p": { + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/currency' \ + --data '{ + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/currency", + "params": { + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/currency' \ + --data '{ + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/currency", + "p": { + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/currency' \ + --data '{ + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/currency", + "params": { + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/currency' \ + --data '{ + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/currency", + "p": { + }, + "i": 123 + } + ' -w 360 + ``` +
+
+## Ticker +### Mini Ticker +``` +FULL ENDPOINT: full/v1/mini +LITE ENDPOINT: lite/v1/mini +``` + +=== "Request" +
+ -8<- "docs/schemas/api_mini_ticker_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "instrument": "BTC_USDT_Perp" + } + ``` + **Lite Request** + ``` { .json .copy } + { + "i": "BTC_USDT_Perp" + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_mini_ticker_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "mark_price": "65038.01", + "index_price": "65038.01", + "last_price": "65038.01", + "last_size": "123456.78", + "mid_price": "65038.01", + "best_bid_price": "65038.01", + "best_bid_size": "123456.78", + "best_ask_price": "65038.01", + "best_ask_size": "123456.78" + } + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "mp": "65038.01", + "ip": "65038.01", + "lp": "65038.01", + "ls": "123456.78", + "mp1": "65038.01", + "bb": "65038.01", + "bb1": "123456.78", + "ba": "65038.01", + "ba1": "123456.78" + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1004|404|Data Not Found| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/mini' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/mini", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/mini' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/mini", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/mini' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/mini", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/mini' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/mini", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/mini' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/mini", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/mini' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/mini", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/mini' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/mini", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/mini' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/mini", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+
+### Ticker +``` +FULL ENDPOINT: full/v1/ticker +LITE ENDPOINT: lite/v1/ticker +``` + +=== "Request" +
+ -8<- "docs/schemas/api_ticker_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "instrument": "BTC_USDT_Perp" + } + ``` + **Lite Request** + ``` { .json .copy } + { + "i": "BTC_USDT_Perp" + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_ticker_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "mark_price": "65038.01", + "index_price": "65038.01", + "last_price": "65038.01", + "last_size": "123456.78", + "mid_price": "65038.01", + "best_bid_price": "65038.01", + "best_bid_size": "123456.78", + "best_ask_price": "65038.01", + "best_ask_size": "123456.78", + "funding_rate_8h_curr": 0.0003, + "funding_rate_8h_avg": 0.0003, + "interest_rate": 0.0003, + "forward_price": "65038.01", + "buy_volume_24h_b": "123456.78", + "sell_volume_24h_b": "123456.78", + "buy_volume_24h_q": "123456.78", + "sell_volume_24h_q": "123456.78", + "high_price": "65038.01", + "low_price": "65038.01", + "open_price": "65038.01", + "open_interest": "123456.78", + "long_short_ratio": "0.5" + } + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "mp": "65038.01", + "ip": "65038.01", + "lp": "65038.01", + "ls": "123456.78", + "mp1": "65038.01", + "bb": "65038.01", + "bb1": "123456.78", + "ba": "65038.01", + "ba1": "123456.78", + "fr": 0.0003, + "fr1": 0.0003, + "ir": 0.0003, + "fp": "65038.01", + "bv": "123456.78", + "sv": "123456.78", + "bv1": "123456.78", + "sv1": "123456.78", + "hp": "65038.01", + "lp1": "65038.01", + "op": "65038.01", + "oi": "123456.78", + "ls1": "0.5" + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1004|404|Data Not Found| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/ticker' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/ticker", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/ticker' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/ticker", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/ticker' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/ticker", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/ticker' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/ticker", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/ticker' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/ticker", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/ticker' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/ticker", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/ticker' \ + --data '{ + "instrument": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/ticker", + "params": { + "instrument": "BTC_USDT_Perp" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/ticker' \ + --data '{ + "i": "BTC_USDT_Perp" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/ticker", + "p": { + "i": "BTC_USDT_Perp" + }, + "i": 123 + } + ' -w 360 + ``` +
+
+## Orderbook +### Orderbook Levels +``` +FULL ENDPOINT: full/v1/book +LITE ENDPOINT: lite/v1/book +``` + +=== "Request" +
+ -8<- "docs/schemas/api_orderbook_levels_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "instrument": "BTC_USDT_Perp", + "depth": 50 + } + ``` + **Lite Request** + ``` { .json .copy } + { + "i": "BTC_USDT_Perp", + "d": 50 + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_orderbook_levels_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "bids": [{ + "price": "65038.01", + "size": "3456.78", + "num_orders": 123 + }], + "asks": [{ + "price": "65038.01", + "size": "3456.78", + "num_orders": 123 + }] + } + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "b": [{ + "p": "65038.01", + "s": "3456.78", + "no": 123 + }], + "a": [{ + "p": "65038.01", + "s": "3456.78", + "no": 123 + }] + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1004|404|Data Not Found| + |3000|400|Instrument is invalid| + |3031|400|Depth is invalid| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/book' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "depth": 50 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/book", + "params": { + "instrument": "BTC_USDT_Perp", + "depth": 50 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/book' \ + --data '{ + "i": "BTC_USDT_Perp", + "d": 50 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/book", + "p": { + "i": "BTC_USDT_Perp", + "d": 50 + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/book' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "depth": 50 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/book", + "params": { + "instrument": "BTC_USDT_Perp", + "depth": 50 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/book' \ + --data '{ + "i": "BTC_USDT_Perp", + "d": 50 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/book", + "p": { + "i": "BTC_USDT_Perp", + "d": 50 + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/book' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "depth": 50 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/book", + "params": { + "instrument": "BTC_USDT_Perp", + "depth": 50 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/book' \ + --data '{ + "i": "BTC_USDT_Perp", + "d": 50 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/book", + "p": { + "i": "BTC_USDT_Perp", + "d": 50 + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/book' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "depth": 50 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/book", + "params": { + "instrument": "BTC_USDT_Perp", + "depth": 50 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/book' \ + --data '{ + "i": "BTC_USDT_Perp", + "d": 50 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/book", + "p": { + "i": "BTC_USDT_Perp", + "d": 50 + }, + "i": 123 + } + ' -w 360 + ``` +
+
+## Trade +### Trade +``` +FULL ENDPOINT: full/v1/trade +LITE ENDPOINT: lite/v1/trade +``` + +=== "Request" +
+ -8<- "docs/schemas/api_trade_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "instrument": "BTC_USDT_Perp", + "limit": 500 + } + ``` + **Lite Request** + ``` { .json .copy } + { + "i": "BTC_USDT_Perp", + "l": 500 + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_trade_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": [{ + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "is_taker_buyer": true, + "size": "123456.78", + "price": "65038.01", + "mark_price": "65038.01", + "index_price": "65038.01", + "interest_rate": 0.0003, + "forward_price": "65038.01", + "trade_id": "209358-2", + "venue": "ORDERBOOK", + "is_rpi": false + }] + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": [{ + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "it": true, + "s": "123456.78", + "p": "65038.01", + "mp": "65038.01", + "ip": "65038.01", + "ir": 0.0003, + "fp": "65038.01", + "ti": "209358-2", + "v": "ORDERBOOK", + "ir1": false + }] + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/trade' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "limit": 500 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/trade", + "params": { + "instrument": "BTC_USDT_Perp", + "limit": 500 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/trade' \ + --data '{ + "i": "BTC_USDT_Perp", + "l": 500 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/trade", + "p": { + "i": "BTC_USDT_Perp", + "l": 500 + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/trade' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "limit": 500 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/trade", + "params": { + "instrument": "BTC_USDT_Perp", + "limit": 500 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/trade' \ + --data '{ + "i": "BTC_USDT_Perp", + "l": 500 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/trade", + "p": { + "i": "BTC_USDT_Perp", + "l": 500 + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/trade' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "limit": 500 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/trade", + "params": { + "instrument": "BTC_USDT_Perp", + "limit": 500 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/trade' \ + --data '{ + "i": "BTC_USDT_Perp", + "l": 500 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/trade", + "p": { + "i": "BTC_USDT_Perp", + "l": 500 + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/trade' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "limit": 500 + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/trade", + "params": { + "instrument": "BTC_USDT_Perp", + "limit": 500 + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/trade' \ + --data '{ + "i": "BTC_USDT_Perp", + "l": 500 + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/trade", + "p": { + "i": "BTC_USDT_Perp", + "l": 500 + }, + "i": 123 + } + ' -w 360 + ``` +
+
+### Trade History +``` +FULL ENDPOINT: full/v1/trade_history +LITE ENDPOINT: lite/v1/trade_history +``` + +=== "Request" +
+ -8<- "docs/schemas/api_trade_history_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ``` + **Lite Request** + ``` { .json .copy } + { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_trade_history_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": [{ + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "is_taker_buyer": true, + "size": "123456.78", + "price": "65038.01", + "mark_price": "65038.01", + "index_price": "65038.01", + "interest_rate": 0.0003, + "forward_price": "65038.01", + "trade_id": "209358-2", + "venue": "ORDERBOOK", + "is_rpi": false + }], + "next": "Qw0918=" + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": [{ + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "it": true, + "s": "123456.78", + "p": "65038.01", + "mp": "65038.01", + "ip": "65038.01", + "ir": 0.0003, + "fp": "65038.01", + "ti": "209358-2", + "v": "ORDERBOOK", + "ir1": false + }], + "n": "Qw0918=" + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/trade_history' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/trade_history", + "params": { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/trade_history' \ + --data '{ + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/trade_history", + "p": { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/trade_history' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/trade_history", + "params": { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/trade_history' \ + --data '{ + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/trade_history", + "p": { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/trade_history' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/trade_history", + "params": { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/trade_history' \ + --data '{ + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/trade_history", + "p": { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/trade_history' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/trade_history", + "params": { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/trade_history' \ + --data '{ + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/trade_history", + "p": { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+
+## Candlestick +### Candlestick +``` +FULL ENDPOINT: full/v1/kline +LITE ENDPOINT: lite/v1/kline +``` + +=== "Request" +
+ -8<- "docs/schemas/api_candlestick_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "instrument": "BTC_USDT_Perp", + "interval": "CI_1_M", + "type": "TRADE", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ``` + **Lite Request** + ``` { .json .copy } + { + "i": "BTC_USDT_Perp", + "i1": "CI_1_M", + "t": "TRADE", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_candlestick_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": [{ + "open_time": "1697788800000000000", + "close_time": "1697788800000000000", + "open": "123456.78", + "close": "123456.78", + "high": "123456.78", + "low": "123456.78", + "volume_b": "123456.78", + "volume_q": "123456.78", + "trades": 123456, + "instrument": "BTC_USDT_Perp" + }], + "next": "Qw0918=" + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": [{ + "ot": "1697788800000000000", + "ct": "1697788800000000000", + "o": "123456.78", + "c": "123456.78", + "h": "123456.78", + "l": "123456.78", + "vb": "123456.78", + "vq": "123456.78", + "t": 123456, + "i": "BTC_USDT_Perp" + }], + "n": "Qw0918=" + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/kline' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "interval": "CI_1_M", + "type": "TRADE", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/kline", + "params": { + "instrument": "BTC_USDT_Perp", + "interval": "CI_1_M", + "type": "TRADE", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/kline' \ + --data '{ + "i": "BTC_USDT_Perp", + "i1": "CI_1_M", + "t": "TRADE", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/kline", + "p": { + "i": "BTC_USDT_Perp", + "i1": "CI_1_M", + "t": "TRADE", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/kline' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "interval": "CI_1_M", + "type": "TRADE", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/kline", + "params": { + "instrument": "BTC_USDT_Perp", + "interval": "CI_1_M", + "type": "TRADE", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/kline' \ + --data '{ + "i": "BTC_USDT_Perp", + "i1": "CI_1_M", + "t": "TRADE", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/kline", + "p": { + "i": "BTC_USDT_Perp", + "i1": "CI_1_M", + "t": "TRADE", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/kline' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "interval": "CI_1_M", + "type": "TRADE", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/kline", + "params": { + "instrument": "BTC_USDT_Perp", + "interval": "CI_1_M", + "type": "TRADE", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/kline' \ + --data '{ + "i": "BTC_USDT_Perp", + "i1": "CI_1_M", + "t": "TRADE", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/kline", + "p": { + "i": "BTC_USDT_Perp", + "i1": "CI_1_M", + "t": "TRADE", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/kline' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "interval": "CI_1_M", + "type": "TRADE", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/kline", + "params": { + "instrument": "BTC_USDT_Perp", + "interval": "CI_1_M", + "type": "TRADE", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/kline' \ + --data '{ + "i": "BTC_USDT_Perp", + "i1": "CI_1_M", + "t": "TRADE", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/kline", + "p": { + "i": "BTC_USDT_Perp", + "i1": "CI_1_M", + "t": "TRADE", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+
+## Settlement +### Funding Rate +``` +FULL ENDPOINT: full/v1/funding +LITE ENDPOINT: lite/v1/funding +``` + +=== "Request" +
+ -8<- "docs/schemas/api_funding_rate_request.md" +
+
+ !!! question "Query" + **Full Request** + ``` { .json .copy } + { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ``` + **Lite Request** + ``` { .json .copy } + { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ``` +
+=== "Response" +
+ -8<- "docs/schemas/api_funding_rate_response.md" +
+
+ !!! success + **Full Response** + ``` { .json .copy } + { + "result": [{ + "instrument": "BTC_USDT_Perp", + "funding_rate": 0.0003, + "funding_time": "1697788800000000000", + "mark_price": "65038.01", + "funding_rate_8_h_avg": 0.0003 + }], + "next": "Qw0918=" + } + ``` + **Lite Response** + ``` { .json .copy } + { + "r": [{ + "i": "BTC_USDT_Perp", + "fr": 0.0003, + "ft": "1697788800000000000", + "mp": "65038.01", + "fr1": 0.0003 + }], + "n": "Qw0918=" + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1003|400|Request could not be processed due to malformed syntax| + |1006|429|You have surpassed the allocated rate limit for your tier| +
+
+ !!! failure + **Full Error Response** + ``` { .json .copy } + { + "request_id":1, + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "ri":1, + "c":1002, + "m":"Internal Server Error", + "s":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/full/v1/funding' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/funding", + "params": { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.dev.gravitymarkets.io/lite/v1/funding' \ + --data '{ + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/funding", + "p": { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/full/v1/funding' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/funding", + "params": { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.staging.gravitymarkets.io/lite/v1/funding' \ + --data '{ + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/funding", + "p": { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/full/v1/funding' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/funding", + "params": { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.testnet.grvt.io/lite/v1/funding' \ + --data '{ + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/funding", + "p": { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "REST Full" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/full/v1/funding' \ + --data '{ + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + } + ' + ``` + !!! example "JSONRPC Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "v1/funding", + "params": { + "instrument": "BTC_USDT_Perp", + "start_time": "1697788800000000000", + "end_time": "1697788800000000000", + "limit": 500, + "cursor": "" + }, + "id": 123 + } + ' -w 360 + ``` +
+
+ !!! example "REST Lite" + ``` { .bash .copy } + curl --location 'https://market-data.grvt.io/lite/v1/funding' \ + --data '{ + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + } + ' + ``` + !!! example "JSONRPC Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "v1/funding", + "p": { + "i": "BTC_USDT_Perp", + "st": "1697788800000000000", + "et": "1697788800000000000", + "l": 500, + "c": "" + }, + "i": 123 + } + ' -w 360 + ``` +
+
diff --git a/docs/grvt/market_data_streams.md b/docs/grvt/market_data_streams.md new file mode 100644 index 0000000..235b6ed --- /dev/null +++ b/docs/grvt/market_data_streams.md @@ -0,0 +1,4535 @@ +# MarketData Websocket Streams + +## Ticker +### Mini Ticker Snap +``` +STREAM: v1.mini.s +``` + +=== "Feed Selector" +
+ -8<- "docs/schemas/ws_mini_ticker_feed_selector_v1.md" + ??? info "JSONRPC Wrappers" + -8<- "docs/schemas/jsonrpc_request.md" + -8<- "docs/schemas/jsonrpc_response.md" + -8<- "docs/schemas/ws_subscribe_params.md" + -8<- "docs/schemas/ws_subscribe_result.md" + -8<- "docs/schemas/ws_unsubscribe_params.md" + -8<- "docs/schemas/ws_unsubscribe_result.md" + -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md" + -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md" +
+
+ ???+ question "Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.mini.s", + "subs": ["BTC_USDT_Perp@500"], + "unsubs": [], + "num_snapshots": [10], + "first_sequence_number": [872634876] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Unsubscribe" + **Full Unsubscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Unsubscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.mini.s", + "unsubs": ["BTC_USDT_Perp@500"] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Legacy Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.mini.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.mini.s", + "subs":["BTC_USDT_Perp@500"], + "unsubs":[], + "num_snapshots":[1], + "first_sequence_number":[2813] + } + ``` +
+=== "Feed Data" +
+ -8<- "docs/schemas/ws_mini_ticker_feed_data_v1.md" +
+
+ !!! success + **Full Feed Response** + ``` { .json .copy } + { + "stream": "v1.mini.s", + "selector": "BTC_USDT_Perp", + "sequence_number": "872634876", + "feed": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "mark_price": "65038.01", + "index_price": "65038.01", + "last_price": "65038.01", + "last_size": "123456.78", + "mid_price": "65038.01", + "best_bid_price": "65038.01", + "best_bid_size": "123456.78", + "best_ask_price": "65038.01", + "best_ask_size": "123456.78" + } + } + ``` + **Lite Feed Response** + ``` { .json .copy } + { + "s": "v1.mini.s", + "s1": "BTC_USDT_Perp", + "sn": "872634876", + "f": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "mp": "65038.01", + "ip": "65038.01", + "lp": "65038.01", + "ls": "123456.78", + "mp1": "65038.01", + "bb": "65038.01", + "bb1": "123456.78", + "ba": "65038.01", + "ba1": "123456.78" + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1004|404|Data Not Found| + |1101|400|Feed Format must be in the format of @| + |1102|400|Wrong number of primary selectors| + |1103|400|Wrong number of secondary selectors| + |3000|400|Instrument is invalid| + |3030|400|Feed rate is invalid| + -8<- "docs/schemas/jsonrpc_response.md" +
+
+ !!! failure "Error" + **Full Error Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "error": { + "code": 1002, + "message": "Internal Server Error" + }, + "id": 123, + "method": "subscribe" + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "j": "2.0", + "e": { + "c": 1002, + "m": "Internal Server Error" + }, + "i": 123, + "m": "subscribe" + } + ``` + **Legacy Error Response** + ``` { .json .copy } + { + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.mini.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.mini.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.mini.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.mini.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.mini.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.mini.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.mini.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.mini.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+
+### Mini Ticker Delta +``` +STREAM: v1.mini.d +``` + +=== "Feed Selector" +
+ -8<- "docs/schemas/ws_mini_ticker_feed_selector_v1.md" + ??? info "JSONRPC Wrappers" + -8<- "docs/schemas/jsonrpc_request.md" + -8<- "docs/schemas/jsonrpc_response.md" + -8<- "docs/schemas/ws_subscribe_params.md" + -8<- "docs/schemas/ws_subscribe_result.md" + -8<- "docs/schemas/ws_unsubscribe_params.md" + -8<- "docs/schemas/ws_unsubscribe_result.md" + -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md" + -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md" +
+
+ ???+ question "Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.mini.d", + "subs": ["BTC_USDT_Perp@500"], + "unsubs": [], + "num_snapshots": [10], + "first_sequence_number": [872634876] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Unsubscribe" + **Full Unsubscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Unsubscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.mini.d", + "unsubs": ["BTC_USDT_Perp@500"] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Legacy Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.mini.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.mini.d", + "subs":["BTC_USDT_Perp@500"], + "unsubs":[], + "num_snapshots":[1], + "first_sequence_number":[2813] + } + ``` +
+=== "Feed Data" +
+ -8<- "docs/schemas/ws_mini_ticker_feed_data_v1.md" +
+
+ !!! success + **Full Feed Response** + ``` { .json .copy } + { + "stream": "v1.mini.d", + "selector": "BTC_USDT_Perp", + "sequence_number": "872634876", + "feed": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "mark_price": "65038.01", + "index_price": "65038.01", + "last_price": "65038.01", + "last_size": "123456.78", + "mid_price": "65038.01", + "best_bid_price": "65038.01", + "best_bid_size": "123456.78", + "best_ask_price": "65038.01", + "best_ask_size": "123456.78" + } + } + ``` + **Lite Feed Response** + ``` { .json .copy } + { + "s": "v1.mini.d", + "s1": "BTC_USDT_Perp", + "sn": "872634876", + "f": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "mp": "65038.01", + "ip": "65038.01", + "lp": "65038.01", + "ls": "123456.78", + "mp1": "65038.01", + "bb": "65038.01", + "bb1": "123456.78", + "ba": "65038.01", + "ba1": "123456.78" + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1004|404|Data Not Found| + |1101|400|Feed Format must be in the format of @| + |1102|400|Wrong number of primary selectors| + |1103|400|Wrong number of secondary selectors| + |3000|400|Instrument is invalid| + |3030|400|Feed rate is invalid| + -8<- "docs/schemas/jsonrpc_response.md" +
+
+ !!! failure "Error" + **Full Error Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "error": { + "code": 1002, + "message": "Internal Server Error" + }, + "id": 123, + "method": "subscribe" + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "j": "2.0", + "e": { + "c": 1002, + "m": "Internal Server Error" + }, + "i": 123, + "m": "subscribe" + } + ``` + **Legacy Error Response** + ``` { .json .copy } + { + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.mini.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.mini.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.mini.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.mini.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.mini.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.mini.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.mini.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.mini.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.mini.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.mini.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+
+### Ticker Snap +``` +STREAM: v1.ticker.s +``` + +=== "Feed Selector" +
+ -8<- "docs/schemas/ws_ticker_feed_selector_v1.md" + ??? info "JSONRPC Wrappers" + -8<- "docs/schemas/jsonrpc_request.md" + -8<- "docs/schemas/jsonrpc_response.md" + -8<- "docs/schemas/ws_subscribe_params.md" + -8<- "docs/schemas/ws_subscribe_result.md" + -8<- "docs/schemas/ws_unsubscribe_params.md" + -8<- "docs/schemas/ws_unsubscribe_result.md" + -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md" + -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md" +
+
+ ???+ question "Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.ticker.s", + "subs": ["BTC_USDT_Perp@500"], + "unsubs": [], + "num_snapshots": [10], + "first_sequence_number": [872634876] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Unsubscribe" + **Full Unsubscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Unsubscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.ticker.s", + "unsubs": ["BTC_USDT_Perp@500"] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Legacy Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.ticker.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.ticker.s", + "subs":["BTC_USDT_Perp@500"], + "unsubs":[], + "num_snapshots":[1], + "first_sequence_number":[2813] + } + ``` +
+=== "Feed Data" +
+ -8<- "docs/schemas/ws_ticker_feed_data_v1.md" +
+
+ !!! success + **Full Feed Response** + ``` { .json .copy } + { + "stream": "v1.ticker.s", + "selector": "BTC_USDT_Perp", + "sequence_number": "872634876", + "feed": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "mark_price": "65038.01", + "index_price": "65038.01", + "last_price": "65038.01", + "last_size": "123456.78", + "mid_price": "65038.01", + "best_bid_price": "65038.01", + "best_bid_size": "123456.78", + "best_ask_price": "65038.01", + "best_ask_size": "123456.78", + "funding_rate_8h_curr": 0.0003, + "funding_rate_8h_avg": 0.0003, + "interest_rate": 0.0003, + "forward_price": "65038.01", + "buy_volume_24h_b": "123456.78", + "sell_volume_24h_b": "123456.78", + "buy_volume_24h_q": "123456.78", + "sell_volume_24h_q": "123456.78", + "high_price": "65038.01", + "low_price": "65038.01", + "open_price": "65038.01", + "open_interest": "123456.78", + "long_short_ratio": "0.5" + } + } + ``` + **Lite Feed Response** + ``` { .json .copy } + { + "s": "v1.ticker.s", + "s1": "BTC_USDT_Perp", + "sn": "872634876", + "f": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "mp": "65038.01", + "ip": "65038.01", + "lp": "65038.01", + "ls": "123456.78", + "mp1": "65038.01", + "bb": "65038.01", + "bb1": "123456.78", + "ba": "65038.01", + "ba1": "123456.78", + "fr": 0.0003, + "fr1": 0.0003, + "ir": 0.0003, + "fp": "65038.01", + "bv": "123456.78", + "sv": "123456.78", + "bv1": "123456.78", + "sv1": "123456.78", + "hp": "65038.01", + "lp1": "65038.01", + "op": "65038.01", + "oi": "123456.78", + "ls1": "0.5" + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1004|404|Data Not Found| + |1101|400|Feed Format must be in the format of @| + |1102|400|Wrong number of primary selectors| + |1103|400|Wrong number of secondary selectors| + |3000|400|Instrument is invalid| + |3030|400|Feed rate is invalid| + -8<- "docs/schemas/jsonrpc_response.md" +
+
+ !!! failure "Error" + **Full Error Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "error": { + "code": 1002, + "message": "Internal Server Error" + }, + "id": 123, + "method": "subscribe" + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "j": "2.0", + "e": { + "c": 1002, + "m": "Internal Server Error" + }, + "i": 123, + "m": "subscribe" + } + ``` + **Legacy Error Response** + ``` { .json .copy } + { + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.ticker.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.ticker.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.ticker.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.ticker.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.ticker.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.ticker.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.s", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.ticker.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.ticker.s", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.s", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+
+### Ticker Delta +``` +STREAM: v1.ticker.d +``` + +=== "Feed Selector" +
+ -8<- "docs/schemas/ws_ticker_feed_selector_v1.md" + ??? info "JSONRPC Wrappers" + -8<- "docs/schemas/jsonrpc_request.md" + -8<- "docs/schemas/jsonrpc_response.md" + -8<- "docs/schemas/ws_subscribe_params.md" + -8<- "docs/schemas/ws_subscribe_result.md" + -8<- "docs/schemas/ws_unsubscribe_params.md" + -8<- "docs/schemas/ws_unsubscribe_result.md" + -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md" + -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md" +
+
+ ???+ question "Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.ticker.d", + "subs": ["BTC_USDT_Perp@500"], + "unsubs": [], + "num_snapshots": [10], + "first_sequence_number": [872634876] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Unsubscribe" + **Full Unsubscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Unsubscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.ticker.d", + "unsubs": ["BTC_USDT_Perp@500"] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Legacy Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.ticker.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.ticker.d", + "subs":["BTC_USDT_Perp@500"], + "unsubs":[], + "num_snapshots":[1], + "first_sequence_number":[2813] + } + ``` +
+=== "Feed Data" +
+ -8<- "docs/schemas/ws_ticker_feed_data_v1.md" +
+
+ !!! success + **Full Feed Response** + ``` { .json .copy } + { + "stream": "v1.ticker.d", + "selector": "BTC_USDT_Perp", + "sequence_number": "872634876", + "feed": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "mark_price": "65038.01", + "index_price": "65038.01", + "last_price": "65038.01", + "last_size": "123456.78", + "mid_price": "65038.01", + "best_bid_price": "65038.01", + "best_bid_size": "123456.78", + "best_ask_price": "65038.01", + "best_ask_size": "123456.78", + "funding_rate_8h_curr": 0.0003, + "funding_rate_8h_avg": 0.0003, + "interest_rate": 0.0003, + "forward_price": "65038.01", + "buy_volume_24h_b": "123456.78", + "sell_volume_24h_b": "123456.78", + "buy_volume_24h_q": "123456.78", + "sell_volume_24h_q": "123456.78", + "high_price": "65038.01", + "low_price": "65038.01", + "open_price": "65038.01", + "open_interest": "123456.78", + "long_short_ratio": "0.5" + } + } + ``` + **Lite Feed Response** + ``` { .json .copy } + { + "s": "v1.ticker.d", + "s1": "BTC_USDT_Perp", + "sn": "872634876", + "f": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "mp": "65038.01", + "ip": "65038.01", + "lp": "65038.01", + "ls": "123456.78", + "mp1": "65038.01", + "bb": "65038.01", + "bb1": "123456.78", + "ba": "65038.01", + "ba1": "123456.78", + "fr": 0.0003, + "fr1": 0.0003, + "ir": 0.0003, + "fp": "65038.01", + "bv": "123456.78", + "sv": "123456.78", + "bv1": "123456.78", + "sv1": "123456.78", + "hp": "65038.01", + "lp1": "65038.01", + "op": "65038.01", + "oi": "123456.78", + "ls1": "0.5" + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1004|404|Data Not Found| + |1101|400|Feed Format must be in the format of @| + |1102|400|Wrong number of primary selectors| + |1103|400|Wrong number of secondary selectors| + |3000|400|Instrument is invalid| + |3030|400|Feed rate is invalid| + -8<- "docs/schemas/jsonrpc_response.md" +
+
+ !!! failure "Error" + **Full Error Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "error": { + "code": 1002, + "message": "Internal Server Error" + }, + "id": 123, + "method": "subscribe" + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "j": "2.0", + "e": { + "c": 1002, + "m": "Internal Server Error" + }, + "i": 123, + "m": "subscribe" + } + ``` + **Legacy Error Response** + ``` { .json .copy } + { + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.ticker.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.ticker.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.ticker.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.ticker.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.ticker.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.ticker.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.ticker.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.ticker.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.ticker.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.ticker.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+
+## Orderbook +### Orderbook Snap +``` +STREAM: v1.book.s +``` + +=== "Feed Selector" +
+ -8<- "docs/schemas/ws_orderbook_levels_feed_selector_v1.md" + ??? info "JSONRPC Wrappers" + -8<- "docs/schemas/jsonrpc_request.md" + -8<- "docs/schemas/jsonrpc_response.md" + -8<- "docs/schemas/ws_subscribe_params.md" + -8<- "docs/schemas/ws_subscribe_result.md" + -8<- "docs/schemas/ws_unsubscribe_params.md" + -8<- "docs/schemas/ws_unsubscribe_result.md" + -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md" + -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md" +
+
+ ???+ question "Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.book.s", + "subs": ["BTC_USDT_Perp@500-50"], + "unsubs": [], + "num_snapshots": [10], + "first_sequence_number": [872634876] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Unsubscribe" + **Full Unsubscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ``` + **Full Unsubscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.book.s", + "unsubs": ["BTC_USDT_Perp@500-50"] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Legacy Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.book.s", + "feed":["BTC_USDT_Perp@500-50"], + "method":"subscribe", + "is_full":true + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.book.s", + "subs":["BTC_USDT_Perp@500-50"], + "unsubs":[], + "num_snapshots":[1], + "first_sequence_number":[2813] + } + ``` +
+=== "Feed Data" +
+ -8<- "docs/schemas/ws_orderbook_levels_feed_data_v1.md" +
+
+ !!! success + **Full Feed Response** + ``` { .json .copy } + { + "stream": "v1.book.s", + "selector": "BTC_USDT_Perp", + "sequence_number": "872634876", + "feed": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "bids": [{ + "price": "65038.01", + "size": "3456.78", + "num_orders": 123 + }], + "asks": [{ + "price": "65038.01", + "size": "3456.78", + "num_orders": 123 + }] + } + } + ``` + **Lite Feed Response** + ``` { .json .copy } + { + "s": "v1.book.s", + "s1": "BTC_USDT_Perp", + "sn": "872634876", + "f": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "b": [{ + "p": "65038.01", + "s": "3456.78", + "no": 123 + }], + "a": [{ + "p": "65038.01", + "s": "3456.78", + "no": 123 + }] + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1004|404|Data Not Found| + |1101|400|Feed Format must be in the format of @| + |1102|400|Wrong number of primary selectors| + |1103|400|Wrong number of secondary selectors| + |3000|400|Instrument is invalid| + |3030|400|Feed rate is invalid| + |3031|400|Depth is invalid| + -8<- "docs/schemas/jsonrpc_response.md" +
+
+ !!! failure "Error" + **Full Error Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "error": { + "code": 1002, + "message": "Internal Server Error" + }, + "id": 123, + "method": "subscribe" + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "j": "2.0", + "e": { + "c": 1002, + "m": "Internal Server Error" + }, + "i": 123, + "m": "subscribe" + } + ``` + **Legacy Error Response** + ``` { .json .copy } + { + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.s", + "feed":["BTC_USDT_Perp@500-50"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.book.s", + "s1": ["BTC_USDT_Perp@500-50"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.book.s", + "s1": ["BTC_USDT_Perp@500-50"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.s", + "feed":["BTC_USDT_Perp@500-50"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.s", + "feed":["BTC_USDT_Perp@500-50"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.book.s", + "s1": ["BTC_USDT_Perp@500-50"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.book.s", + "s1": ["BTC_USDT_Perp@500-50"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.s", + "feed":["BTC_USDT_Perp@500-50"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.s", + "feed":["BTC_USDT_Perp@500-50"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.book.s", + "s1": ["BTC_USDT_Perp@500-50"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.book.s", + "s1": ["BTC_USDT_Perp@500-50"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.s", + "feed":["BTC_USDT_Perp@500-50"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.s", + "selectors": ["BTC_USDT_Perp@500-50"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.s", + "feed":["BTC_USDT_Perp@500-50"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.book.s", + "s1": ["BTC_USDT_Perp@500-50"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.book.s", + "s1": ["BTC_USDT_Perp@500-50"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.s", + "feed":["BTC_USDT_Perp@500-50"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+
+### Orderbook Delta +``` +STREAM: v1.book.d +``` + +=== "Feed Selector" +
+ -8<- "docs/schemas/ws_orderbook_levels_feed_selector_v1.md" + ??? info "JSONRPC Wrappers" + -8<- "docs/schemas/jsonrpc_request.md" + -8<- "docs/schemas/jsonrpc_response.md" + -8<- "docs/schemas/ws_subscribe_params.md" + -8<- "docs/schemas/ws_subscribe_result.md" + -8<- "docs/schemas/ws_unsubscribe_params.md" + -8<- "docs/schemas/ws_unsubscribe_result.md" + -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md" + -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md" +
+
+ ???+ question "Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.book.d", + "subs": ["BTC_USDT_Perp@500"], + "unsubs": [], + "num_snapshots": [10], + "first_sequence_number": [872634876] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Unsubscribe" + **Full Unsubscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Unsubscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.book.d", + "unsubs": ["BTC_USDT_Perp@500"] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Legacy Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.book.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.book.d", + "subs":["BTC_USDT_Perp@500"], + "unsubs":[], + "num_snapshots":[1], + "first_sequence_number":[2813] + } + ``` +
+=== "Feed Data" +
+ -8<- "docs/schemas/ws_orderbook_levels_feed_data_v1.md" +
+
+ !!! success + **Full Feed Response** + ``` { .json .copy } + { + "stream": "v1.book.d", + "selector": "BTC_USDT_Perp", + "sequence_number": "872634876", + "feed": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "bids": [{ + "price": "65038.01", + "size": "3456.78", + "num_orders": 123 + }], + "asks": [{ + "price": "65038.01", + "size": "3456.78", + "num_orders": 123 + }] + } + } + ``` + **Lite Feed Response** + ``` { .json .copy } + { + "s": "v1.book.d", + "s1": "BTC_USDT_Perp", + "sn": "872634876", + "f": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "b": [{ + "p": "65038.01", + "s": "3456.78", + "no": 123 + }], + "a": [{ + "p": "65038.01", + "s": "3456.78", + "no": 123 + }] + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1004|404|Data Not Found| + |1101|400|Feed Format must be in the format of @| + |1102|400|Wrong number of primary selectors| + |1103|400|Wrong number of secondary selectors| + |3000|400|Instrument is invalid| + |3030|400|Feed rate is invalid| + -8<- "docs/schemas/jsonrpc_response.md" +
+
+ !!! failure "Error" + **Full Error Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "error": { + "code": 1002, + "message": "Internal Server Error" + }, + "id": 123, + "method": "subscribe" + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "j": "2.0", + "e": { + "c": 1002, + "m": "Internal Server Error" + }, + "i": 123, + "m": "subscribe" + } + ``` + **Legacy Error Response** + ``` { .json .copy } + { + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.book.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.book.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.book.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.book.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.book.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.book.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.book.d", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.book.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.book.d", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.book.d", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+
+## Trade +### Trade +``` +STREAM: v1.trade +``` + +=== "Feed Selector" +
+ -8<- "docs/schemas/ws_trade_feed_selector_v1.md" + ??? info "JSONRPC Wrappers" + -8<- "docs/schemas/jsonrpc_request.md" + -8<- "docs/schemas/jsonrpc_response.md" + -8<- "docs/schemas/ws_subscribe_params.md" + -8<- "docs/schemas/ws_subscribe_result.md" + -8<- "docs/schemas/ws_unsubscribe_params.md" + -8<- "docs/schemas/ws_unsubscribe_result.md" + -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md" + -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md" +
+
+ ???+ question "Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.trade", + "subs": ["BTC_USDT_Perp@500"], + "unsubs": [], + "num_snapshots": [10], + "first_sequence_number": [872634876] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Unsubscribe" + **Full Unsubscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ``` + **Full Unsubscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.trade", + "unsubs": ["BTC_USDT_Perp@500"] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Legacy Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.trade", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.trade", + "subs":["BTC_USDT_Perp@500"], + "unsubs":[], + "num_snapshots":[1], + "first_sequence_number":[2813] + } + ``` +
+=== "Feed Data" +
+ -8<- "docs/schemas/ws_trade_feed_data_v1.md" +
+
+ !!! success + **Full Feed Response** + ``` { .json .copy } + { + "stream": "v1.trade", + "selector": "BTC_USDT_Perp", + "sequence_number": "872634876", + "feed": { + "event_time": "1697788800000000000", + "instrument": "BTC_USDT_Perp", + "is_taker_buyer": true, + "size": "123456.78", + "price": "65038.01", + "mark_price": "65038.01", + "index_price": "65038.01", + "interest_rate": 0.0003, + "forward_price": "65038.01", + "trade_id": "209358-2", + "venue": "ORDERBOOK", + "is_rpi": false + } + } + ``` + **Lite Feed Response** + ``` { .json .copy } + { + "s": "v1.trade", + "s1": "BTC_USDT_Perp", + "sn": "872634876", + "f": { + "et": "1697788800000000000", + "i": "BTC_USDT_Perp", + "it": true, + "s": "123456.78", + "p": "65038.01", + "mp": "65038.01", + "ip": "65038.01", + "ir": 0.0003, + "fp": "65038.01", + "ti": "209358-2", + "v": "ORDERBOOK", + "ir1": false + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1101|400|Feed Format must be in the format of @| + |1102|400|Wrong number of primary selectors| + |1103|400|Wrong number of secondary selectors| + |3000|400|Instrument is invalid| + |3011|400|Limit exceeds min or max value| + |3013|400|Exact limit value is not supported| + -8<- "docs/schemas/jsonrpc_response.md" +
+
+ !!! failure "Error" + **Full Error Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "error": { + "code": 1002, + "message": "Internal Server Error" + }, + "id": 123, + "method": "subscribe" + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "j": "2.0", + "e": { + "c": 1002, + "m": "Internal Server Error" + }, + "i": 123, + "m": "subscribe" + } + ``` + **Legacy Error Response** + ``` { .json .copy } + { + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.trade", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.trade", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.trade", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.trade", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.trade", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.trade", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.trade", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.trade", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.trade", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.trade", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.trade", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.trade", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.trade", + "selectors": ["BTC_USDT_Perp@500"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.trade", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.trade", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.trade", + "s1": ["BTC_USDT_Perp@500"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.trade", + "feed":["BTC_USDT_Perp@500"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+
+## Candlestick +### Candlestick +``` +STREAM: v1.candle +``` + +=== "Feed Selector" +
+ -8<- "docs/schemas/ws_candlestick_feed_selector_v1.md" + ??? info "JSONRPC Wrappers" + -8<- "docs/schemas/jsonrpc_request.md" + -8<- "docs/schemas/jsonrpc_response.md" + -8<- "docs/schemas/ws_subscribe_params.md" + -8<- "docs/schemas/ws_subscribe_result.md" + -8<- "docs/schemas/ws_unsubscribe_params.md" + -8<- "docs/schemas/ws_unsubscribe_result.md" + -8<- "docs/schemas/ws_subscribe_request_v1_legacy.md" + -8<- "docs/schemas/ws_subscribe_response_v1_legacy.md" +
+
+ ???+ question "Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.candle", + "subs": ["BTC_USDT_Perp@CI_1_M-TRADE"], + "unsubs": [], + "num_snapshots": [10], + "first_sequence_number": [872634876] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Unsubscribe" + **Full Unsubscribe Request** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ``` + **Full Unsubscribe Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "result": { + "stream": "v1.candle", + "unsubs": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123, + "method": "subscribe" + } + ``` + ??? question "Legacy Subscribe" + **Full Subscribe Request** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.candle", + "feed":["BTC_USDT_Perp@CI_1_M-TRADE"], + "method":"subscribe", + "is_full":true + } + ``` + **Full Subscribe Response** + ``` { .json .copy } + { + "request_id":1, + "stream":"v1.candle", + "subs":["BTC_USDT_Perp@CI_1_M-TRADE"], + "unsubs":[], + "num_snapshots":[1], + "first_sequence_number":[2813] + } + ``` +
+=== "Feed Data" +
+ -8<- "docs/schemas/ws_candlestick_feed_data_v1.md" +
+
+ !!! success + **Full Feed Response** + ``` { .json .copy } + { + "stream": "v1.candle", + "selector": "BTC_USDT_Perp", + "sequence_number": "872634876", + "feed": { + "open_time": "1697788800000000000", + "close_time": "1697788800000000000", + "open": "123456.78", + "close": "123456.78", + "high": "123456.78", + "low": "123456.78", + "volume_b": "123456.78", + "volume_q": "123456.78", + "trades": 123456, + "instrument": "BTC_USDT_Perp" + } + } + ``` + **Lite Feed Response** + ``` { .json .copy } + { + "s": "v1.candle", + "s1": "BTC_USDT_Perp", + "sn": "872634876", + "f": { + "ot": "1697788800000000000", + "ct": "1697788800000000000", + "o": "123456.78", + "c": "123456.78", + "h": "123456.78", + "l": "123456.78", + "vb": "123456.78", + "vq": "123456.78", + "t": 123456, + "i": "BTC_USDT_Perp" + } + } + ``` +
+=== "Errors" +
+ !!! info "Error Codes" + |Code|HttpStatus| Description | + |-|-|-| + |1002|500|Internal Server Error| + |1101|400|Feed Format must be in the format of @| + |1102|400|Wrong number of primary selectors| + |1103|400|Wrong number of secondary selectors| + |3000|400|Instrument is invalid| + |3040|400|Candlestick interval is invalid| + |3041|400|Candlestick type is invalid| + -8<- "docs/schemas/jsonrpc_response.md" +
+
+ !!! failure "Error" + **Full Error Response** + ``` { .json .copy } + { + "jsonrpc": "2.0", + "error": { + "code": 1002, + "message": "Internal Server Error" + }, + "id": 123, + "method": "subscribe" + } + ``` + **Lite Error Response** + ``` { .json .copy } + { + "j": "2.0", + "e": { + "c": 1002, + "m": "Internal Server Error" + }, + "i": 123, + "m": "subscribe" + } + ``` + **Legacy Error Response** + ``` { .json .copy } + { + "code":1002, + "message":"Internal Server Error", + "status":500 + } + ``` +
+=== "Try it out" + === "DEV" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.candle", + "feed":["BTC_USDT_Perp@CI_1_M-TRADE"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.candle", + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.candle", + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.dev.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.candle", + "feed":["BTC_USDT_Perp@CI_1_M-TRADE"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "STAGING" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.candle", + "feed":["BTC_USDT_Perp@CI_1_M-TRADE"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.candle", + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.candle", + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.staging.gravitymarkets.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.candle", + "feed":["BTC_USDT_Perp@CI_1_M-TRADE"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "TESTNET" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.candle", + "feed":["BTC_USDT_Perp@CI_1_M-TRADE"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.candle", + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.candle", + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.testnet.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.candle", + "feed":["BTC_USDT_Perp@CI_1_M-TRADE"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+ === "PROD" +
+ !!! example "Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "subscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/full" \ + -x ' + { + "jsonrpc": "2.0", + "method": "unsubscribe", + "params": { + "stream": "v1.candle", + "selectors": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "id": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Full" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.candle", + "feed":["BTC_USDT_Perp@CI_1_M-TRADE"], + "method":"subscribe", + "is_full":true + } + ' -w 360 + ``` +
+
+ !!! example "Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "subscribe", + "p": { + "s": "v1.candle", + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Unsubscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws/lite" \ + -x ' + { + "j": "2.0", + "m": "unsubscribe", + "p": { + "s": "v1.candle", + "s1": ["BTC_USDT_Perp@CI_1_M-TRADE"] + }, + "i": 123 + } + ' -w 360 + ``` + !!! example "Legacy Subscribe Lite" + ``` { .bash .copy } + wscat -c "wss://market-data.grvt.io/ws" \ + -x ' + { + "request_id":1, + "stream":"v1.candle", + "feed":["BTC_USDT_Perp@CI_1_M-TRADE"], + "method":"subscribe", + "is_full":false + } + ' -w 360 + ``` +
+
diff --git a/docs/grvt/schemas/ack.md b/docs/grvt/schemas/ack.md new file mode 100644 index 0000000..1bf0092 --- /dev/null +++ b/docs/grvt/schemas/ack.md @@ -0,0 +1,4 @@ +!!! info "[Ack](/../../schemas/ack)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |ack
`a` |boolean|True|Gravity has acknowledged that the request has been successfully received and it will process it in the backend| diff --git a/docs/grvt/schemas/ack_response.md b/docs/grvt/schemas/ack_response.md new file mode 100644 index 0000000..69f7a8b --- /dev/null +++ b/docs/grvt/schemas/ack_response.md @@ -0,0 +1,10 @@ +!!! info "[AckResponse](/../../schemas/ack_response)" + Used to acknowledge a request has been received and will be processed
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |Ack|True|The Ack Object| + ??? info "[Ack](/../../schemas/ack)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |ack
`a` |boolean|True|Gravity has acknowledged that the request has been successfully received and it will process it in the backend| diff --git a/docs/grvt/schemas/aggregated_account_summary.md b/docs/grvt/schemas/aggregated_account_summary.md new file mode 100644 index 0000000..13b93fa --- /dev/null +++ b/docs/grvt/schemas/aggregated_account_summary.md @@ -0,0 +1,21 @@ +!!! info "[AggregatedAccountSummary](/../../schemas/aggregated_account_summary)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |main_account_id
`ma` |string|True|The main account ID of the account to which the summary belongs| + |total_equity
`te` |string|True|Total equity of the main (+ sub) account, denominated in USD| + |spot_balances
`sb` |[SpotBalance]|True|The list of spot assets owned by this main (+ sub) account, and their balances| + |vault_investments
`vi` |[VaultInvestment]|True|The list of vault investments held by this main account| + ??? info "[SpotBalance](/../../schemas/spot_balance)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |currency
`c` |string|True|The currency you hold a spot balance in| + |balance
`b` |string|True|This currency's balance in this trading account.| + |index_price
`ip` |string|True|The index price of this currency. (reported in `USD`)| + ??? info "[VaultInvestment](/../../schemas/vault_investment)" + Summarizes a vault investment held by a funding account
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |vault_id
`vi` |string|True|The trading account ID of the vault invested in.| + |num_lp_tokens
`nl` |string|True|The number of shares held by the investor.| + |share_price
`sp` |string|True|The current share price (in USD) of this vault investment.| diff --git a/docs/grvt/schemas/api_aggregated_account_summary_response.md b/docs/grvt/schemas/api_aggregated_account_summary_response.md new file mode 100644 index 0000000..6fd3180 --- /dev/null +++ b/docs/grvt/schemas/api_aggregated_account_summary_response.md @@ -0,0 +1,27 @@ +!!! info "[ApiAggregatedAccountSummaryResponse](/../../schemas/api_aggregated_account_summary_response)" + The aggregated account summary, that reports the total equity and spot balances of a funding (main) account, and its constituent trading (sub) accounts
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |AggregatedAccountSummary|True|The aggregated account summary| + ??? info "[AggregatedAccountSummary](/../../schemas/aggregated_account_summary)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |main_account_id
`ma` |string|True|The main account ID of the account to which the summary belongs| + |total_equity
`te` |string|True|Total equity of the main (+ sub) account, denominated in USD| + |spot_balances
`sb` |[SpotBalance]|True|The list of spot assets owned by this main (+ sub) account, and their balances| + |vault_investments
`vi` |[VaultInvestment]|True|The list of vault investments held by this main account| + ??? info "[SpotBalance](/../../schemas/spot_balance)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |currency
`c` |string|True|The currency you hold a spot balance in| + |balance
`b` |string|True|This currency's balance in this trading account.| + |index_price
`ip` |string|True|The index price of this currency. (reported in `USD`)| + ??? info "[VaultInvestment](/../../schemas/vault_investment)" + Summarizes a vault investment held by a funding account
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |vault_id
`vi` |string|True|The trading account ID of the vault invested in.| + |num_lp_tokens
`nl` |string|True|The number of shares held by the investor.| + |share_price
`sp` |string|True|The current share price (in USD) of this vault investment.| diff --git a/docs/grvt/schemas/api_cancel_all_orders_request.md b/docs/grvt/schemas/api_cancel_all_orders_request.md new file mode 100644 index 0000000..aa5422b --- /dev/null +++ b/docs/grvt/schemas/api_cancel_all_orders_request.md @@ -0,0 +1,18 @@ +!!! info "[ApiCancelAllOrdersRequest](/../../schemas/api_cancel_all_orders_request)" + Cancel all orders on the orderbook for this trading account. This may not match new orders in flight.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The subaccount ID cancelling all orders| + |kind
`k` |[Kind]|False
`all`|The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be cancelled| + |base
`b` |[string]|False
`all`|The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be cancelled| + |quote
`q` |[string]|False
`all`|The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be cancelled| + ??? info "[Kind](/../../schemas/kind)" + The list of asset kinds that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`PERPETUAL` = 1|the perpetual asset kind| + |`FUTURE` = 2|the future asset kind| + |`CALL` = 3|the call option asset kind| + |`PUT` = 4|the put option asset kind| diff --git a/docs/grvt/schemas/api_cancel_all_orders_response.md b/docs/grvt/schemas/api_cancel_all_orders_response.md new file mode 100644 index 0000000..8894694 --- /dev/null +++ b/docs/grvt/schemas/api_cancel_all_orders_response.md @@ -0,0 +1,4 @@ +!!! info "[ApiCancelAllOrdersResponse](/../../schemas/api_cancel_all_orders_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |integer|True|The number of orders cancelled| diff --git a/docs/grvt/schemas/api_cancel_on_disconnect_request.md b/docs/grvt/schemas/api_cancel_on_disconnect_request.md new file mode 100644 index 0000000..2fdc090 --- /dev/null +++ b/docs/grvt/schemas/api_cancel_on_disconnect_request.md @@ -0,0 +1,7 @@ +!!! info "[ApiCancelOnDisconnectRequest](/../../schemas/api_cancel_on_disconnect_request)" + Auto-Cancel All Open Orders when the countdown time hits zero.

Market Maker inputs a countdown time parameter in milliseconds (e.g. 120000 for 120s) rounded down to the smallest second follows the following logic:
- Market Maker initially entered a value between 0 -> 1000, which is rounded to 0: will result in termination of their COD
- Market Maker initially entered a value between 1001 -> 300_000, which is rounded to the nearest second: will result in refresh of their COD
- Market Maker initially entered a value bigger than 300_000, which will result in error (upper bound)
Market Maker will send a heartbeat message by calling the endpoint at specific intervals (ex. every 30 seconds) to the server to refresh the count down.

If the server does not receive a heartbeat message within the countdown time, it will cancel all open orders for the specified Sub Account ID.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The subaccount ID cancelling the orders for| + |countdown_time
`ct` |string|False
`1000`|Countdown time in milliseconds (ex. 120000 for 120s).

0 to disable the timer.

Does not accept negative values.

Minimum acceptable value is 1,000.

Maximum acceptable value is 300,000| diff --git a/docs/grvt/schemas/api_cancel_order_request.md b/docs/grvt/schemas/api_cancel_order_request.md new file mode 100644 index 0000000..45d90fe --- /dev/null +++ b/docs/grvt/schemas/api_cancel_order_request.md @@ -0,0 +1,9 @@ +!!! info "[ApiCancelOrderRequest](/../../schemas/api_cancel_order_request)" + Cancel an order on the orderbook for this trading account. Either `order_id` or `client_order_id` must be provided.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The subaccount ID cancelling the order| + |order_id
`oi` |string|False
`0`|Cancel the order with this `order_id`| + |client_order_id
`co` |string|False
`0`|Cancel the order with this `client_order_id`| + |time_to_live_ms
`tt` |string|False
`100`|Specifies the time-to-live (in milliseconds) for this cancellation.
During this period, any order creation with a matching `client_order_id` will be cancelled and not be added to the GRVT matching engine.
This mechanism helps mitigate time-of-flight issues where cancellations might arrive before the corresponding orders.
Hence, cancellation by `order_id` ignores this field as the exchange can only assign `order_id`s to already-processed order creations.
The duration cannot be negative, is rounded down to the nearest 100ms (e.g., `'670'` -> `'600'`, `'30'` -> `'0'`) and capped at 5 seconds (i.e., `'5000'`).
Value of `'0'` or omission results in the default time-to-live value being applied.
If the caller requests multiple successive cancellations for a given order, such that the time-to-live windows overlap, only the first request will be considered.
| diff --git a/docs/grvt/schemas/api_cancel_order_response.md b/docs/grvt/schemas/api_cancel_order_response.md new file mode 100644 index 0000000..12c6d0e --- /dev/null +++ b/docs/grvt/schemas/api_cancel_order_response.md @@ -0,0 +1,147 @@ +!!! info "[ApiCancelOrderResponse](/../../schemas/api_cancel_order_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |Order|True|The cancelled order| + ??? info "[Order](/../../schemas/order)" + Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.
GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.
This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.
Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.

All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.
This minimizes the amount of trust users have to offer to GRVT
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |order_id
`oi` |string|False
`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend| + |sub_account_id
`sa` |string|True|The subaccount initiating the order| + |is_market
`im` |boolean|False
`false`|If the order is a market order
Market Orders do not have a limit price, and are always executed according to the maker order price.
Market Orders must always be taker orders| + |time_in_force
`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:Exchange only supports (GTT, IOC, FOK)
RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)| + |post_only
`po` |boolean|False
`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.
If False, Order can be either a maker or taker order. In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.

| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Be Taker | FOK + False | IOC + False |
| Can Be Either | AON + False | GTC + False |
| Must Be Maker | AON + True | GTC + True |
| + |reduce_only
`ro` |boolean|False
`false`|If True, Order must reduce the position size, or be cancelled| + |legs
`l` |[OrderLeg]|True|The legs present in this order
The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice| + |signature
`s` |Signature|True|The signature approving this order| + |metadata
`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client| + |state
`s1` |OrderState|False
`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client| + ??? info "[TimeInForce](/../../schemas/time_in_force)" + | | Must Fill All | Can Fill Partial | + | - | - | - | + | Must Fill Immediately | FOK | IOC | + | Can Fill Till Time | AON | GTC | +
+ + |Value| Description | + |-|-| + |`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired| + |`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)| + |`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it| + |`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it| + ??? info "[OrderLeg](/../../schemas/order_leg)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The instrument to trade in this leg| + |size
`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.| + |limit_price
`lp` |string|False
`0`|The limit price of the order leg, expressed in `9` decimals.
This is the number of quote currency units to pay/receive for this leg.
This should be `null/0` if the order is a market order| + |is_buying_asset
`ib` |boolean|True|Specifies if the order leg is a buy or sell| + ??? info "[Signature](/../../schemas/signature)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |signer
`s` |string|True|The address (public key) of the wallet signing the payload| + |r
`r` |string|True|Signature R| + |s
`s1` |string|True|Signature S| + |v
`v` |integer|True|Signature V| + |expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days| + |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.| + ??? info "[OrderMetadata](/../../schemas/order_metadata)" + Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| + |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" + Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).

Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_type
`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc| + |tpsl
`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

| + ??? info "[TriggerType](/../../schemas/trigger_type)" + Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.

Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.| + |`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.| + |`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.| + ??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)" + Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

### Fields:
- **triggerBy**: Defines the price type that activates the order (e.g., index price).
- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order| + |trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.| + ??? info "[TriggerBy](/../../schemas/trigger_by)" + Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.

Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|no trigger condition| + |`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price| + |`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| + |`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered| diff --git a/docs/grvt/schemas/api_candlestick_request.md b/docs/grvt/schemas/api_candlestick_request.md new file mode 100644 index 0000000..03c8474 --- /dev/null +++ b/docs/grvt/schemas/api_candlestick_request.md @@ -0,0 +1,40 @@ +!!! info "[ApiCandlestickRequest](/../../schemas/api_candlestick_request)" + Kline/Candlestick bars for an instrument. Klines are uniquely identified by their instrument, type, interval, and open time.

Pagination works as follows:
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The readable instrument name:| + |interval
`i1` |CandlestickInterval|True|The interval of each candlestick| + |type
`t` |CandlestickType|True|The type of candlestick data to retrieve| + |start_time
`st` |string|False
`0`|Start time of kline data in unix nanoseconds| + |end_time
`et` |string|False
`now()`|End time of kline data in unix nanoseconds| + |limit
`l` |integer|False
`500`|The limit to query for. Defaults to 500; Max 1000| + |cursor
`c` |string|False
`''`|The cursor to indicate when to start the query from| + ??? info "[CandlestickInterval](/../../schemas/candlestick_interval)" + |Value| Description | + |-|-| + |`CI_1_M` = 1|1 minute| + |`CI_3_M` = 2|3 minutes| + |`CI_5_M` = 3|5 minutes| + |`CI_15_M` = 4|15 minutes| + |`CI_30_M` = 5|30 minutes| + |`CI_1_H` = 6|1 hour| + |`CI_2_H` = 7|2 hour| + |`CI_4_H` = 8|4 hour| + |`CI_6_H` = 9|6 hour| + |`CI_8_H` = 10|8 hour| + |`CI_12_H` = 11|12 hour| + |`CI_1_D` = 12|1 day| + |`CI_3_D` = 13|3 days| + |`CI_5_D` = 14|5 days| + |`CI_1_W` = 15|1 week| + |`CI_2_W` = 16|2 weeks| + |`CI_3_W` = 17|3 weeks| + |`CI_4_W` = 18|4 weeks| + ??? info "[CandlestickType](/../../schemas/candlestick_type)" + |Value| Description | + |-|-| + |`TRADE` = 1|Tracks traded prices| + |`MARK` = 2|Tracks mark prices| + |`INDEX` = 3|Tracks index prices| + |`MID` = 4|Tracks book mid prices| diff --git a/docs/grvt/schemas/api_candlestick_response.md b/docs/grvt/schemas/api_candlestick_response.md new file mode 100644 index 0000000..4f69d76 --- /dev/null +++ b/docs/grvt/schemas/api_candlestick_response.md @@ -0,0 +1,20 @@ +!!! info "[ApiCandlestickResponse](/../../schemas/api_candlestick_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[Candlestick]|True|The candlestick result set for given interval| + |next
`n` |string|False
`''`|The cursor to indicate when to start the next query from| + ??? info "[Candlestick](/../../schemas/candlestick)" +
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |open_time
`ot` |string|True|Open time of kline bar in unix nanoseconds| + |close_time
`ct` |string|True|Close time of kline bar in unix nanosecond| + |open
`o` |string|True|The open price, expressed in underlying currency resolution units| + |close
`c` |string|True|The close price, expressed in underlying currency resolution units| + |high
`h` |string|True|The high price, expressed in underlying currency resolution units| + |low
`l` |string|True|The low price, expressed in underlying currency resolution units| + |volume_b
`vb` |string|True|The underlying volume transacted, expressed in base asset decimal units| + |volume_q
`vq` |string|True|The quote volume transacted, expressed in quote asset decimal units| + |trades
`t` |integer|True|The number of trades transacted| + |instrument
`i` |string|True|The readable instrument name:| diff --git a/docs/grvt/schemas/api_category_affinity_score_request.md b/docs/grvt/schemas/api_category_affinity_score_request.md new file mode 100644 index 0000000..a4a95e0 --- /dev/null +++ b/docs/grvt/schemas/api_category_affinity_score_request.md @@ -0,0 +1,5 @@ +!!! info "[ApiCategoryAffinityScoreRequest](/../../schemas/api_category_affinity_score_request)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |start_time
`st` |string|True|The start time of query. Can leave empty to query from the beginning| + |end_time
`et` |string|True|The end time of query. Can leave empty to query until now| diff --git a/docs/grvt/schemas/api_category_affinity_score_response.md b/docs/grvt/schemas/api_category_affinity_score_response.md new file mode 100644 index 0000000..fece118 --- /dev/null +++ b/docs/grvt/schemas/api_category_affinity_score_response.md @@ -0,0 +1,12 @@ +!!! info "[ApiCategoryAffinityScoreResponse](/../../schemas/api_category_affinity_score_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[UserCategoryAffinityScore]|True|The list of categoryAffinities score| + ??? info "[UserCategoryAffinityScore](/../../schemas/user_category_affinity_score)" +
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |category_id
`ci` |string|True|target category| + |affinity_score
`as` |number|True|affinity score| diff --git a/docs/grvt/schemas/api_create_bulk_orders_request.md b/docs/grvt/schemas/api_create_bulk_orders_request.md new file mode 100644 index 0000000..868451e --- /dev/null +++ b/docs/grvt/schemas/api_create_bulk_orders_request.md @@ -0,0 +1,149 @@ +!!! info "[ApiCreateBulkOrdersRequest](/../../schemas/api_create_bulk_orders_request)" + Create multiple orders simultaneously for this trading account.

This endpoint supports the following order scenarios:
- One-Cancels-Other (OCO) orders combining TP/SL
- One-Sends-Other (OSO) orders

Usage:
- For OCO (TP/SL pair): Send exactly 2 orders in the same request - one Take Profit and one Stop Loss order
- For OSO: Send exactly one main order and one contingent order (TP and/or SL)
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |orders
`o` |[Order]|True|The orders to create| + ??? info "[Order](/../../schemas/order)" + Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.
GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.
This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.
Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.

All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.
This minimizes the amount of trust users have to offer to GRVT
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |order_id
`oi` |string|False
`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend| + |sub_account_id
`sa` |string|True|The subaccount initiating the order| + |is_market
`im` |boolean|False
`false`|If the order is a market order
Market Orders do not have a limit price, and are always executed according to the maker order price.
Market Orders must always be taker orders| + |time_in_force
`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:Exchange only supports (GTT, IOC, FOK)
RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)| + |post_only
`po` |boolean|False
`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.
If False, Order can be either a maker or taker order. In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.

| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Be Taker | FOK + False | IOC + False |
| Can Be Either | AON + False | GTC + False |
| Must Be Maker | AON + True | GTC + True |
| + |reduce_only
`ro` |boolean|False
`false`|If True, Order must reduce the position size, or be cancelled| + |legs
`l` |[OrderLeg]|True|The legs present in this order
The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice| + |signature
`s` |Signature|True|The signature approving this order| + |metadata
`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client| + |state
`s1` |OrderState|False
`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client| + ??? info "[TimeInForce](/../../schemas/time_in_force)" + | | Must Fill All | Can Fill Partial | + | - | - | - | + | Must Fill Immediately | FOK | IOC | + | Can Fill Till Time | AON | GTC | +
+ + |Value| Description | + |-|-| + |`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired| + |`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)| + |`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it| + |`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it| + ??? info "[OrderLeg](/../../schemas/order_leg)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The instrument to trade in this leg| + |size
`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.| + |limit_price
`lp` |string|False
`0`|The limit price of the order leg, expressed in `9` decimals.
This is the number of quote currency units to pay/receive for this leg.
This should be `null/0` if the order is a market order| + |is_buying_asset
`ib` |boolean|True|Specifies if the order leg is a buy or sell| + ??? info "[Signature](/../../schemas/signature)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |signer
`s` |string|True|The address (public key) of the wallet signing the payload| + |r
`r` |string|True|Signature R| + |s
`s1` |string|True|Signature S| + |v
`v` |integer|True|Signature V| + |expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days| + |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.| + ??? info "[OrderMetadata](/../../schemas/order_metadata)" + Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| + |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" + Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).

Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_type
`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc| + |tpsl
`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

| + ??? info "[TriggerType](/../../schemas/trigger_type)" + Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.

Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.| + |`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.| + |`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.| + ??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)" + Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

### Fields:
- **triggerBy**: Defines the price type that activates the order (e.g., index price).
- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order| + |trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.| + ??? info "[TriggerBy](/../../schemas/trigger_by)" + Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.

Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|no trigger condition| + |`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price| + |`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| + |`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered| diff --git a/docs/grvt/schemas/api_create_bulk_orders_response.md b/docs/grvt/schemas/api_create_bulk_orders_response.md new file mode 100644 index 0000000..7d29ae3 --- /dev/null +++ b/docs/grvt/schemas/api_create_bulk_orders_response.md @@ -0,0 +1,147 @@ +!!! info "[ApiCreateBulkOrdersResponse](/../../schemas/api_create_bulk_orders_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[Order]|True|The created orders in same order as requested| + ??? info "[Order](/../../schemas/order)" + Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.
GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.
This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.
Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.

All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.
This minimizes the amount of trust users have to offer to GRVT
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |order_id
`oi` |string|False
`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend| + |sub_account_id
`sa` |string|True|The subaccount initiating the order| + |is_market
`im` |boolean|False
`false`|If the order is a market order
Market Orders do not have a limit price, and are always executed according to the maker order price.
Market Orders must always be taker orders| + |time_in_force
`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:Exchange only supports (GTT, IOC, FOK)
RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)| + |post_only
`po` |boolean|False
`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.
If False, Order can be either a maker or taker order. In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.

| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Be Taker | FOK + False | IOC + False |
| Can Be Either | AON + False | GTC + False |
| Must Be Maker | AON + True | GTC + True |
| + |reduce_only
`ro` |boolean|False
`false`|If True, Order must reduce the position size, or be cancelled| + |legs
`l` |[OrderLeg]|True|The legs present in this order
The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice| + |signature
`s` |Signature|True|The signature approving this order| + |metadata
`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client| + |state
`s1` |OrderState|False
`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client| + ??? info "[TimeInForce](/../../schemas/time_in_force)" + | | Must Fill All | Can Fill Partial | + | - | - | - | + | Must Fill Immediately | FOK | IOC | + | Can Fill Till Time | AON | GTC | +
+ + |Value| Description | + |-|-| + |`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired| + |`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)| + |`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it| + |`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it| + ??? info "[OrderLeg](/../../schemas/order_leg)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The instrument to trade in this leg| + |size
`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.| + |limit_price
`lp` |string|False
`0`|The limit price of the order leg, expressed in `9` decimals.
This is the number of quote currency units to pay/receive for this leg.
This should be `null/0` if the order is a market order| + |is_buying_asset
`ib` |boolean|True|Specifies if the order leg is a buy or sell| + ??? info "[Signature](/../../schemas/signature)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |signer
`s` |string|True|The address (public key) of the wallet signing the payload| + |r
`r` |string|True|Signature R| + |s
`s1` |string|True|Signature S| + |v
`v` |integer|True|Signature V| + |expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days| + |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.| + ??? info "[OrderMetadata](/../../schemas/order_metadata)" + Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| + |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" + Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).

Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_type
`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc| + |tpsl
`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

| + ??? info "[TriggerType](/../../schemas/trigger_type)" + Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.

Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.| + |`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.| + |`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.| + ??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)" + Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

### Fields:
- **triggerBy**: Defines the price type that activates the order (e.g., index price).
- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order| + |trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.| + ??? info "[TriggerBy](/../../schemas/trigger_by)" + Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.

Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|no trigger condition| + |`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price| + |`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| + |`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered| diff --git a/docs/grvt/schemas/api_create_order_request.md b/docs/grvt/schemas/api_create_order_request.md new file mode 100644 index 0000000..b4b5b41 --- /dev/null +++ b/docs/grvt/schemas/api_create_order_request.md @@ -0,0 +1,160 @@ +!!! info "[ApiCreateOrderRequest](/../../schemas/api_create_order_request)" + Create an order on the orderbook for this trading account.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |order
`o` |Order|True|The order to create| + ??? info "[Order](/../../schemas/order)" + Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.
GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.
This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.
Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.

All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.
This minimizes the amount of trust users have to offer to GRVT
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |order_id
`oi` |string|False
`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend| + |sub_account_id
`sa` |string|True|The subaccount initiating the order| + |is_market
`im` |boolean|False
`false`|If the order is a market order
Market Orders do not have a limit price, and are always executed according to the maker order price.
Market Orders must always be taker orders| + |time_in_force
`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:Exchange only supports (GTT, IOC, FOK)
RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)| + |post_only
`po` |boolean|False
`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.
If False, Order can be either a maker or taker order. In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.

| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Be Taker | FOK + False | IOC + False |
| Can Be Either | AON + False | GTC + False |
| Must Be Maker | AON + True | GTC + True |
| + |reduce_only
`ro` |boolean|False
`false`|If True, Order must reduce the position size, or be cancelled| + |legs
`l` |[OrderLeg]|True|The legs present in this order
The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice| + |signature
`s` |Signature|True|The signature approving this order| + |metadata
`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client| + |state
`s1` |OrderState|False
`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client| + ??? info "[TimeInForce](/../../schemas/time_in_force)" + | | Must Fill All | Can Fill Partial | + | - | - | - | + | Must Fill Immediately | FOK | IOC | + | Can Fill Till Time | AON | GTC | +
+ + |Value| Description | + |-|-| + |`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired| + |`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)| + |`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it| + |`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it| + |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.| + ??? info "[OrderLeg](/../../schemas/order_leg)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The instrument to trade in this leg| + |size
`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.| + |limit_price
`lp` |string|False
`0`|The limit price of the order leg, expressed in `9` decimals.
This is the number of quote currency units to pay/receive for this leg.
This should be `null/0` if the order is a market order| + |is_buying_asset
`ib` |boolean|True|Specifies if the order leg is a buy or sell| + ??? info "[Signature](/../../schemas/signature)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |signer
`s` |string|True|The address (public key) of the wallet signing the payload| + |r
`r` |string|True|Signature R| + |s
`s1` |string|True|Signature S| + |v
`v` |integer|True|Signature V| + |expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days| + |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.| + ??? info "[OrderMetadata](/../../schemas/order_metadata)" + Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| + |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" + Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).

Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_type
`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc| + |tpsl
`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

| + ??? info "[TriggerType](/../../schemas/trigger_type)" + Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.

Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.| + |`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.| + |`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.| + ??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)" + Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

### Fields:
- **triggerBy**: Defines the price type that activates the order (e.g., index price).
- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order| + |trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.| + |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached| + ??? info "[TriggerBy](/../../schemas/trigger_by)" + Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.

Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|no trigger condition| + |`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price| + |`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price| + |`MID` = 3|MID - Order is activated when the mid price reaches the trigger price| + |`MARK` = 4|MARK - Order is activated when the mark price reaches the trigger price| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| + |`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered| + |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size| + |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request| + |`DERISK_MUST_BE_IOC` = 33|the derisk order must be an IOC order| + |`DERISK_MUST_BE_REDUCE_ONLY` = 34|the derisk order must be a reduce-only order| + |`DERISK_NOT_SUPPORTED` = 35|derisk is not supported| + |`INVALID_ORDER_TYPE` = 36|the order type is invalid| + |`CURRENCY_NOT_DEFINED` = 37|the currency is not defined| diff --git a/docs/grvt/schemas/api_create_order_response.md b/docs/grvt/schemas/api_create_order_response.md new file mode 100644 index 0000000..cc84988 --- /dev/null +++ b/docs/grvt/schemas/api_create_order_response.md @@ -0,0 +1,158 @@ +!!! info "[ApiCreateOrderResponse](/../../schemas/api_create_order_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |Order|True|The created order| + ??? info "[Order](/../../schemas/order)" + Order is a typed payload used throughout the GRVT platform to express all orderbook, RFQ, and liquidation orders.
GRVT orders are capable of expressing both single-legged, and multi-legged orders by default.
This increases the learning curve slightly but reduces overall integration load, since the order payload is used across all GRVT trading venues.
Given GRVT's trustless settlement model, the Order payload also carries the signature, required to trade the order on our ZKSync Hyperchain.

All fields in the Order payload (except `id`, `metadata`, and `state`) are trustlessly enforced on our Hyperchain.
This minimizes the amount of trust users have to offer to GRVT
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |order_id
`oi` |string|False
`0`|[Filled by GRVT Backend] A unique 128-bit identifier for the order, deterministically generated within the GRVT backend| + |sub_account_id
`sa` |string|True|The subaccount initiating the order| + |is_market
`im` |boolean|False
`false`|If the order is a market order
Market Orders do not have a limit price, and are always executed according to the maker order price.
Market Orders must always be taker orders| + |time_in_force
`ti` |TimeInForce|True|Four supported types of orders: GTT, IOC, AON, FOK:Exchange only supports (GTT, IOC, FOK)
RFQ Maker only supports (GTT, AON), RFQ Taker only supports (FOK)| + |post_only
`po` |boolean|False
`false`|If True, Order must be a maker order. It has to fill the orderbook instead of match it.
If False, Order can be either a maker or taker order. In this case, order creation is currently subject to a speedbump of 25ms to ensure orders are matched against updated orderbook quotes.

| | Must Fill All | Can Fill Partial |
| - | - | - |
| Must Be Taker | FOK + False | IOC + False |
| Can Be Either | AON + False | GTC + False |
| Must Be Maker | AON + True | GTC + True |
| + |reduce_only
`ro` |boolean|False
`false`|If True, Order must reduce the position size, or be cancelled| + |legs
`l` |[OrderLeg]|True|The legs present in this order
The legs must be sorted by Asset.Instrument/Underlying/Quote/Expiration/StrikePrice| + |signature
`s` |Signature|True|The signature approving this order| + |metadata
`m` |OrderMetadata|True|Order Metadata, ignored by the smart contract, and unsigned by the client| + |state
`s1` |OrderState|False
`''`|[Filled by GRVT Backend] The current state of the order, ignored by the smart contract, and unsigned by the client| + ??? info "[TimeInForce](/../../schemas/time_in_force)" + | | Must Fill All | Can Fill Partial | + | - | - | - | + | Must Fill Immediately | FOK | IOC | + | Can Fill Till Time | AON | GTC | +
+ + |Value| Description | + |-|-| + |`GOOD_TILL_TIME` = 1|GTT - Remains open until it is cancelled, or expired| + |`ALL_OR_NONE` = 2|AON - Either fill the whole order or none of it (Block Trades Only)| + |`IMMEDIATE_OR_CANCEL` = 3|IOC - Fill the order as much as possible, when hitting the orderbook. Then cancel it| + |`FILL_OR_KILL` = 4|FOK - Both AoN and IoC. Either fill the full order when hitting the orderbook, or cancel it| + |`RETAIL_PRICE_IMPROVEMENT` = 5|RPI - A GTT + PostOnly maker order, that can only be taken by non-algorithmic UI users.| + ??? info "[OrderLeg](/../../schemas/order_leg)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The instrument to trade in this leg| + |size
`s` |string|True|The total number of assets to trade in this leg, expressed in base asset decimal units.| + |limit_price
`lp` |string|False
`0`|The limit price of the order leg, expressed in `9` decimals.
This is the number of quote currency units to pay/receive for this leg.
This should be `null/0` if the order is a market order| + |is_buying_asset
`ib` |boolean|True|Specifies if the order leg is a buy or sell| + ??? info "[Signature](/../../schemas/signature)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |signer
`s` |string|True|The address (public key) of the wallet signing the payload| + |r
`r` |string|True|Signature R| + |s
`s1` |string|True|Signature S| + |v
`v` |integer|True|Signature V| + |expiration
`e` |string|True|Timestamp after which this signature expires, expressed in unix nanoseconds. Must be capped at 30 days| + |nonce
`n` |integer|True|Users can randomly generate this value, used as a signature deconflicting key.
ie. You can send the same exact instruction twice with different nonces.
When the same nonce is used, the same payload will generate the same signature.
Our system will consider the payload a duplicate, and ignore it.| + ??? info "[OrderMetadata](/../../schemas/order_metadata)" + Metadata fields are used to support Backend only operations. These operations are not trustless by nature.
Hence, fields in here are never signed, and is never transmitted to the smart contract.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| + |create_time
`ct` |string|False
`0`|[Filled by GRVT Backend] Time at which the order was received by GRVT in unix nanoseconds| + |trigger
`t` |TriggerOrderMetadata|False
``|Trigger fields are used to support any type of trigger order such as TP/SL| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + ??? info "[TriggerOrderMetadata](/../../schemas/trigger_order_metadata)" + Contains metadata related to trigger orders, such as Take Profit (TP) or Stop Loss (SL).

Trigger orders are used to automatically execute an order when a predefined price condition is met, allowing traders to implement risk management strategies.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_type
`tt` |TriggerType|True|Type of the trigger order. eg: Take Profit, Stop Loss, etc| + |tpsl
`t` |TPSLOrderMetadata|True|Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

| + ??? info "[TriggerType](/../../schemas/trigger_type)" + Defines the type of trigger order used in trading, such as Take Profit or Stop Loss.

Trigger orders allow execution based on pre-defined price conditions rather than immediate market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|Not a trigger order. The order executes normally without any trigger conditions.| + |`TAKE_PROFIT` = 1|Take Profit Order - Executes when the price reaches a specified level to secure profits.| + |`STOP_LOSS` = 2|Stop Loss Order - Executes when the price reaches a specified level to limit losses.| + ??? info "[TPSLOrderMetadata](/../../schemas/tpsl_order_metadata)" + Contains metadata for Take Profit (TP) and Stop Loss (SL) trigger orders.

### Fields:
- **triggerBy**: Defines the price type that activates the order (e.g., index price).
- **triggerPrice**: The price at which the order is triggered, expressed in `9` decimal precision.


+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |trigger_by
`tb` |TriggerBy|True|Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order| + |trigger_price
`tp` |string|True|The Trigger Price of the order, expressed in `9` decimals.| + |close_position
`cp` |boolean|True|If True, the order will close the position when the trigger price is reached| + ??? info "[TriggerBy](/../../schemas/trigger_by)" + Defines the price type that activates a Take Profit (TP) or Stop Loss (SL) order.

Trigger orders are executed when the selected price type reaches the specified trigger price.Different price types ensure flexibility in executing strategies based on market conditions.


+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|no trigger condition| + |`INDEX` = 1|INDEX - Order is activated when the index price reaches the trigger price| + |`LAST` = 2|LAST - Order is activated when the last trade price reaches the trigger price| + |`MID` = 3|MID - Order is activated when the mid price reaches the trigger price| + |`MARK` = 4|MARK - Order is activated when the mark price reaches the trigger price| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| + ??? info "[OrderState](/../../schemas/order_state)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |status
`s` |OrderStatus|True|The status of the order| + |reject_reason
`rr` |OrderRejectReason|True|The reason for rejection or cancellation| + |book_size
`bs` |[string]|True|The number of assets available for orderbook/RFQ matching. Sorted in same order as Order.Legs| + |traded_size
`ts` |[string]|True|The total number of assets traded. Sorted in same order as Order.Legs| + |update_time
`ut` |string|True|Time at which the order was updated by GRVT, expressed in unix nanoseconds| + |avg_fill_price
`af` |[string]|True|The average fill price of the order. Sorted in same order as Order.Legs| + ??? info "[OrderStatus](/../../schemas/order_status)" + |Value| Description | + |-|-| + |`PENDING` = 1|Order has been sent to the matching engine and is pending a transition to open/filled/rejected.| + |`OPEN` = 2|Order is actively matching on the matching engine, could be unfilled or partially filled.| + |`FILLED` = 3|Order is fully filled and hence closed. Taker Orders can transition directly from pending to filled, without going through open.| + |`REJECTED` = 4|Order is rejected by matching engine since if fails a particular check (See OrderRejectReason). Once an order is open, it cannot be rejected.| + |`CANCELLED` = 5|Order is cancelled by the user using one of the supported APIs (See OrderRejectReason). Before an order is open, it cannot be cancelled.| + ??? info "[OrderRejectReason](/../../schemas/order_reject_reason)" + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|order is not cancelled or rejected| + |`CLIENT_CANCEL` = 1|client called a Cancel API| + |`CLIENT_BULK_CANCEL` = 2|client called a Bulk Cancel API| + |`CLIENT_SESSION_END` = 3|client called a Session Cancel API, or set the WebSocket connection to 'cancelOrdersOnTerminate'| + |`MARKET_CANCEL` = 4|the market order was cancelled after no/partial fill. Lower precedence than other TimeInForce cancel reasons| + |`IOC_CANCEL` = 5|the IOC order was cancelled after no/partial fill| + |`AON_CANCEL` = 6|the AON order was cancelled as it could not be fully matched| + |`FOK_CANCEL` = 7|the FOK order was cancelled as it could not be fully matched| + |`EXPIRED` = 8|the order was cancelled as it has expired| + |`FAIL_POST_ONLY` = 9|the post-only order could not be posted into the orderbook| + |`FAIL_REDUCE_ONLY` = 10|the reduce-only order would have caused position size to increase| + |`MM_PROTECTION` = 11|the order was cancelled due to market maker protection trigger| + |`SELF_TRADE_PROTECTION` = 12|the order was cancelled due to self-trade protection trigger| + |`SELF_MATCHED_SUBACCOUNT` = 13|the order matched with another order from the same sub account| + |`OVERLAPPING_CLIENT_ORDER_ID` = 14|an active order on your sub account shares the same clientOrderId| + |`BELOW_MARGIN` = 15|the order will bring the sub account below initial margin requirement| + |`LIQUIDATION` = 16|the sub account is liquidated (and all open orders are cancelled by Gravity)| + |`INSTRUMENT_INVALID` = 17|instrument is invalid or not found on Gravity| + |`INSTRUMENT_DEACTIVATED` = 18|instrument is no longer tradable on Gravity. (typically due to a market halt, or instrument expiry)| + |`SYSTEM_FAILOVER` = 19|system failover resulting in loss of order state| + |`UNAUTHORISED` = 20|the credentials used (userSession/apiKeySession/walletSignature) is not authorised to perform the action| + |`SESSION_KEY_EXPIRED` = 21|the session key used to sign the order expired| + |`SUB_ACCOUNT_NOT_FOUND` = 22|the subaccount does not exist| + |`NO_TRADE_PERMISSION` = 23|the signature used to sign the order has no trade permission| + |`UNSUPPORTED_TIME_IN_FORCE` = 24|the order payload does not contain a supported TimeInForce value| + |`MULTI_LEGGED_ORDER` = 25|the order has multiple legs, but multiple legs are not supported by this venue| + |`EXCEED_MAX_POSITION_SIZE` = 26|the order would have caused the subaccount to exceed the max position size| + |`EXCEED_MAX_SIGNATURE_EXPIRATION` = 27|the signature supplied is more than 30 days in the future| + |`MARKET_ORDER_WITH_LIMIT_PRICE` = 28|the market order has a limit price set| + |`CLIENT_CANCEL_ON_DISCONNECT_TRIGGERED` = 29|client cancel on disconnect triggered| + |`OCO_COUNTER_PART_TRIGGERED` = 30|the OCO counter part order was triggered| + |`REDUCE_ONLY_LIMIT` = 31|the remaining order size was cancelled because it exceeded current position size| + |`CLIENT_REPLACE` = 32|the order was replaced by a client replace request| + |`DERISK_MUST_BE_IOC` = 33|the derisk order must be an IOC order| + |`DERISK_MUST_BE_REDUCE_ONLY` = 34|the derisk order must be a reduce-only order| + |`DERISK_NOT_SUPPORTED` = 35|derisk is not supported| + |`INVALID_ORDER_TYPE` = 36|the order type is invalid| + |`CURRENCY_NOT_DEFINED` = 37|the currency is not defined| diff --git a/docs/grvt/schemas/api_dedust_position_request.md b/docs/grvt/schemas/api_dedust_position_request.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/grvt/schemas/api_dedust_position_response.md b/docs/grvt/schemas/api_dedust_position_response.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/grvt/schemas/api_deposit_history_request.md b/docs/grvt/schemas/api_deposit_history_request.md new file mode 100644 index 0000000..f5159be --- /dev/null +++ b/docs/grvt/schemas/api_deposit_history_request.md @@ -0,0 +1,11 @@ +!!! info "[ApiDepositHistoryRequest](/../../schemas/api_deposit_history_request)" + The request to get the historical deposits of an account
The history is returned in reverse chronological order

Pagination works as follows:
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |currency
`c` |[string]|True|The token currency to query for, if nil or empty, return all deposits. Otherwise, only entries matching the filter will be returned| + |start_time
`st` |string|False
`0`|The start time to query for in unix nanoseconds| + |end_time
`et` |string|False
`now()`|The end time to query for in unix nanoseconds| + |limit
`l` |integer|False
`500`|The limit to query for. Defaults to 500; Max 1000| + |cursor
`c1` |string|False
`''`|The cursor to indicate when to start the next query from| + |main_account_id
`ma` |string|False
``|Main account ID being queried. By default, applies the requestor's main account ID.| diff --git a/docs/grvt/schemas/api_deposit_history_response.md b/docs/grvt/schemas/api_deposit_history_response.md new file mode 100644 index 0000000..6246bd9 --- /dev/null +++ b/docs/grvt/schemas/api_deposit_history_response.md @@ -0,0 +1,16 @@ +!!! info "[ApiDepositHistoryResponse](/../../schemas/api_deposit_history_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[DepositHistory]|True|The deposit history matching the request account| + |next
`n` |string|False
`''`|The cursor to indicate when to start the next query from| + ??? info "[DepositHistory](/../../schemas/deposit_history)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |l_1_hash
`l1` |string|True|The L1 txHash of the deposit| + |l_2_hash
`l2` |string|True|The L2 txHash of the deposit| + |to_account_id
`ta` |string|True|The account to deposit into| + |currency
`c` |string|True|The token currency to deposit| + |num_tokens
`nt` |string|True|The number of tokens to deposit| + |initiated_time
`it` |string|True|The timestamp when the deposit was initiated on L1 in unix nanoseconds| + |confirmed_time
`ct` |string|True|The timestamp when the deposit was confirmed on L2 in unix nanoseconds| + |from_address
`fa` |string|True|The address of the sender| diff --git a/docs/grvt/schemas/api_deposit_request.md b/docs/grvt/schemas/api_deposit_request.md new file mode 100644 index 0000000..b90862a --- /dev/null +++ b/docs/grvt/schemas/api_deposit_request.md @@ -0,0 +1,18 @@ +!!! info "[ApiDepositRequest](/../../schemas/api_deposit_request)" + GRVT runs on a ZKSync Hyperchain which settles directly onto Ethereum.
To Deposit funds from your L1 wallet into a GRVT SubAccount, you will be required to submit a deposit transaction directly to Ethereum.
GRVT's bridge verifier will scan Ethereum from time to time. Once it receives proof that your deposit has been confirmed on Ethereum, it will initiate the deposit process.

This current payload is used for alpha testing only.
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |to_account_id
`ta` |string|True|The main account to deposit into| + |currency
`c` |Currency|True|The token currency to deposit| + |num_tokens
`nt` |string|True|The number of tokens to deposit, quoted in token_currency decimals| + ??? info "[Currency](/../../schemas/currency)" + The list of Currencies that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`USD` = 1|the USD fiat currency| + |`USDC` = 2|the USDC token| + |`USDT` = 3|the USDT token| + |`ETH` = 4|the ETH token| + |`BTC` = 5|the BTC token| diff --git a/docs/grvt/schemas/api_drop_client_ws_request.md b/docs/grvt/schemas/api_drop_client_ws_request.md new file mode 100644 index 0000000..4fdfe35 --- /dev/null +++ b/docs/grvt/schemas/api_drop_client_ws_request.md @@ -0,0 +1,4 @@ +!!! info "[ApiDropClientWsRequest](/../../schemas/api_drop_client_ws_request)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |main_account_id
`ma` |string|True|| diff --git a/docs/grvt/schemas/api_drop_client_ws_response.md b/docs/grvt/schemas/api_drop_client_ws_response.md new file mode 100644 index 0000000..8e7b4b5 --- /dev/null +++ b/docs/grvt/schemas/api_drop_client_ws_response.md @@ -0,0 +1,4 @@ +!!! info "[ApiDropClientWsResponse](/../../schemas/api_drop_client_ws_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |num_dropped
`nd` |integer|True|| diff --git a/docs/grvt/schemas/api_fill_history_request.md b/docs/grvt/schemas/api_fill_history_request.md new file mode 100644 index 0000000..760368c --- /dev/null +++ b/docs/grvt/schemas/api_fill_history_request.md @@ -0,0 +1,22 @@ +!!! info "[ApiFillHistoryRequest](/../../schemas/api_fill_history_request)" + Query for all historical fills made by a single account. A single order can be matched multiple times, hence there is no real way to uniquely identify a trade.

Pagination works as follows:
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The sub account ID to request for| + |kind
`k` |[Kind]|False
`all`|The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned| + |base
`b` |[string]|False
`all`|The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned| + |quote
`q` |[string]|False
`all`|The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned| + |start_time
`st` |string|False
`0`|The start time to apply in unix nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned| + |end_time
`et` |string|False
`now()`|The end time to apply in unix nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned| + |limit
`l` |integer|False
`500`|The limit to query for. Defaults to 500; Max 1000| + |cursor
`c` |string|False
`''`|The cursor to indicate when to start the query from| + ??? info "[Kind](/../../schemas/kind)" + The list of asset kinds that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`PERPETUAL` = 1|the perpetual asset kind| + |`FUTURE` = 2|the future asset kind| + |`CALL` = 3|the call option asset kind| + |`PUT` = 4|the put option asset kind| diff --git a/docs/grvt/schemas/api_fill_history_response.md b/docs/grvt/schemas/api_fill_history_response.md new file mode 100644 index 0000000..65a847a --- /dev/null +++ b/docs/grvt/schemas/api_fill_history_response.md @@ -0,0 +1,45 @@ +!!! info "[ApiFillHistoryResponse](/../../schemas/api_fill_history_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[Fill]|True|The private trades matching the request asset| + |next
`n` |string|True|The cursor to indicate when to start the query from| + ??? info "[Fill](/../../schemas/fill)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |event_time
`et` |string|True|Time at which the event was emitted in unix nanoseconds| + |sub_account_id
`sa` |string|True|The sub account ID that participated in the trade| + |instrument
`i` |string|True|The instrument being represented| + |is_buyer
`ib` |boolean|True|The side that the subaccount took on the trade| + |is_taker
`it` |boolean|True|The role that the subaccount took on the trade| + |size
`s` |string|True|The number of assets being traded, expressed in base asset decimal units| + |price
`p` |string|True|The traded price, expressed in `9` decimals| + |mark_price
`mp` |string|True|The mark price of the instrument at point of trade, expressed in `9` decimals| + |index_price
`ip` |string|True|The index price of the instrument at point of trade, expressed in `9` decimals| + |interest_rate
`ir` |string|True|The interest rate of the underlying at point of trade, expressed in centibeeps (1/100th of a basis point)| + |forward_price
`fp` |string|True|[Options] The forward price of the option at point of trade, expressed in `9` decimals| + |realized_pnl
`rp` |string|True|The realized PnL of the trade, expressed in quote asset decimal units (0 if increasing position size)| + |fee
`f` |string|True|The fees paid on the trade, expressed in quote asset decimal unit (negative if maker rebate applied)| + |fee_rate
`fr` |string|True|The fee rate paid on the trade| + |trade_id
`ti` |string|True|A trade identifier, globally unique, and monotonically increasing (not by `1`).
All trades sharing a single taker execution share the same first component (before `-`), and `event_time`.
`trade_id` is guaranteed to be consistent across MarketData `Trade` and Trading `Fill`.| + |order_id
`oi` |string|True|An order identifier| + |venue
`v` |Venue|True|The venue where the trade occurred| + |client_order_id
`co` |string|True|A unique identifier for the active order within a subaccount, specified by the client
This is used to identify the order in the client's system
This field can be used for order amendment/cancellation, but has no bearing on the smart contract layer
This field will not be propagated to the smart contract, and should not be signed by the client
This value must be unique for all active orders in a subaccount, or amendment/cancellation will not work as expected
Gravity UI will generate a random clientOrderID for each order in the range [0, 2^63 - 1]
To prevent any conflicts, client machines should generate a random clientOrderID in the range [2^63, 2^64 - 1]

When GRVT Backend receives an order with an overlapping clientOrderID, we will reject the order with rejectReason set to overlappingClientOrderId| + |signer
`s1` |string|True|The address (public key) of the wallet signing the payload| + |broker
`b` |BrokerTag|False
``|Specifies the broker who brokered the order| + |is_rpi
`ir1` |boolean|True|If the trade is a RPI trade| + ??? info "[Venue](/../../schemas/venue)" + The list of Trading Venues that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| + |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[BrokerTag](/../../schemas/broker_tag)" + BrokerTag is a tag for the broker that the order is sent from.
+ + |Value| Description | + |-|-| + |`UNSPECIFIED` = 0|| + |`COIN_ROUTES` = 1|CoinRoutes| + |`ALERTATRON` = 2|Alertatron| + |`ORIGAMI` = 3|Origami| diff --git a/docs/grvt/schemas/api_find_ecosystem_epoch_metric_response.md b/docs/grvt/schemas/api_find_ecosystem_epoch_metric_response.md new file mode 100644 index 0000000..c48ebd4 --- /dev/null +++ b/docs/grvt/schemas/api_find_ecosystem_epoch_metric_response.md @@ -0,0 +1,17 @@ +!!! info "[ApiFindEcosystemEpochMetricResponse](/../../schemas/api_find_ecosystem_epoch_metric_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |metric
`m` |EcosystemMetric|True|The epoch metric| + |rank
`r` |integer|True|The rank of the account in the ecosystem| + |total
`t` |integer|True|The total number of accounts in the ecosystem| + |last_calculated_at
`lc` |string|True|The time when the ecosystem points were last calculated| + |total_direct_invite_count
`td` |integer|True|Direct invite count without relying on epochs| + |total_indirect_invite_count
`ti` |integer|True|Indirect invite count without relying on epochs| + ??? info "[EcosystemMetric](/../../schemas/ecosystem_metric)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |direct_invite_count
`di` |integer|True|Direct invite count| + |indirect_invite_count
`ii` |integer|True|Indirect invite count| + |direct_invite_trading_volume
`di1` |string|True|Direct invite trading volume| + |indirect_invite_trading_volume
`ii1` |string|True|Indirect invite trading volume| + |total_point
`tp` |string|True|Total ecosystem point of this epoch/phase| diff --git a/docs/grvt/schemas/api_find_ecosystem_leaderboard_response.md b/docs/grvt/schemas/api_find_ecosystem_leaderboard_response.md new file mode 100644 index 0000000..a4399ef --- /dev/null +++ b/docs/grvt/schemas/api_find_ecosystem_leaderboard_response.md @@ -0,0 +1,11 @@ +!!! info "[ApiFindEcosystemLeaderboardResponse](/../../schemas/api_find_ecosystem_leaderboard_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |users
`u` |[EcosystemLeaderboardUser]|True|The list of ecosystem leaderboard users| + ??? info "[EcosystemLeaderboardUser](/../../schemas/ecosystem_leaderboard_user)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |rank
`r` |integer|True|The rank of the account in the ecosystem| + |total_point
`tp` |string|True|Total ecosystem point| + |twitter_username
`tu` |string|True|The twitter username of the account| diff --git a/docs/grvt/schemas/api_find_first_epoch_metric_response.md b/docs/grvt/schemas/api_find_first_epoch_metric_response.md new file mode 100644 index 0000000..a5788a9 --- /dev/null +++ b/docs/grvt/schemas/api_find_first_epoch_metric_response.md @@ -0,0 +1,25 @@ +!!! info "[ApiFindFirstEpochMetricResponse](/../../schemas/api_find_first_epoch_metric_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |phase_zero_metric
`pz` |EcosystemMetric|True|Phase zero metric| + |phase_one_metric
`po` |EcosystemMetric|True|Phase one metric| + |rank
`r` |integer|True|The rank of the account in the ecosystem| + |total
`t` |integer|True|The total number of accounts in the ecosystem| + |total_point
`tp` |string|True|Total ecosystem point of the first epoch| + |last_calculated_at
`lc` |string|True|The time when the ecosystem points were last calculated| + ??? info "[EcosystemMetric](/../../schemas/ecosystem_metric)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |direct_invite_count
`di` |integer|True|Direct invite count| + |indirect_invite_count
`ii` |integer|True|Indirect invite count| + |direct_invite_trading_volume
`di1` |string|True|Direct invite trading volume| + |indirect_invite_trading_volume
`ii1` |string|True|Indirect invite trading volume| + |total_point
`tp` |string|True|Total ecosystem point of this epoch/phase| + ??? info "[EcosystemMetric](/../../schemas/ecosystem_metric)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |direct_invite_count
`di` |integer|True|Direct invite count| + |indirect_invite_count
`ii` |integer|True|Indirect invite count| + |direct_invite_trading_volume
`di1` |string|True|Direct invite trading volume| + |indirect_invite_trading_volume
`ii1` |string|True|Indirect invite trading volume| + |total_point
`tp` |string|True|Total ecosystem point of this epoch/phase| diff --git a/docs/grvt/schemas/api_find_trader_epoch_metric_response.md b/docs/grvt/schemas/api_find_trader_epoch_metric_response.md new file mode 100644 index 0000000..912603d --- /dev/null +++ b/docs/grvt/schemas/api_find_trader_epoch_metric_response.md @@ -0,0 +1,12 @@ +!!! info "[ApiFindTraderEpochMetricResponse](/../../schemas/api_find_trader_epoch_metric_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |metric
`m` |TraderMetric|True|Phase zero metric| + |rank
`r` |integer|True|The rank of the account in the trader| + |total
`t` |integer|True|The total number of accounts in the trader| + |last_calculated_at
`lc` |string|True|The time when the trader points were last calculated| + ??? info "[TraderMetric](/../../schemas/trader_metric)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |total_fee
`tf` |string|True|Total fee paid| + |total_point
`tp` |number|True|Total trader point of this epoch/phase| diff --git a/docs/grvt/schemas/api_find_trader_leaderboard_response.md b/docs/grvt/schemas/api_find_trader_leaderboard_response.md new file mode 100644 index 0000000..7e17222 --- /dev/null +++ b/docs/grvt/schemas/api_find_trader_leaderboard_response.md @@ -0,0 +1,11 @@ +!!! info "[ApiFindTraderLeaderboardResponse](/../../schemas/api_find_trader_leaderboard_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |users
`u` |[TraderLeaderboardUser]|True|The list of trader leaderboard users| + ??? info "[TraderLeaderboardUser](/../../schemas/trader_leaderboard_user)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |rank
`r` |integer|True|The rank of the account in the Trader| + |total_point
`tp` |number|True|Total Trader point| + |twitter_username
`tu` |string|True|The twitter username of the account| diff --git a/docs/grvt/schemas/api_funding_account_summary_response.md b/docs/grvt/schemas/api_funding_account_summary_response.md new file mode 100644 index 0000000..74d6b4b --- /dev/null +++ b/docs/grvt/schemas/api_funding_account_summary_response.md @@ -0,0 +1,38 @@ +!!! info "[ApiFundingAccountSummaryResponse](/../../schemas/api_funding_account_summary_response)" + The funding account summary, that reports the total equity and spot balances of a funding (main) account
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |FundingAccountSummary|True|The funding account summary| + |tier
`t` |ClientTier|True|Client fee tier at the time of query| + ??? info "[FundingAccountSummary](/../../schemas/funding_account_summary)" + The funding account summary, that reports the total equity and spot balances of a funding (main) account
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |main_account_id
`ma` |string|True|The main account ID of the account to which the summary belongs| + |total_equity
`te` |string|True|Total equity of the main account, denominated in USD| + |spot_balances
`sb` |[SpotBalance]|True|The list of spot assets owned by this main account, and their balances| + |vault_investments
`vi` |[VaultInvestment]|True|The list of vault investments held by this main account| + ??? info "[SpotBalance](/../../schemas/spot_balance)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |currency
`c` |string|True|The currency you hold a spot balance in| + |balance
`b` |string|True|This currency's balance in this trading account.| + |index_price
`ip` |string|True|The index price of this currency. (reported in `USD`)| + ??? info "[VaultInvestment](/../../schemas/vault_investment)" + Summarizes a vault investment held by a funding account
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |vault_id
`vi` |string|True|The trading account ID of the vault invested in.| + |num_lp_tokens
`nl` |string|True|The number of shares held by the investor.| + |share_price
`sp` |string|True|The current share price (in USD) of this vault investment.| + ??? info "[ClientTier](/../../schemas/client_tier)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |tier
`t` |integer|True|| + |futures_taker_fee
`ft` |integer|True|| + |futures_maker_fee
`fm` |integer|True|| + |options_taker_fee
`ot` |integer|True|| + |options_maker_fee
`om` |integer|True|| diff --git a/docs/grvt/schemas/api_funding_payment_history_request.md b/docs/grvt/schemas/api_funding_payment_history_request.md new file mode 100644 index 0000000..33f4166 --- /dev/null +++ b/docs/grvt/schemas/api_funding_payment_history_request.md @@ -0,0 +1,11 @@ +!!! info "[ApiFundingPaymentHistoryRequest](/../../schemas/api_funding_payment_history_request)" + Query for all historical funding payments made by a single account.

Pagination works as follows:
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The sub account ID to request for| + |instrument
`i` |string|False
`all`|The perpetual instrument to filter for| + |start_time
`st` |string|False
`0`|The start time to apply in unix nanoseconds. If nil, this defaults to all start times. Otherwise, only entries matching the filter will be returned| + |end_time
`et` |string|False
`now()`|The end time to apply in unix nanoseconds. If nil, this defaults to all end times. Otherwise, only entries matching the filter will be returned| + |limit
`l` |integer|False
`500`|The limit to query for. Defaults to 500; Max 1000| + |cursor
`c` |string|False
`''`|The cursor to indicate when to start the query from| diff --git a/docs/grvt/schemas/api_funding_payment_history_response.md b/docs/grvt/schemas/api_funding_payment_history_response.md new file mode 100644 index 0000000..4d807cb --- /dev/null +++ b/docs/grvt/schemas/api_funding_payment_history_response.md @@ -0,0 +1,14 @@ +!!! info "[ApiFundingPaymentHistoryResponse](/../../schemas/api_funding_payment_history_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[FundingPayment]|True|The funding payments matching the request asset| + |next
`n` |string|True|The cursor to indicate when to start the query from| + ??? info "[FundingPayment](/../../schemas/funding_payment)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |event_time
`et` |string|True|Time at which the event was emitted in unix nanoseconds| + |sub_account_id
`sa` |string|True|The sub account ID that made the funding payment| + |instrument
`i` |string|True|The perpetual instrument being funded| + |currency
`c` |string|True|The currency of the funding payment| + |amount
`a` |string|True|The amount of the funding payment. Positive if paid, negative if received| + |tx_id
`ti` |string|True|The transaction ID of the funding payment.
Funding payments can be triggered by a trade, transfer, or liquidation.
The `tx_id` will match the corresponding `trade_id` or `tx_id`.| diff --git a/docs/grvt/schemas/api_funding_rate_request.md b/docs/grvt/schemas/api_funding_rate_request.md new file mode 100644 index 0000000..6389aa5 --- /dev/null +++ b/docs/grvt/schemas/api_funding_rate_request.md @@ -0,0 +1,10 @@ +!!! info "[ApiFundingRateRequest](/../../schemas/api_funding_rate_request)" + Lookup the historical funding rate of a perpetual future.

Pagination works as follows:
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The readable instrument name:| + |start_time
`st` |string|False
`0`|Start time of funding rate in unix nanoseconds| + |end_time
`et` |string|False
`now()`|End time of funding rate in unix nanoseconds| + |limit
`l` |integer|False
`500`|The limit to query for. Defaults to 500; Max 1000| + |cursor
`c` |string|False
`''`|The cursor to indicate when to start the query from| diff --git a/docs/grvt/schemas/api_funding_rate_response.md b/docs/grvt/schemas/api_funding_rate_response.md new file mode 100644 index 0000000..01e2a1c --- /dev/null +++ b/docs/grvt/schemas/api_funding_rate_response.md @@ -0,0 +1,13 @@ +!!! info "[ApiFundingRateResponse](/../../schemas/api_funding_rate_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[FundingRate]|True|The funding rate result set for given interval| + |next
`n` |string|False
`''`|The cursor to indicate when to start the next query from| + ??? info "[FundingRate](/../../schemas/funding_rate)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The readable instrument name:| + |funding_rate
`fr` |string|True|The funding rate of the instrument, expressed in percentage points| + |funding_time
`ft` |string|True|The funding timestamp of the funding rate, expressed in unix nanoseconds| + |mark_price
`mp` |string|True|The mark price of the instrument at funding timestamp, expressed in `9` decimals| + |funding_rate_8_h_avg
`fr1` |string|True|The 8h average funding rate of the instrument, expressed in percentage points| diff --git a/docs/grvt/schemas/api_get_all_initial_leverage_request.md b/docs/grvt/schemas/api_get_all_initial_leverage_request.md new file mode 100644 index 0000000..e09d435 --- /dev/null +++ b/docs/grvt/schemas/api_get_all_initial_leverage_request.md @@ -0,0 +1,6 @@ +!!! info "[ApiGetAllInitialLeverageRequest](/../../schemas/api_get_all_initial_leverage_request)" + The request to get the initial leverage of a sub account
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |sub_account_id
`sa` |string|True|The sub account ID to get the leverage for| diff --git a/docs/grvt/schemas/api_get_all_initial_leverage_response.md b/docs/grvt/schemas/api_get_all_initial_leverage_response.md new file mode 100644 index 0000000..55a1e63 --- /dev/null +++ b/docs/grvt/schemas/api_get_all_initial_leverage_response.md @@ -0,0 +1,13 @@ +!!! info "[ApiGetAllInitialLeverageResponse](/../../schemas/api_get_all_initial_leverage_response)" + The response to get the initial leverage of a sub account
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |results
`r` |[InitialLeverageResult]|True|The initial leverage of the sub account| + ??? info "[InitialLeverageResult](/../../schemas/initial_leverage_result)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The instrument to get the leverage for| + |leverage
`l` |string|True|The initial leverage of the sub account| + |min_leverage
`ml` |string|True|The min leverage this sub account can set| + |max_leverage
`ml1` |string|True|The max leverage this sub account can set| diff --git a/docs/grvt/schemas/api_get_all_instruments_request.md b/docs/grvt/schemas/api_get_all_instruments_request.md new file mode 100644 index 0000000..c13510d --- /dev/null +++ b/docs/grvt/schemas/api_get_all_instruments_request.md @@ -0,0 +1,6 @@ +!!! info "[ApiGetAllInstrumentsRequest](/../../schemas/api_get_all_instruments_request)" + Fetch all instruments
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |is_active
`ia` |boolean|False
`false`|Fetch only active instruments| diff --git a/docs/grvt/schemas/api_get_all_instruments_response.md b/docs/grvt/schemas/api_get_all_instruments_response.md new file mode 100644 index 0000000..855cfa6 --- /dev/null +++ b/docs/grvt/schemas/api_get_all_instruments_response.md @@ -0,0 +1,44 @@ +!!! info "[ApiGetAllInstrumentsResponse](/../../schemas/api_get_all_instruments_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[Instrument]|True|List of instruments| + ??? info "[Instrument](/../../schemas/instrument)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The readable instrument name:| + |instrument_hash
`ih` |string|True|The asset ID used for instrument signing.| + |base
`b` |string|True|The base currency| + |quote
`q` |string|True|The quote currency| + |kind
`k` |Kind|True|The kind of instrument| + |venues
`v` |[Venue]|True|Venues that this instrument can be traded at| + |settlement_period
`sp1` |InstrumentSettlementPeriod|True|The settlement period of the instrument| + |base_decimals
`bd` |integer|True|The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)| + |quote_decimals
`qd` |integer|True|The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)| + |tick_size
`ts` |string|True|The size of a single tick, expressed in price decimal units| + |min_size
`ms` |string|True|The minimum contract size, expressed in base asset decimal units| + |create_time
`ct` |string|True|Creation time in unix nanoseconds| + |max_position_size
`mp` |string|True|The maximum position size, expressed in base asset decimal units| + ??? info "[Kind](/../../schemas/kind)" + The list of asset kinds that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`PERPETUAL` = 1|the perpetual asset kind| + |`FUTURE` = 2|the future asset kind| + |`CALL` = 3|the call option asset kind| + |`PUT` = 4|the put option asset kind| + ??? info "[Venue](/../../schemas/venue)" + The list of Trading Venues that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| + |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[InstrumentSettlementPeriod](/../../schemas/instrument_settlement_period)" + |Value| Description | + |-|-| + |`PERPETUAL` = 1|Instrument settles through perpetual funding cycles| + |`DAILY` = 2|Instrument settles at an expiry date, marked as a daily instrument| + |`WEEKLY` = 3|Instrument settles at an expiry date, marked as a weekly instrument| + |`MONTHLY` = 4|Instrument settles at an expiry date, marked as a monthly instrument| + |`QUARTERLY` = 5|Instrument settles at an expiry date, marked as a quarterly instrument| diff --git a/docs/grvt/schemas/api_get_currency_request.md b/docs/grvt/schemas/api_get_currency_request.md new file mode 100644 index 0000000..3f1e496 --- /dev/null +++ b/docs/grvt/schemas/api_get_currency_request.md @@ -0,0 +1,5 @@ +!!! info "[ApiGetCurrencyRequest](/../../schemas/api_get_currency_request)" + Fetch all currencies
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| diff --git a/docs/grvt/schemas/api_get_currency_response.md b/docs/grvt/schemas/api_get_currency_response.md new file mode 100644 index 0000000..4ef131c --- /dev/null +++ b/docs/grvt/schemas/api_get_currency_response.md @@ -0,0 +1,13 @@ +!!! info "[ApiGetCurrencyResponse](/../../schemas/api_get_currency_response)" + The list of currencies
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[CurrencyDetail]|True|The list of currencies| + ??? info "[CurrencyDetail](/../../schemas/currency_detail)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |id
`i` |integer|True|The integer value of the currency| + |symbol
`s` |string|True|The name of the currency| + |balance_decimals
`bd` |integer|True|The balance decimals of the currency| + |quantity_multiplier
`qm` |string|True|The quantity multiplier of the currency| diff --git a/docs/grvt/schemas/api_get_ecosystem_leaderboard_request.md b/docs/grvt/schemas/api_get_ecosystem_leaderboard_request.md new file mode 100644 index 0000000..209678b --- /dev/null +++ b/docs/grvt/schemas/api_get_ecosystem_leaderboard_request.md @@ -0,0 +1,5 @@ +!!! info "[ApiGetEcosystemLeaderboardRequest](/../../schemas/api_get_ecosystem_leaderboard_request)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |calculate_from
`cf` |string|True|Start time of the epoch - phase| + |limit
`l` |integer|True|The number of accounts to return| diff --git a/docs/grvt/schemas/api_get_ecosystem_leaderboard_response.md b/docs/grvt/schemas/api_get_ecosystem_leaderboard_response.md new file mode 100644 index 0000000..32f12c8 --- /dev/null +++ b/docs/grvt/schemas/api_get_ecosystem_leaderboard_response.md @@ -0,0 +1,25 @@ +!!! info "[ApiGetEcosystemLeaderboardResponse](/../../schemas/api_get_ecosystem_leaderboard_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |points
`p` |[EcosystemPoint]|True|The list of ecosystem points| + ??? info "[EcosystemPoint](/../../schemas/ecosystem_point)" +
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |main_account_id
`ma` |string|True|The main account id| + |total_point
`tp` |string|True|Total ecosystem point| + |direct_invite_count
`di` |integer|True|Direct invite count| + |indirect_invite_count
`ii` |integer|True|Indirect invite count| + |direct_invite_trading_volume
`di1` |string|True|Direct invite trading volume| + |indirect_invite_trading_volume
`ii1` |string|True|Indirect invite trading volume| + |calculate_at
`ca` |string|True|The time when the ecosystem point is calculated| + |calculate_from
`cf` |string|True|Start time of the epoch - phase| + |calculate_to
`ct` |string|True|End time of the epoch - phase| + |rank
`r` |integer|True|The rank of the account in the ecosystem| + |epoch
`e` |integer|True|The epoch number of the ecosystem point| + |brokered_trading_volume
`bt` |string|True|Brokered trading volume| + |brokered_trading_point
`bt1` |string|True|Brokered trading point| + |referee_kyc_point
`rk` |string|True|Referee KYC point| + |referrer_kyc_point
`rk1` |string|True|Referrer KYC point| diff --git a/docs/grvt/schemas/api_get_ecosystem_referral_stat_response.md b/docs/grvt/schemas/api_get_ecosystem_referral_stat_response.md new file mode 100644 index 0000000..a8c80f0 --- /dev/null +++ b/docs/grvt/schemas/api_get_ecosystem_referral_stat_response.md @@ -0,0 +1,7 @@ +!!! info "[ApiGetEcosystemReferralStatResponse](/../../schemas/api_get_ecosystem_referral_stat_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |direct_invite_count
`di` |integer|True|Direct invite count| + |indirect_invite_count
`ii` |integer|True|Indirect invite count| + |direct_invite_trading_volume
`di1` |string|True|Total volume traded by direct invites multiple by 1e9| + |indirect_invite_trading_volume
`ii1` |string|True|Total volume traded by indirect invites multiple by 1e9| diff --git a/docs/grvt/schemas/api_get_filtered_instruments_request.md b/docs/grvt/schemas/api_get_filtered_instruments_request.md new file mode 100644 index 0000000..4df33a8 --- /dev/null +++ b/docs/grvt/schemas/api_get_filtered_instruments_request.md @@ -0,0 +1,19 @@ +!!! info "[ApiGetFilteredInstrumentsRequest](/../../schemas/api_get_filtered_instruments_request)" + Fetch a list of instruments based on the filters provided
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |kind
`k` |[Kind]|False
`all`|The kind filter to apply. If nil, this defaults to all kinds. Otherwise, only entries matching the filter will be returned| + |base
`b` |[string]|False
`all`|The base filter to apply. If nil, this defaults to all bases. Otherwise, only entries matching the filter will be returned| + |quote
`q` |[string]|False
`all`|The quote filter to apply. If nil, this defaults to all quotes. Otherwise, only entries matching the filter will be returned| + |is_active
`ia` |boolean|False
`false`|Request for active instruments only| + |limit
`l` |integer|False
`500`|The limit to query for. Defaults to 500; Max 100000| + ??? info "[Kind](/../../schemas/kind)" + The list of asset kinds that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`PERPETUAL` = 1|the perpetual asset kind| + |`FUTURE` = 2|the future asset kind| + |`CALL` = 3|the call option asset kind| + |`PUT` = 4|the put option asset kind| diff --git a/docs/grvt/schemas/api_get_filtered_instruments_response.md b/docs/grvt/schemas/api_get_filtered_instruments_response.md new file mode 100644 index 0000000..954ee2f --- /dev/null +++ b/docs/grvt/schemas/api_get_filtered_instruments_response.md @@ -0,0 +1,44 @@ +!!! info "[ApiGetFilteredInstrumentsResponse](/../../schemas/api_get_filtered_instruments_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[Instrument]|True|The instruments matching the request filter| + ??? info "[Instrument](/../../schemas/instrument)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The readable instrument name:| + |instrument_hash
`ih` |string|True|The asset ID used for instrument signing.| + |base
`b` |string|True|The base currency| + |quote
`q` |string|True|The quote currency| + |kind
`k` |Kind|True|The kind of instrument| + |venues
`v` |[Venue]|True|Venues that this instrument can be traded at| + |settlement_period
`sp1` |InstrumentSettlementPeriod|True|The settlement period of the instrument| + |base_decimals
`bd` |integer|True|The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)| + |quote_decimals
`qd` |integer|True|The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)| + |tick_size
`ts` |string|True|The size of a single tick, expressed in price decimal units| + |min_size
`ms` |string|True|The minimum contract size, expressed in base asset decimal units| + |create_time
`ct` |string|True|Creation time in unix nanoseconds| + |max_position_size
`mp` |string|True|The maximum position size, expressed in base asset decimal units| + ??? info "[Kind](/../../schemas/kind)" + The list of asset kinds that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`PERPETUAL` = 1|the perpetual asset kind| + |`FUTURE` = 2|the future asset kind| + |`CALL` = 3|the call option asset kind| + |`PUT` = 4|the put option asset kind| + ??? info "[Venue](/../../schemas/venue)" + The list of Trading Venues that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| + |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[InstrumentSettlementPeriod](/../../schemas/instrument_settlement_period)" + |Value| Description | + |-|-| + |`PERPETUAL` = 1|Instrument settles through perpetual funding cycles| + |`DAILY` = 2|Instrument settles at an expiry date, marked as a daily instrument| + |`WEEKLY` = 3|Instrument settles at an expiry date, marked as a weekly instrument| + |`MONTHLY` = 4|Instrument settles at an expiry date, marked as a monthly instrument| + |`QUARTERLY` = 5|Instrument settles at an expiry date, marked as a quarterly instrument| diff --git a/docs/grvt/schemas/api_get_instrument_request.md b/docs/grvt/schemas/api_get_instrument_request.md new file mode 100644 index 0000000..a54cf3f --- /dev/null +++ b/docs/grvt/schemas/api_get_instrument_request.md @@ -0,0 +1,6 @@ +!!! info "[ApiGetInstrumentRequest](/../../schemas/api_get_instrument_request)" + Fetch a single instrument by supplying the asset or instrument name
+ + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The readable instrument name:| diff --git a/docs/grvt/schemas/api_get_instrument_response.md b/docs/grvt/schemas/api_get_instrument_response.md new file mode 100644 index 0000000..a5b2bed --- /dev/null +++ b/docs/grvt/schemas/api_get_instrument_response.md @@ -0,0 +1,44 @@ +!!! info "[ApiGetInstrumentResponse](/../../schemas/api_get_instrument_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |Instrument|True|The instrument matching the request asset| + ??? info "[Instrument](/../../schemas/instrument)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |instrument
`i` |string|True|The readable instrument name:| + |instrument_hash
`ih` |string|True|The asset ID used for instrument signing.| + |base
`b` |string|True|The base currency| + |quote
`q` |string|True|The quote currency| + |kind
`k` |Kind|True|The kind of instrument| + |venues
`v` |[Venue]|True|Venues that this instrument can be traded at| + |settlement_period
`sp1` |InstrumentSettlementPeriod|True|The settlement period of the instrument| + |base_decimals
`bd` |integer|True|The smallest denomination of the base asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)| + |quote_decimals
`qd` |integer|True|The smallest denomination of the quote asset supported by GRVT (+3 represents 0.001, -3 represents 1000, 0 represents 1)| + |tick_size
`ts` |string|True|The size of a single tick, expressed in price decimal units| + |min_size
`ms` |string|True|The minimum contract size, expressed in base asset decimal units| + |create_time
`ct` |string|True|Creation time in unix nanoseconds| + |max_position_size
`mp` |string|True|The maximum position size, expressed in base asset decimal units| + ??? info "[Kind](/../../schemas/kind)" + The list of asset kinds that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`PERPETUAL` = 1|the perpetual asset kind| + |`FUTURE` = 2|the future asset kind| + |`CALL` = 3|the call option asset kind| + |`PUT` = 4|the put option asset kind| + ??? info "[Venue](/../../schemas/venue)" + The list of Trading Venues that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`ORDERBOOK` = 1|the trade is cleared on the orderbook venue| + |`RFQ` = 2|the trade is cleared on the RFQ venue| + ??? info "[InstrumentSettlementPeriod](/../../schemas/instrument_settlement_period)" + |Value| Description | + |-|-| + |`PERPETUAL` = 1|Instrument settles through perpetual funding cycles| + |`DAILY` = 2|Instrument settles at an expiry date, marked as a daily instrument| + |`WEEKLY` = 3|Instrument settles at an expiry date, marked as a weekly instrument| + |`MONTHLY` = 4|Instrument settles at an expiry date, marked as a monthly instrument| + |`QUARTERLY` = 5|Instrument settles at an expiry date, marked as a quarterly instrument| diff --git a/docs/grvt/schemas/api_get_latest_lp_snapshot_request.md b/docs/grvt/schemas/api_get_latest_lp_snapshot_request.md new file mode 100644 index 0000000..7862abb --- /dev/null +++ b/docs/grvt/schemas/api_get_latest_lp_snapshot_request.md @@ -0,0 +1,45 @@ +!!! info "[ApiGetLatestLPSnapshotRequest](/../../schemas/api_get_latest_lp_snapshot_request)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |kind
`k` |Kind|False
`0`|The kind filter to apply| + |base
`b` |Currency|False
`0`|The base filter to apply| + ??? info "[Kind](/../../schemas/kind)" + The list of asset kinds that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`PERPETUAL` = 1|the perpetual asset kind| + |`FUTURE` = 2|the future asset kind| + |`CALL` = 3|the call option asset kind| + |`PUT` = 4|the put option asset kind| + ??? info "[Currency](/../../schemas/currency)" + The list of Currencies that are supported on the GRVT exchange
+ + |Value| Description | + |-|-| + |`USD` = 1|the USD fiat currency| + |`USDC` = 2|the USDC token| + |`USDT` = 3|the USDT token| + |`ETH` = 4|the ETH token| + |`BTC` = 5|the BTC token| + |`SOL` = 6|the SOL token| + |`ARB` = 7|the ARB token| + |`BNB` = 8|the BNB token| + |`ZK` = 9|the ZK token| + |`POL` = 10|the POL token| + |`OP` = 11|the OP token| + |`ATOM` = 12|the ATOM token| + |`KPEPE` = 13|the 1000PEPE token| + |`TON` = 14|the TON token| + |`XRP` = 15|the XRP token| + |`TRUMP` = 20|the TRUMP token| + |`SUI` = 21|the SUI token| + |`LINK` = 25|the LINK token| + |`JUP` = 27|the JUP token| + |`FARTCOIN` = 28|the FARTCOIN token| + |`ENA` = 29|the ENA token| + |`DOGE` = 30|the DOGE token| + |`ADA` = 33|the ADA token| + |`AAVE` = 34|the AAVE token| + |`BERA` = 35|the BERA token| + |`IP` = 40|the IP token| diff --git a/docs/grvt/schemas/api_get_latest_lp_snapshot_response.md b/docs/grvt/schemas/api_get_latest_lp_snapshot_response.md new file mode 100644 index 0000000..fecc350 --- /dev/null +++ b/docs/grvt/schemas/api_get_latest_lp_snapshot_response.md @@ -0,0 +1,14 @@ +!!! info "[ApiGetLatestLPSnapshotResponse](/../../schemas/api_get_latest_lp_snapshot_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |snapshot
`s` |ApproximateLPSnapshot|True|The latest LP snapshot| + ??? info "[ApproximateLPSnapshot](/../../schemas/approximate_lp_snapshot)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |main_account_id
`ma` |string|True|The main account id| + |underlying_multiplier
`um` |string|True|Underlying multiplier| + |market_share_multiplier
`ms` |string|True|Market share multiplier| + |bid_fast_market_multiplier
`bf` |integer|True|Fast market multiplier| + |ask_fast_market_multiplier
`af` |integer|True|Fast market multiplier| + |liquidity_score
`ls` |string|True|Liquidity score| + |calculate_at
`ca` |string|True|The time when the snapshot was calculated| diff --git a/docs/grvt/schemas/api_get_list_epoch_badge_response.md b/docs/grvt/schemas/api_get_list_epoch_badge_response.md new file mode 100644 index 0000000..115d6d5 --- /dev/null +++ b/docs/grvt/schemas/api_get_list_epoch_badge_response.md @@ -0,0 +1,54 @@ +!!! info "[ApiGetListEpochBadgeResponse](/../../schemas/api_get_list_epoch_badge_response)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |result
`r` |[EpochBadge]|True|The list of epoch badges| + ??? info "[EpochBadge](/../../schemas/epoch_badge)" + |Name
`Lite`|Type|Required
`Default`| Description | + |-|-|-|-| + |account_id
`ai` |string|True|The off chain account id| + |main_account_id
`ma` |string|True|The account ID| + |type
`t` |RewardProgramType|True|The type of the reward program| + |epoch
`e` |integer|True|The epoch number| + |epoch_start_time
`es` |string|True|The start time of the epoch| + |epoch_end_time
`ee` |string|True|The end time of the epoch| + |badge
`b` |EpochBadgeType|True|The type of the badge| + |distributed_badges
`db` |[EpochBadgeType]|True|The distributed badges| + |total_point
`tp` |string|True|Total point| + |rank
`r` |integer|True|Rank| + |claimed_at
`ca` |string|True|The time when the badge was claimed, or the epoch end time if the user has already completed the KYC process| + ??? info "[RewardProgramType](/../../schemas/reward_program_type)" + |Value| Description | + |-|-| + |`ECOSYSTEM` = 1|| + |`TRADER` = 2|| + |`LP` = 3|| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| + ??? info "[EpochBadgeType](/../../schemas/epoch_badge_type)" + |Value| Description | + |-|-| + |`CHAMPION` = 1|Champion| + |`LEGEND` = 2|Legend| + |`VETERAN` = 3|Veteran| + |`ELITE` = 4|Elite| + |`MASTER` = 5|Master| + |`EXPERT` = 6|Expert| + |`WARRIOR` = 7|Warrior| + |`SERGEANT` = 8|Sergeant| + |`RANGER` = 9|Ranger| + |`CHALLENGER` = 10|Challenger| + |`APPRENTICE` = 11|Apprentice| + |`ROOKIE` = 12|Rookie| diff --git a/docs/grvt/schemas/api_get_list_flat_referral_request.md b/docs/grvt/schemas/api_get_list_flat_referral_request.md new file mode 100644 index 0000000..c67e647 --- /dev/null +++ b/docs/grvt/schemas/api_get_list_flat_referral_request.md @@ -0,0 +1,9 @@ +!!! info "[ApiGetListFlatReferralRequest](/../../schemas/api_get_list_flat_referral_request)" + startTime and endTime are optional parameters. The semantics of these parameters are as follows: