Documentation ¶
Index ¶
- Constants
- type AccountBalances
- type Bitmex
- func (e *Bitmex) ApiKeyGet(mapParams map[string]string, strRequestPath string) string
- func (e *Bitmex) ApiKeyPost(mapParams map[string]string, strRequestPath string) string
- func (e *Bitmex) CanDeposit(coin *coin.Coin) bool
- func (e *Bitmex) CanWithdraw(coin *coin.Coin) bool
- func (e *Bitmex) CancelAllOrder() error
- func (e *Bitmex) CancelOrder(order *exchange.Order) error
- func (e *Bitmex) DeleteCoin(coin *coin.Coin)
- func (e *Bitmex) DeletePair(pair *pair.Pair)
- func (e *Bitmex) DoAccountOperation(operation *exchange.AccountOperation) error
- func (e *Bitmex) GetBalance(coin *coin.Coin) float64
- func (e *Bitmex) GetCoinBySymbol(symbol string) *coin.Coin
- func (e *Bitmex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
- func (e *Bitmex) GetCoins() []*coin.Coin
- func (e *Bitmex) GetCoinsData() error
- func (e *Bitmex) GetConfirmation(coin *coin.Coin) int
- func (e *Bitmex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
- func (e *Bitmex) GetFee(pair *pair.Pair) float64
- func (e *Bitmex) GetID() int
- func (e *Bitmex) GetLotSize(pair *pair.Pair) float64
- func (e *Bitmex) GetName() exchange.ExchangeName
- func (e *Bitmex) GetPairBySymbol(symbol string) *pair.Pair
- func (e *Bitmex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
- func (e *Bitmex) GetPairs() []*pair.Pair
- func (e *Bitmex) GetPairsData() error
- func (e *Bitmex) GetPriceFilter(pair *pair.Pair) float64
- func (e *Bitmex) GetSymbolByCoin(coin *coin.Coin) string
- func (e *Bitmex) GetSymbolByPair(pair *pair.Pair) string
- func (e *Bitmex) GetTradingWebURL(pair *pair.Pair) string
- func (e *Bitmex) GetTxFee(coin *coin.Coin) float64
- func (e *Bitmex) HasPair(pair *pair.Pair) bool
- func (e *Bitmex) InitData() error
- func (e *Bitmex) LimitBuy(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitmex) LimitSell(pair *pair.Pair, quantity, rate float64) (*exchange.Order, error)
- func (e *Bitmex) ListOrders() ([]*exchange.Order, error)
- func (e *Bitmex) LoadPublicData(operation *exchange.PublicOperation) error
- func (e *Bitmex) OrderBook(p *pair.Pair) (*exchange.Maker, error)
- func (e *Bitmex) OrderStatus(order *exchange.Order) error
- func (e *Bitmex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
- func (e *Bitmex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
- func (e *Bitmex) UpdateAllBalances()
- func (e *Bitmex) UpdateConstraint()
- func (e *Bitmex) Withdraw(coin *coin.Coin, quantity float64, addr, tag string) bool
- type ErrorResponse
- type OrderBook
- type PairsData
- type PlaceOrder
Constants ¶
const ( DEFAULT_ID = 5 DEFAULT_TAKER_FEE = 0.001 DEFAULT_MAKER_FEE = 0.001 DEFAULT_LOT_SIZE = 0.00000001 DEFAULT_PRICE_FILTER = 0.00000001 //PRICE FILTER DEFAULT_TXFEE = 0.005 DEFAULT_WITHDRAW = true DEFAULT_DEPOSIT = true DEFAULT_CONFIRMATION = 2 )
const (
API_URL = "https://www.bitmex.com/api/v1"
)
The Base Endpoint URL
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountBalances ¶
type AccountBalances struct { MakerCommission int `json:"makerCommission"` TakerCommission int `json:"takerCommission"` BuyerCommission int `json:"buyerCommission"` SellerCommission int `json:"sellerCommission"` CanTrade bool `json:"canTrade"` CanWithdraw bool `json:"canWithdraw"` CanDeposit bool `json:"canDeposit"` Balances []struct { Asset string `json:"asset"` Free string `json:"free"` Locked string `json:"locked"` } `json:"balances"` }
type Bitmex ¶
type Bitmex struct { ID int Name string `bson:"name"` Website string `bson:"website"` API_KEY string API_SECRET string Source exchange.DataSource // / exchange API / microservicve api 1 / PSQL SourceURI string }
func CreateBitmex ¶
*************************************************
func (*Bitmex) ApiKeyGet ¶
************** Signature Http Request ************** Method: GET and Signature is required --reference Binance Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Create mapParams Depend on API Signature request Step 3: Add HttpGetRequest below strUrl if API has different requests
func (*Bitmex) ApiKeyPost ¶
Method: API Request and Signature is required Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Create mapParams Depend on API Signature request Step 3: Add HttpGetRequest below strUrl if API has different requests
func (*Bitmex) CancelAllOrder ¶
func (*Bitmex) DeleteCoin ¶
func (*Bitmex) DeletePair ¶
func (*Bitmex) DoAccountOperation ¶
func (e *Bitmex) DoAccountOperation(operation *exchange.AccountOperation) error
************** Private API **************
func (*Bitmex) GetCoinConstraint ¶
func (e *Bitmex) GetCoinConstraint(coin *coin.Coin) *exchange.CoinConstraint
************** Coins on the Exchanges **************
func (*Bitmex) GetCoinsData ¶
************** Public API ************** Get Coins Information (If API provide) Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Modify API Path(strRequestUrl)
func (*Bitmex) GetConstraintFetchMethod ¶
func (e *Bitmex) GetConstraintFetchMethod(pair *pair.Pair) *exchange.ConstrainFetchMethod
*************** Exchange Constraint ***************
func (*Bitmex) GetName ¶
func (e *Bitmex) GetName() exchange.ExchangeName
func (*Bitmex) GetPairConstraint ¶
func (e *Bitmex) GetPairConstraint(pair *pair.Pair) *exchange.PairConstraint
************** Pairs on the Exchanges **************
func (*Bitmex) GetPairsData ¶
GetPairsData - Get Pairs Information (If API provide)
Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Modify API Path(strRequestUrl)
func (*Bitmex) LoadPublicData ¶
func (e *Bitmex) LoadPublicData(operation *exchange.PublicOperation) error
func (*Bitmex) OrderBook ¶
Get Pair Market Depth Step 1: Change Instance Name (e *<exchange Instance Name>) Step 2: Add Model of API Response Step 3: Get Exchange Pair Code ex. symbol := e.GetPairCode(p) Step 4: Modify API Path(strRequestUrl) Step 5: Add Params - Depend on API request Step 6: Convert the response to Standard Maker struct
func (*Bitmex) SetCoinConstraint ¶
func (e *Bitmex) SetCoinConstraint(coinConstraint *exchange.CoinConstraint)
func (*Bitmex) SetPairConstraint ¶
func (e *Bitmex) SetPairConstraint(pairConstraint *exchange.PairConstraint)
func (*Bitmex) UpdateAllBalances ¶
func (e *Bitmex) UpdateAllBalances()
func (*Bitmex) UpdateConstraint ¶
func (e *Bitmex) UpdateConstraint()
type ErrorResponse ¶
type PairsData ¶
type PairsData []struct { Symbol string `json:"symbol"` RootSymbol string `json:"rootSymbol"` State string `json:"state"` Typ string `json:"typ"` Listing time.Time `json:"listing"` Front time.Time `json:"front"` Expiry time.Time `json:"expiry"` Settle time.Time `json:"settle"` RelistInterval interface{} `json:"relistInterval"` InverseLeg string `json:"inverseLeg"` SellLeg string `json:"sellLeg"` BuyLeg string `json:"buyLeg"` OptionStrikePcnt interface{} `json:"optionStrikePcnt"` OptionStrikeRound interface{} `json:"optionStrikeRound"` OptionStrikePrice interface{} `json:"optionStrikePrice"` OptionMultiplier interface{} `json:"optionMultiplier"` PositionCurrency string `json:"positionCurrency"` Underlying string `json:"underlying"` QuoteCurrency string `json:"quoteCurrency"` UnderlyingSymbol string `json:"underlyingSymbol"` Reference string `json:"reference"` ReferenceSymbol string `json:"referenceSymbol"` CalcInterval interface{} `json:"calcInterval"` PublishInterval interface{} `json:"publishInterval"` PublishTime interface{} `json:"publishTime"` MaxOrderQty float64 `json:"maxOrderQty"` MaxPrice float64 `json:"maxPrice"` LotSize float64 `json:"lotSize"` TickSize float64 `json:"tickSize"` Multiplier int `json:"multiplier"` SettlCurrency string `json:"settlCurrency"` UnderlyingToPositionMultiplier int `json:"underlyingToPositionMultiplier"` UnderlyingToSettleMultiplier interface{} `json:"underlyingToSettleMultiplier"` QuoteToSettleMultiplier int `json:"quoteToSettleMultiplier"` IsQuanto bool `json:"isQuanto"` IsInverse bool `json:"isInverse"` InitMargin float64 `json:"initMargin"` MaintMargin float64 `json:"maintMargin"` RiskLimit int64 `json:"riskLimit"` RiskStep int64 `json:"riskStep"` Limit interface{} `json:"limit"` Capped bool `json:"capped"` Taxed bool `json:"taxed"` Deleverage bool `json:"deleverage"` MakerFee float64 `json:"makerFee"` TakerFee float64 `json:"takerFee"` SettlementFee float64 `json:"settlementFee"` InsuranceFee int `json:"insuranceFee"` FundingBaseSymbol string `json:"fundingBaseSymbol"` FundingQuoteSymbol string `json:"fundingQuoteSymbol"` FundingPremiumSymbol string `json:"fundingPremiumSymbol"` FundingTimestamp interface{} `json:"fundingTimestamp"` FundingInterval interface{} `json:"fundingInterval"` FundingRate interface{} `json:"fundingRate"` IndicativeFundingRate interface{} `json:"indicativeFundingRate"` RebalanceTimestamp interface{} `json:"rebalanceTimestamp"` RebalanceInterval interface{} `json:"rebalanceInterval"` OpeningTimestamp time.Time `json:"openingTimestamp"` ClosingTimestamp time.Time `json:"closingTimestamp"` SessionInterval time.Time `json:"sessionInterval"` PrevClosePrice float64 `json:"prevClosePrice"` LimitDownPrice interface{} `json:"limitDownPrice"` LimitUpPrice interface{} `json:"limitUpPrice"` BankruptLimitDownPrice interface{} `json:"bankruptLimitDownPrice"` BankruptLimitUpPrice interface{} `json:"bankruptLimitUpPrice"` PrevTotalVolume float64 `json:"prevTotalVolume"` TotalVolume float64 `json:"totalVolume"` Volume float64 `json:"volume"` Volume24H float64 `json:"volume24h"` PrevTotalTurnover int64 `json:"prevTotalTurnover"` TotalTurnover int64 `json:"totalTurnover"` Turnover int64 `json:"turnover"` Turnover24H int64 `json:"turnover24h"` HomeNotional24H float64 `json:"homeNotional24h"` ForeignNotional24H float64 `json:"foreignNotional24h"` PrevPrice24H float64 `json:"prevPrice24h"` Vwap float64 `json:"vwap"` HighPrice float64 `json:"highPrice"` LowPrice float64 `json:"lowPrice"` LastPrice float64 `json:"lastPrice"` LastPriceProtected float64 `json:"lastPriceProtected"` LastTickDirection string `json:"lastTickDirection"` LastChangePcnt float64 `json:"lastChangePcnt"` BidPrice float64 `json:"bidPrice"` MidPrice float64 `json:"midPrice"` AskPrice float64 `json:"askPrice"` ImpactBidPrice float64 `json:"impactBidPrice"` ImpactMidPrice float64 `json:"impactMidPrice"` ImpactAskPrice float64 `json:"impactAskPrice"` HasLiquidity bool `json:"hasLiquidity"` OpenInterest float64 `json:"openInterest"` OpenValue int64 `json:"openValue"` FairMethod string `json:"fairMethod"` FairBasisRate float64 `json:"fairBasisRate"` FairBasis float64 `json:"fairBasis"` FairPrice float64 `json:"fairPrice"` MarkMethod string `json:"markMethod"` MarkPrice float64 `json:"markPrice"` IndicativeTaxRate float64 `json:"indicativeTaxRate"` IndicativeSettlePrice float64 `json:"indicativeSettlePrice"` OptionUnderlyingPrice interface{} `json:"optionUnderlyingPrice"` SettledPrice interface{} `json:"settledPrice"` Timestamp time.Time `json:"timestamp"` }
type PlaceOrder ¶
type PlaceOrder struct { OrderID string `json:"orderID"` ClOrdID string `json:"clOrdID"` ClOrdLinkID string `json:"clOrdLinkID"` Account int `json:"account"` Symbol string `json:"symbol"` Side string `json:"side"` SimpleOrderQty float64 `json:"simpleOrderQty"` OrderQty interface{} `json:"orderQty"` Price float64 `json:"price"` DisplayQty interface{} `json:"displayQty"` StopPx interface{} `json:"stopPx"` PegOffsetValue interface{} `json:"pegOffsetValue"` PegPriceType string `json:"pegPriceType"` Currency string `json:"currency"` SettlCurrency string `json:"settlCurrency"` OrdType string `json:"ordType"` TimeInForce string `json:"timeInForce"` ExecInst string `json:"execInst"` ContingencyType string `json:"contingencyType"` ExDestination string `json:"exDestination"` OrdStatus string `json:"ordStatus"` Triggered string `json:"triggered"` WorkingIndicator bool `json:"workingIndicator"` OrdRejReason string `json:"ordRejReason"` SimpleLeavesQty float64 `json:"simpleLeavesQty"` LeavesQty float64 `json:"leavesQty"` SimpleCumQty float64 `json:"simpleCumQty"` CumQty float64 `json:"cumQty"` AvgPx float64 `json:"avgPx"` MultiLegReportingType string `json:"multiLegReportingType"` Text string `json:"text"` TransactTime time.Time `json:"transactTime"` Timestamp time.Time `json:"timestamp"` }