交易市场概况和基础信息
CoinAll撮合系统撮合订单的优先级按照价格优于时间的优先级来撮合,优先撮合价格更有优势的订单。当价格一致时按照下单时间顺序撮合,先下单的先撮合。 比如深度列表中目前有3笔挂单等待成交,分别为1: 9900USDT买1BTC,2: 10100USDT买2BTC,3: 9900USDT买1.5BTC。他们是按时间顺序1-2-3进入撮合系统的,根据价格优先,系统优先撮合订单2,根据时间优先,1跟3优先撮合1。所以系统撮合顺序是2-1-3。
| package rabbitmq | |
| import ( | |
| "context" | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "github.com/rs/zerolog" | |
| "github.com/streadway/amqp" | |
| "runtime" |
| import lombok.extern.slf4j.Slf4j; | |
| import lombok.val; | |
| import org.springframework.http.HttpStatus; | |
| import org.springframework.http.MediaType; | |
| import org.springframework.web.filter.OncePerRequestFilter; | |
| import org.springframework.web.util.ContentCachingRequestWrapper; | |
| import org.springframework.web.util.ContentCachingResponseWrapper; | |
| import javax.servlet.FilterChain; | |
| import javax.servlet.ServletException; |
| readinessProbe: | |
| exec: | |
| command: ["/root/grpc_health_probe", "-addr=:6666"] | |
| initialDelaySeconds: 1 | |
| livenessProbe: | |
| exec: | |
| command: ["/root/grpc_health_probe", "-addr=:6666"] | |
| initialDelaySeconds: 2 | |
| imagePullPolicy: IfNotPresent |
| package consumers | |
| import ( | |
| "errors" | |
| "fmt" | |
| "os" | |
| "runtime" | |
| "sync/atomic" | |
| "time" |
| package client | |
| import ( | |
| "context" | |
| "crypto/md5" | |
| "crypto/tls" | |
| "encoding/json" | |
| "errors" | |
| "fmt" | |
| "net" |
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "time" | |
| "golang.org/x/net/context" | |
| "github.com/husobee/backdrop" |
| import ( | |
| log "github.com/sirupsen/logrus" | |
| "github.com/jinzhu/gorm" | |
| ) | |
| type GormLogger struct {} | |
| func (*GormLogger) Print(v ...interface{}) { | |
| if v[0] == "sql" { | |
| log.WithFields(log.Fields{"module": "gorm", "type": "sql"}).Print(v[3]) |
| package main | |
| import ( | |
| "net/http" | |
| ) | |
| type SingleHost struct { | |
| handler http.Handler | |
| allowedHost string | |
| } |
| <?php | |
| /** | |
| * ORM implementation. | |
| * | |
| * BaseModel realizes all logic for managing database connections and | |
| * work with entities which stored in database as plain PHP objects. | |
| * | |
| * This implementation supports object relations: | |
| * | |
| * * one to one |