account

package
v0.0.0-...-0434655 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountVo

type AccountVo struct {
	UserID            string `json:"user_id" example:"9001"`
	Currency          string `json:"currency" example:"BTC"`
	CashBalance       string `json:"cash_balance" example:"10.00000000"`
	AvailableBalance  string `json:"available_balance" example:"100.00000000"`
	MarginBalance     string `json:"margin_balance" example:"90.00000000"`
	InitialMargin     string `json:"initial_margin" example:"10.00000000"`
	MaintenanceMargin string `json:"maintenance_margin" example:"70.00000000"`
	Equity            string `json:"equity" example:"105.00000000"`
	PNL               string `json:"pnl" example:"5.00000000"`
	TotalDelta        string `json:"total_delta" example:"3.12000000"`

	// NEW
	AccountID string `json:"account_id"`
	Mode      string `json:"mode"`
	//AvailableWithdrawal string `json:"available_withdrawal"`
	BlockTradePermission bool `json:"block_trade_permission"`

	SessionUpl string `json:"session_upl"`
	SessionRpl string `json:"session_rpl"`

	OptionValue      string `json:"option_value"`
	OptionPnl        string `json:"option_pnl"`
	OptionSessionRpl string `json:"option_session_rpl"`
	OptionSessionUpl string `json:"option_session_upl"`
	OptionDelta      string `json:"option_delta"`
	OptionGamma      string `json:"option_gamma"`
	OptionVega       string `json:"option_vega"`
	OptionTheta      string `json:"option_theta"`

	FuturePnl            string `json:"future_pnl"`
	FutureSessionRpl     string `json:"future_session_rpl"`
	FutureSessionUpl     string `json:"future_session_upl"`
	FutureSessionFunding string `json:"future_session_funding"`
	FutureDelta          string `json:"future_delta"`

	CreatedAt int64 `json:"created_at"`
}

type CodVO

type CodVO struct {
	Cod bool `json:"cod"`
}

type DeliveryVo

type DeliveryVo struct {
	Type          string `json:"type" example:"delivery"`
	Timestamp     int64  `json:"timestamp" example:"1585296000000"`
	InstrumentId  string `json:"instrument_id" example:"BTC-27MAR20-9000-C"`
	Position      string `json:"position" example:"0.7"`
	Exercise      bool   `json:"exercise"`
	DeliveryPrice string `json:"delivery_price" example:"8000"`
	DeliveryPnl   string `json:"delivery_pnl" example:"0.07"`
}

type GetAccountResponse

type GetAccountResponse struct {
	base.RestBaseResponse
	Data AccountVo `json:"data"`
}

type GetCodResponse

type GetCodResponse struct {
	base.RestBaseResponse
	Data CodVO `json:"data"`
}

type GetMmpResponse

type GetMmpResponse struct {
	base.RestBaseResponse
	Data MmpStateVo `json:"data"`
}

type GetPositionsResponse

type GetPositionsResponse struct {
	base.RestBaseResponse
	Paging base.OldPaging `json:"paging"`
	Data   []PositionVo   `json:"data"`
}

type GetTransactionLogsResponse

type GetTransactionLogsResponse struct {
	base.RestBaseResponse
	PageInfo base.NewPaging     `json:"page_info"`
	Data     []TransactionLogVo `json:"data"`
}

type GetUserDeliveriesResponse

type GetUserDeliveriesResponse struct {
	base.RestBaseResponse
	Paging base.OldPaging `json:"paging"`
	Data   []DeliveryVo   `json:"data"`
}

type GetUserSettlementsResponse

type GetUserSettlementsResponse struct {
	base.RestBaseResponse
	PageInfo base.NewPaging `json:"page_info"`
	Data     []SettlementVo `json:"data"`
}

type MmpConfigVo

type MmpConfigVo struct {
	WindowMs       int64  `json:"window_ms"`
	FrozenPeriodMs int64  `json:"frozen_period_ms"`
	QtyLimit       string `json:"qty_limit"`
	DeltaLimit     string `json:"delta_limit"`
}

type MmpStateVo

type MmpStateVo struct {
	Currency            string      `json:"currency"`
	MmpEnabled          bool        `json:"mmp_enabled"`
	MmpUserConfigurable bool        `json:"mmp_user_configurable"`
	MmpConfig           MmpConfigVo `json:"mmp_config"`
	MmpFrozenUntilMs    int64       `json:"mmp_frozen_until_ms"`
	MmpFrozen           bool        `json:"mmp_frozen"`
}

type PositionVo

type PositionVo struct {
	InstrumentId      string `json:"instrument_id" example:"BTC-27MAR20-9000-C"`
	ExpirationAt      int64  `json:"expiration_at" example:"1585296000000"`
	Qty               string `json:"qty" example:"5"`
	InitialMargin     string `json:"initial_margin" example:"0.023"`
	MaintenanceMargin string `json:"maintenance_margin" example:"0.0075"`
	AvgPrice          string `json:"avg_price" example:"0.016"`
	//UPL               string `json:"upl" example:"0.0024"`
	//RPL               string `json:"rpl" example:"-0.0002"`
	//PNL               string `json:"pnl" example:"0.0021"`
	SessionAvgPrice string `json:"session_avg_price" example:"0.012"`
	MarkPrice       string `json:"mark_price" example:"0.0401"`
	IndexPrice      string `json:"index_price" example:"7800"`
	QtyBase         string `json:"qty_base,omitempty" example:"0.001"`

	LiqPrice           string `json:"liq_price" example:"6950"`
	SessionFunding     string `json:"session_funding,omitempty" example:"0.000023"`
	PositionPnl        string `json:"position_pnl" example:"0.0021"`
	PositionSessionUpl string `json:"position_session_upl" example:"0.0024"`
	PositionSessionRpl string `json:"position_session_rpl" example:"-0.0002"`

	// NEW
	Category string `json:"category" example:"option"`
	ROI      string `json:"roi" example:"0.0003"`

	OptionDelta string `json:"option_delta,omitempty"`
	OptionGamma string `json:"option_gamma,omitempty"`
	OptionVega  string `json:"option_vega,omitempty"`
	OptionTheta string `json:"option_theta,omitempty"`

	Leverage string `json:"leverage" example:"30"`
}

type PostCodResponse

type PostCodResponse struct {
	base.RestBaseResponse
	Data interface{} `json:"data"`
}

type ResetMmpStateResponse

type ResetMmpStateResponse struct {
	base.RestBaseResponse
	Data string `json:"data"`
}

type SettlementVo

type SettlementVo struct {
	Type           string `json:"type" example:"delivery"`
	Timestamp      int64  `json:"timestamp" example:"1585296000000"`
	InstrumentId   string `json:"instrument_id" example:"BTC-27MAR20-9000-C"`
	Position       string `json:"position" example:"0.7"`
	Direction      string `json:"direction"`
	SessionUpl     string `json:"session_upl" example:"0.0002"`
	SessionRpl     string `json:"session_rpl" example:"-0.0006"`
	SessionFunding string `json:"session_funding" example:"0.0000002"`
}

type TransactionLogVo

type TransactionLogVo struct {
	TransactionTime int64  `json:"transaction_time" example:"1585296000000"`
	InstrumentID    string `json:"instrument_id" example:"BTC-27MAR20-9000-C"`
	TransactionType string `json:"transaction_type" example:"trade"`
	Direction       string `json:"direction" example:"buy"`
	Qty             string `json:"qty" example:"0.1"`
	Price           string `json:"price" example:"0.035"`
	CashFlow        string `json:"cash_flow" example:"0.003"`
	Funding         string `json:"funding" example:"0.00003"`
	FeePaid         string `json:"fee_paid" example:"0.0001"`
	FeeRate         string `json:"fee_rate" example:"0.0002"`
	Change          string `json:"change" example:"-0.02"`
	Balance         string `json:"balance" example:"98.2"`
	TradeID         string `json:"trade_id" example:"3472"`
	OrderID         string `json:"order_id" example:"8721"`
	Position        string `json:"position" example:"3.1"`

	// Percentage Share: xx% for socialized-fund type
	// autoliquidation for liquidation trade
	Remark string `json:"remark" example:"autoliquidation"`
}

type UpdateMmpResponse

type UpdateMmpResponse struct {
	base.RestBaseResponse
	Data string `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL