model

package
v0.0.0-...-701c789 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2023 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SidePrefix = "ORDER_SIDE_"

	TypePrefix   = "ORDER_TYPE_"
	OrderTypeMap = map[string]OrderType{
		"market": Market,
		"limit":  Limit,
	}
	TimeInForcePrefix = "ORDER_TIME_IN_FORCE_"
	OrderTifMap       = map[string]OrderTimeInForce{
		"untilDateTime":     UntilDateTime,
		"untilCancelled":    UntilCancelled,
		"immediateOrCancel": ImmediateOrCancel,
		"fillOrKill":        FillOrKill,
	}
)

Functions

This section is empty.

Types

type Asset

type Asset struct {
	AssetId              string    `json:"assetId" dynamodbav:"productId"`
	Filter               string    `json:"filter" dynamodbav:"filter"`
	Ticker               string    `json:"ticker" dynamodbav:"ticker"`
	Name                 string    `json:"name" dynamodbav:"name"`
	MinTransactionAmount string    `json:"minTransactionAmount" dynamodbav:"minTransactionAmount"`
	MaxTransactionAmount string    `json:"maxTransactionAmount" dynamodbav:"maxTransactionAmount"`
	Slippage             string    `json:"slippage" dynamodbav:"slippage"`
	HighOffer            string    `json:"highOffer" dynamodbav:"highOffer"`
	LowBid               string    `json:"lowBid" dynamodbav:"lowBid"`
	Spread               string    `json:"spread" dynamodbav:"spread"`
	CreatedAt            time.Time `json:"createdAt" dynamodbav:"createdAt"`
	UpdatedAt            time.Time `json:"updatedAt" dynamodbav:"updatedAt"`
	MarketCap            string    `json:"marketCap" dynamodbav:"marketCap"`
	Volume               string    `json:"volume" dynamodbav:"volume"`
	Supply               string    `json:"supply" dynamodbav:"supply"`
	Direction            string    `json:"direction" dynamodbav:"direction"`
}

type AssetBalance

type AssetBalance struct {
	Asset     string  `json:"asset"`
	UserId    string  `json:"userId"`
	Amount    float32 `json:"amount"`
	Hold      float32 `json:"hold"`
	Available float32 `json:"available"`
}

type Balances

type Balances struct {
}

type Order

type Order struct {
	OrderId            string           `json:"clientOrderId" dynamodbav:"orderId"`
	OwnerId            string           `json:"ownerId" dynamodbav:"userId"`
	Filter             string           `json:"filter" dynamodbav:"filter"`
	VenueOrderId       string           `json:"venueOrderId" dynamodbav:"venueOrderId,omitempty"`
	ProductId          string           `json:"productId" dynamodbav:"productId"`
	Side               OrderSide        `json:"side" dynamodbav:"side"`
	Type               OrderType        `json:"type" dynamodbav:"type"`
	Quantity           string           `json:"quantity" dynamodbav:"quantity"`
	LimitPrice         string           `json:"limitPrice" dynamodbav:"limitPrice,omitempty"`
	TimeInForce        OrderTimeInForce `json:"timeInForce" dynamodbav:"timeInForce,omitempty"`
	Status             OrderStatus      `json:"status" dynamodbav:"orderStatus"`
	CreatedAt          time.Time        `json:"createdAt" dynamodbav:"createdAt"`
	UpdatedAt          time.Time        `json:"updatedAt" dynamodbav:"updatedAt,omitempty"`
	FilledQuantity     string           `json:"filledQuantity" dynamodbav:"filledQuantity,omitempty"`
	FilledValue        string           `json:"filledValue" dynamodbav:"filledValue,omitempty"`
	AverageFilledPrice string           `json:"averageFilledPrice" dynamodbav:"averageFilledPrice,omitempty"`
	Commission         string           `json:"commission" dynamodbav:"commission,omitempty"`
	ExchangeFee        string           `json:"exchangeFee" dynamodbav:"exchangeFee,omitempty"`
}

type OrderRequest

type OrderRequest struct {
	ProductId   string           `json:"productId"`
	Side        OrderSide        `json:"side"`
	Type        OrderType        `json:"type"`
	Quantity    float32          `json:"quantity"`
	LimitPrice  float32          `json:"limitPrice"`
	TimeInForce OrderTimeInForce `json:"timeInForce"`
}

type OrderSide

type OrderSide string
const (
	Buy  OrderSide = "buy"
	Sell OrderSide = "sell"
)

func ParseOrderSide

func ParseOrderSide(o string) OrderSide

type OrderStatus

type OrderStatus string
const (
	PendingInternal OrderStatus = "pendingInternal"
	PendingVenue    OrderStatus = "pendingVenue"
	Open            OrderStatus = "open"
	Filled          OrderStatus = "filled"
	Cancelled       OrderStatus = "cancelled"
	Expired         OrderStatus = "expired"
	Failed          OrderStatus = "failed"
)

func ParseOrderStatus

func ParseOrderStatus(o string) OrderStatus

type OrderTimeInForce

type OrderTimeInForce string
const (
	UntilDateTime     OrderTimeInForce = "untilDateTime"
	UntilCancelled    OrderTimeInForce = "untilCancelled"
	ImmediateOrCancel OrderTimeInForce = "immediateOrCancel"
	FillOrKill        OrderTimeInForce = "fillOrKill"
)

type OrderType

type OrderType string
const (
	Market OrderType = "market"
	Limit  OrderType = "limit"
)

type ProfileResponse

type ProfileResponse struct {
	UserId      string    `json:"userId"`
	Email       string    `json:"email"`
	Name        string    `json:"name"`
	LegalName   string    `json:"description"`
	UserName    string    `json:"username"`
	Roles       []string  `json:"roles"`
	Address     string    `json:"address"`
	DateOfBirth string    `json:"dateOfBirth"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type RequestIdCtxKeyType

type RequestIdCtxKeyType string
const RequestCtxKey RequestIdCtxKeyType = "requestId"

type UpdateProfileRequest

type UpdateProfileRequest struct {
	UserId      string    `json:"userId"`
	Email       string    `json:"email"`
	Name        string    `json:"name"`
	LegalName   string    `json:"description"`
	UserName    string    `json:"username"`
	Roles       []string  `json:"roles"`
	Address     string    `json:"address"`
	DateOfBirth string    `json:"dateOfBirth"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`
}

type User

type User struct {
	Email string `json:"email"`
	Id    string `json:"id"`
}

type UserBalance

type UserBalance struct {
	UserId   string            `json:"userId"`
	Interval string            `json:"interval"`
	History  []UserTimeBalance `json:"history"`
}

type UserCtxKeyType

type UserCtxKeyType string
const UserCtxKey UserCtxKeyType = "user"

type UserTimeBalance

type UserTimeBalance struct {
	Amount float32   `json:"amount"`
	Time   time.Time `json:"date"`
}

Jump to

Keyboard shortcuts

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