Information regarding sidepit public api
input and output protocol
Client are users/traders sending orders to Sidepit
Client sends messages using NNG push
of the Pipeline Scalability Protocol.
client port# - 12121
Clients sends signed Transaction
messages
- Opening a
push
socket - Dialing
tcp://api.sidepit.com:12121
- Serializing into protobuf
- Sending message
Transaction
version
timestamp (nano seconds)
oneof - New, Cancel, Auction
id - ordinals address / pubkey
signature - signed ecdsa (bitcoin curve)
Each Transaction can be oneof
NewOrder
cancel_orderid
AuctionBid
NewOrder
side
price
symbol
user_ref
cancel_orderid
orderid ( nanoseconds since contract start )
AuctionBid
epoch
hash
ordering_salt
bid ( in satoshis )
Protobuf Definitions: https://github.com/sidepit/Public-API/blob/main/nng-client/proto/spapi.proto
OrderId - microseconds since open
Global Unique orderID = traderID + nanoseconds epoch since contract start
Receiving MarketData from server using NNG sub
of the Pub/Sub Scalability Protocol.
price feed port# - 12122
Price Feed Client subscribes by:
- Opening as a
sub
socket - (with topic 0) - Dialing
tcp://api.sidepit.com:12122
- Receiving messages
- Desterilizing into Protobuf
PRICE FEED Clients receive MarketData
protobuf messages
MarketData
version
epoch
EpochBar
MarketQuote
DepthItem (x10)
EpochBar
symbol
epoch
open
high
low
close
volume
MarketQuote
bidsize
bid
ask
asksize
last
lastsize
upordown
symbol
epoch
DepthItem
level
b
a
bs
as
Receiving MarketData from server using NNG sub
of the Pub/Sub Scalability Protocol.
order feed port# - 12124
Order Feed Client subscribes by:
- Opening as a
sub
socket - (with topic 0) - future topics will contain
traderid
- Dialing
tcp://api.sidepit.com:12124
- Receiving messages
- Desterilizing into Protobuf
ORDER FEED Clients receive OrderData
protobuf messages
OrderData
version
epoch (nano seconds)
BookOrder [0+]
FillData [0+]
BookOrder
side
price
open_qty
filled_qty
remaining_qty
canceled_qty
agres_fill_qty
agres_avg_price
pass_fill_qty
avg_price
symbol
update_time
orderid
traderid
FillData
agressiveid
passiveid
price
qty
agressive_side // -1 for agressive sell, 1 for buy
Receiving live exchange data from server using NNG sub
of the Pub/Sub Scalability Protocol.
echo port# - 12123
ECHO Client subscribes by:
- Opening as a
sub
socket - (with topic 0) - Dialing
tcp://api.sidepit.com:12123
- Receiving messages
- Desterilizing into Protobuf
ECHO Clients receive streaming TxBlockStream
protobuf messages
TxBlockStream
epoch
txepoch
Each txepoch can be oneof
EpochEvent
Transaction
EpochEvent
epoch
hash
id
signature
Transaction
version
timestamp (nano seconds)
oneof - New, Cancel, Auction
id - ordinals address / pubkey
signature - signed ecdsa (bitcoin curve)
Each Transaction can be oneof
NewOrder
cancel_orderid
AuctionBid
NewOrder
side
price
symbol
user_ref
cancel_orderid
orderid ( nanoseconds since contract start )
AuctionBid
epoch
hash
ordering_salt
bid ( in satoshis )
Receiving positions and order status per traderid
from server using NNG REQ
of the Request/Reply (I ask, you answer), Scalability Protocol.
pos port# - 12125
POS Client sends Request and receives Reply
- Opening as a
req
socket - Dialing
tcp://api.sidepit.com:12125
- Serialize request into Protobuf
- Send Request message
- Receive Reply message
- Desterilizing reply into Protobuf
Request: POS Clients sends RequestPositions
protobuf messages
RequestPositions
traderid
symbol
Reply: POS Clients receive TraderPositionOrders
protobuf messages
TraderPositionOrders
traderid
symbol
Position
map<string, OrderFills> // OrderFills keyed on `orderid`
Position
position // -1 for short 1, 1 for long 1
avg_price
OrderFills
BookOrder
FillData [0+]
BookOrder
side
price
open_qty
filled_qty
remaining_qty
canceled_qty
agres_fill_qty
agres_avg_price
pass_fill_qty
avg_price
symbol
update_time
orderid
traderid
FillData
agressiveid
passiveid
price
qty
agressive_side // -1 for agressive sell, 1 for buy