Documentation ¶
Index ¶
- Variables
- func AddNewTrade(trade string, local bool) error
- func CalcPriceFromHistory(p1 decimal.Decimal, p2 decimal.Decimal, prev decimal.Decimal, ...) decimal.Decimal
- func CallOrderTest(statedb *state.StateDB)
- func CancelOrder(mr *MatchRes)
- func Compress(c []byte) (string, error)
- func DeepCopy(d *orderbook.XvcOrderBook, trade string, nonce *big.Int) *orderbook.XvcOrderBook
- func DeepCopyCurrentCancelOrders(l *list.List) []*list.Element
- func DeepCopy_Tmp(d *orderbook.XvcOrderBook, trade string, nonce *big.Int) *orderbook.XvcOrderBook
- func DoReSendTx()
- func EncodeMatchRes(res *MatchRes) (string, error)
- func ExecMatchResTx(data MatchResData) error
- func FindOrder(e *orderbook.XvcOrder) *orderbook.XvcOrder
- func GetABByTrade(trade string) (string, string)
- func GetCancelOrder() (int, []string)
- func GetDefaultFee() decimal.Decimal
- func GetOB(trade string) *orderbook.XvcOrderBook
- func GetPairList() (string, error)
- func GetTradeFromMatchRes(res string) string
- func GetUnit(trade string) (decimal.Decimal, decimal.Decimal, error)
- func GetZipData(mr *MatchRes) (string, error)
- func InitMatchNonce()
- func InitOb()
- func InitTrade()
- func InitUnit()
- func Init_match_res()
- func Init_quit()
- func Init_startmatch()
- func Init_timeout()
- func InsertByNonce(tx *types.Transaction)
- func InsertCancelOrder(id string)
- func InsertToOrderBook(msg string, ch chan interface{}) error
- func InsertToOrderBook2(msg string)
- func IsClosed(ch <-chan interface{}) bool
- func IsOrderBalanceOk(from string, trade string, side string, price decimal.Decimal, ...)
- func MatchMakingBidding(ob *orderbook.XvcOrderBook) (decimal.Decimal, []*orderbook.XvcOrder, decimal.Decimal, int, error)
- func MatchTimeOut(trade string)
- func MatchXvcOrder(trade string, nonce *big.Int) error
- func Max(a decimal.Decimal, b decimal.Decimal) decimal.Decimal
- func Min(a decimal.Decimal, b decimal.Decimal) decimal.Decimal
- func MyClose(ch chan bool)
- func OrderDealedInfo(blockNr rpc.BlockNumber, trade string) (string, error)
- func Orders(trade string) (string, error)
- func ReOrgOrder(txs types.Transactions)
- func ReceivAllOrder()
- func RecvOrder(msg string, ch chan interface{})
- func RecvOrder2(msg string)
- func RemoveOb(d *orderbook.XvcOrderBook)
- func RemoveOb2(d *orderbook.XvcOrderBook)
- func RemoveOb_Tmp(d *orderbook.XvcOrderBook)
- func RevertMatchResRealData(mr *MatchRes)
- func RevertMatchResRealData2(mr *MatchRes)
- func SendMatchResTx(trade string)
- func SendOrderbookTx(res_compress string, matchnonce *big.Int, trade string) error
- func SettleOrders(evm *vm.EVM, from common.Address, data string)
- func Start()
- func StartXvcMatch(trade string)
- func UnCompress(s string) (string, error)
- func UpdateOB(data string)
- func UpdateOrder(mr *MatchRes)
- func WaitStop()
- type CurrentVolume
- type MatchRes
- type MatchResData
- type PriceLevel
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidQuantity = `{Code:77,Error:"orderbook: invalid order quantity."}` ErrInvalidPrice = `{Code:78,Error:"orderbook: invalid order price."}` ErrOrderExists = `{Code:79,Error:"orderbook: order already exists."}` ErrOrderNotExists = `{Code:80,Error:"orderbook: order does not exist."}` ErrInsufficientQuantity = `{Code:81,Error:"orderbook: insufficient quantity to calculate price."}` ErrOrderObjectNil = `{Code:82,Error:"orderbook: order object is nil."}` ErrOrderQueueObjectNil = `{Code:83,Error:"orderbook: order queue object is nil."}` ErrCompressDataNil = `{Code:84,Error:"orderbook: compress data is nil."}` ErrCompressNewWriterFail = `{Code:85,Error:"orderbook: get compress writer fail."}` ErrUnCompressDataNil = `{Code:86,Error:"orderbook: uncompress data is nil."}` ErrUnCompressNewReaderFail = `{Code:87,Error:"orderbook: get uncompress reader fail."}` ErrMatchOrderBookFail = `{Code:88,Error:"orderbook: match fail."}` ErrOrderBookObjectNil = `{Code:89,Error:"orderbook: order book object is nil."}` ErrOrderInsufficient = `{Code:90,Error:"Insufficient Order Balance."}` ErrGetODBError = `{Code:91,Error:"get orderbook error."}` ErrMatchResNil = `{Code:92,Error:"match result is nil."}` ErrNotODBTxData = `{Code:93,Error:"not ODB tx data."}` ErrAlreadyUpdateMatchRes = `{Code:94,Error:"match result has already been updated."}` ErrBlockNumMiss = `{Code:95,Error:"block number miss."}` ErrNotInGroup = `{Code:96,Error:"node not in group."}` ErrGetMatchResFail = `{Code:97,Error:"get match result fail."}` ErrEncodeMatchResFail = `{Code:98,Error:"encode match result fail."}` ErrCompressMatchResFail = `{Code:99,Error:"compress mach result fail."}` ErrNewMatchResTxFail = `{Code:100,Error:"new match result tx fail."}` )
OrderBook erros
View Source
var ( CancelOrders *list.List Match bool MatchTrade []string OB = common.NewSafeMap(10) UNIT = common.NewSafeMap(10) MatchNonce = common.NewSafeMap(10) EXCHANGE_DEFAULT_FEE decimal.Decimal ReOrgList *common.Queue )
View Source
var (
MAXPRICE, _ = decimal.NewFromString("100000000000000")
)
Functions ¶
func AddNewTrade ¶
func CalcPriceFromHistory ¶
func CallOrderTest ¶
func CancelOrder ¶
func CancelOrder(mr *MatchRes)
func DeepCopy ¶
func DeepCopy(d *orderbook.XvcOrderBook, trade string, nonce *big.Int) *orderbook.XvcOrderBook
func DeepCopy_Tmp ¶
func DeepCopy_Tmp(d *orderbook.XvcOrderBook, trade string, nonce *big.Int) *orderbook.XvcOrderBook
func DoReSendTx ¶
func DoReSendTx()
func EncodeMatchRes ¶
func ExecMatchResTx ¶
func ExecMatchResTx(data MatchResData) error
func GetCancelOrder ¶
func GetDefaultFee ¶
func GetOB ¶
func GetOB(trade string) *orderbook.XvcOrderBook
func GetPairList ¶
func GetTradeFromMatchRes ¶
func GetUnit ¶
trade: A/B return: U_A,U_B 1A = U_A*e 1B = U_B*e 1A = UA*unit for example: 1BTC = 10^8 cong
func GetZipData ¶
func InitMatchNonce ¶
func InitMatchNonce()
func Init_match_res ¶
func Init_match_res()
func Init_startmatch ¶
func Init_startmatch()
func Init_timeout ¶
func Init_timeout()
func InsertByNonce ¶
func InsertByNonce(tx *types.Transaction)
func InsertCancelOrder ¶
func InsertCancelOrder(id string)
func InsertToOrderBook ¶
func InsertToOrderBook2 ¶
func InsertToOrderBook2(msg string)
func IsOrderBalanceOk ¶
func MatchMakingBidding ¶
func MatchMakingBidding(ob *orderbook.XvcOrderBook) (decimal.Decimal, []*orderbook.XvcOrder, decimal.Decimal, int, error)
///
func MatchTimeOut ¶
func MatchTimeOut(trade string)
func OrderDealedInfo ¶
func OrderDealedInfo(blockNr rpc.BlockNumber, trade string) (string, error)
func ReOrgOrder ¶
func ReOrgOrder(txs types.Transactions)
func ReceivAllOrder ¶
func ReceivAllOrder()
func RecvOrder2 ¶
func RecvOrder2(msg string)
func RemoveOb ¶
func RemoveOb(d *orderbook.XvcOrderBook)
func RemoveOb2 ¶
func RemoveOb2(d *orderbook.XvcOrderBook)
func RemoveOb_Tmp ¶
func RemoveOb_Tmp(d *orderbook.XvcOrderBook)
func RevertMatchResRealData ¶
func RevertMatchResRealData(mr *MatchRes)
func RevertMatchResRealData2 ¶
func RevertMatchResRealData2(mr *MatchRes)
func SendMatchResTx ¶
func SendMatchResTx(trade string)
func SendOrderbookTx ¶
func StartXvcMatch ¶
func StartXvcMatch(trade string)
func UpdateOrder ¶
func UpdateOrder(mr *MatchRes)
Types ¶
type CurrentVolume ¶
type MatchRes ¶
type MatchRes struct { Price string Done []*orderbook.XvcOrder Volumes string Orders int CurVolume []*CurrentVolume //cancel Cancel []string }
func DecodeMatchRes ¶
func GetMatchRes ¶
type PriceLevel ¶
Click to show internal directories.
Click to hide internal directories.