Block Trading
Gemini Block TradingTM is a fully electronic block trading facility that enables traders to buy and sell large block quantities of digital assets outside of the auction and continuous order books.
See https://gemini.com/marketplace/#gemini-block-trading for more details.
Workflow
Taker places an IOI
A taker sends an IOI with the following details:
- symbol
- limit price
- side
- quantity
- optional: minimum fill quantity
- if supplied, minimum fill quantity must be
- greater than or equal to the minimum fill quantity for the symbol, and
- less than or equal to the quantity of the IOI (inclusive)
- if not supplied, the minimum fill quantity defaults to the minimum fill quantity for the symbol
- if supplied, minimum fill quantity must be
The IOI is firm until the expiry time, one minute after it is accepted. IOIs cannot be cancelled or changed.
See Block Trading: Takers for detailed documentation on how to submit an IOI.
IOI is broadcast to market makers
The IOI is broadcast to market makers with the following details:
- symbol
- quantity
- minimum fill quantity
- a collar price representing the midpoint of the continuous book at the time the taker placed the IOI
- an expiry time one minute after the IOI is broadcast to makers
Market makers respond
Makers submit may submit block limit orders in response up until the IOI expiry time.
- limit prices are required to be within plus or minus five percent of the collar price
- maker block orders have a minimum value outlined in the Symbols and Minimums section
- responses are firm and cannot be cancelled or changed
See Block Trading: Makers for details on how to receive and respond to IOIs.
Block trade executes
At the expiry time, the block trading engine matches the taker IOI against the maker responses.
If successful, the taker and maker(s) receive immediate notification of the trade
- via authenticated APIs that report private trades
- REST Get Past Trades
- WebSocket Order Events: Filled
- the FIX Order Entry session that placed the IOI or market maker block order will receive an Execution Report <8>
- the FIX Drop Copy session for the account will receive a Trade Capture Report <AE>
- via email, if email notifications are enabled in account settings
If unsuccessful or only partially successful, all remaining quantity and unfilled orders will be cancelled and closed.
- Any outstanding unfilled quantity on the original taker IOI is cancelled and closed.
- Any unfilled maker block orders are cancelled and closed.
- Notifcations arrive via authenticated private APIs and email, as above.
Block trade prints
Ten minutes later, the block trade prints to public APIs with the following details:
- the average price
- the total quantity filled
See Block Trading: Market Data for more details.
Third Party Support
Block trading FIX APIs offer third party support for both takers and market makers.
See FIX API documents for more information:
- New Order Single <D> messages representing taker and maker block limit orders will include the third party's Comp ID string in OnBehalfOfCompID <115> in the Standard Header
- similarly, Execution Report <8> responses to these block limit orders will echo back the third party's Comp ID string in DeliverToCompID <128> in the Standard Header
- similarly, Execution Report <8> responses to these block limit orders will echo back the third party's Comp ID string in DeliverToCompID <128> in the Standard Header
- Drop Copy channel Trade Capture Report <AE> uses these conventions for Party IDs and Roles (Third Party Support)
Testing
Block trade testing is available in our sandbox environment.
Email trading@gemini.com to coordinate.
Symbols and Minimums
Symbols are formatted as CCY1CCY2
where prices are in CCY2
and quantities are in CCY1
. CCY1
is in the Currency
column and CCY2
is in the respective CCY2 Price Increment
column:
Symbol | Minimum Order Size | Tick Size | Quote Currency Price Increment |
---|---|---|---|
btcusd | 5 BTC | 0.00000001 BTC (1e-8) | 0.01 USD |
btceur | 5 BTC | 0.00000001 BTC (1e-8) | 0.01 EUR |
btcgbp | 5 BTC | 0.00000001 BTC (1e-8) | 0.01 GBP |
btcsgd | 5 BTC | 0.00000001 BTC (1e-8) | 0.01 SGD |
ethusd | 100 ETH | 0.000001 ETH (1e-6) | 0.01 USD |
etheur | 100 ETH | 0.000001 ETH (1e-6) | 0.01 EUR |
ethgbp | 100 ETH | 0.000001 ETH (1e-6) | 0.01 GBP |
ethsgd | 100 ETH | 0.000001 ETH (1e-6) | 0.01 SGD |
zecusd | 200 ZEC | 0.000001 ZEC (1e-6) | 0.01 USD |
bchusd | 100 BCH | 0.000001 BCH (1e-6) | 0.01 USD |
ltcusd | 500 LTC | 0.00001 LTC (1e-5) | 0.01 USD |
batusd | 50,000 BAT | 0.000001 BAT (1e-6) | 0.00001 USD (1e-5) |
daiusd | 8,000 DAI | 0.000001 DAI (1e-6) | 0.00001 USD (1e-5) |
linkusd | 3,000 LINK | 0.000001 LINK (1e-6) | 0.00001 USD (1e-5) |
oxtusd | 50,000 OXT | 0.000001 OXT (1e-6) | 0.00001 USD (1e-5) |
ampusd | 1,500,000 AMP | 0.000001 AMP (1e-6) | 0.00001 USD (1e-5) |
compusd | 60 COMP | 0.000001 COMP (1e-6) | 0.01 USD |
paxgusd | 5 PAXG | 0.00000001 PAXG (1e-8) | 0.01 USD |
mkrusd | 20 MKR | 0.000001 MKR (1e-6) | 0.01 USD |
zrxusd | 25,000 ZRX | 0.000001 ZRX (1e-6) | 0.00001 USD (1e-5) |
kncusd | 6,000 KNC | 0.000001 KNC (1e-6) | 0.00001 USD (1e-5) |
manausd | 250,000 MANA | 0.000001 MANA (1e-6) | 0.00001 USD (1e-5) |
storjusd | 60,000 STORJ | 0.000001 STORJ (1e-6) | 0.00001 USD (1e-5) |
snxusd | 2,000 SNX | 0.000001 SNX (1e-6) | 0.0001 USD (1e-4) |
crvusd | 8,000 CRV | 0.000001 CRV (1e-6) | 0.0001 USD (1e-4) |
balusd | 500 BAL | 0.000001 BAL (1e-6) | 0.0001 USD (1e-4) |
uniusd | 1,500 UNI | 0.000001 UNI (1e-6) | 0.0001 USD (1e-4) |
renusd | 40,000 REN | 0.000001 REN (1e-6) | 0.00001 USD (1e-5) |
umausd | 800 UMA | 0.000001 UMA (1e-6) | 0.0001 USD (1e-4) |
yfiusd | 1 YFI | 0.000001 YFI (1e-6) | 0.01 USD |
aaveusd | 150 AAVE | 0.000001 AAVE (1e-6) | 0.0001 USD (1e-4) |
filusd | 3,000 FIL | 0.000001 FIL (1e-6) | 0.0001 USD (1e-4) |
sklusd | 25,000 SKL | 0.000001 SKL (1e-6) | 0.00001 USD (1e-5) |
grtusd | 4,500 GRT | 0.000001 GRT (1e-6) | 0.0001 USD (1e-4) |
bntusd | 1,200 BNT | 0.000001 BNT (1e-6) | 0.0001 USD (1e-4) |
1inchusd | 2,200 1INCH | 0.000001 1INCH (1e-6) | 0.0001 USD (1e-4) |
enjusd | 7,000 ENJ | 0.000001 ENJ (1e-6) | 0.0001 USD (1e-4) |
lrcusd | 14,000 LRC | 0.000001 LRC (1e-6) | 0.00001 USD (1e-5) |
sandusd | 25,000 SAND | 0.000001 SAND (1e-6) | 0.00001 USD (1e-5) |
cubeusd | 4,400 CUBE | 0.000001 CUBE (1e-6) | 0.0001 USD (1e-4) |
lptusd | 400 LPT | 0.000001 LPT (1e-6) | 0.0001 USD (1e-4) |
bondusd | 225 BOND | 0.000001 BOND (1e-6) | 0.0001 USD (1e-4) |
maticusd | 27,500 MATIC | 0.000001 MATIC (1e-6) | 0.00001 USD (1e-5) |
injusd | 710 INJ | 0.000001 INJ (1e-6) | 0.0001 USD (1e-4) |
sushiusd | 645 SUSHI | 0.000001 SUSHI (1e-6) | 0.0001 USD (1e-4) |
dogeusd | 27,500 DOGE | 0.000001 DOGE (1e-6) | 0.00001 USD (1e-5) |
alcxusd | 7 ALCX | 0.000001 ALCX (1e-6) | 0.01 USD (1e-2) |
mirusd | 990 MIR | 0.000001 MIR (1e-6) | 0.0001 USD (1e-4) |
ftmusd | 15,384 FTM | 0.000001 FTM (1e-6) | 0.0001 USD (1e-4) |
ankrusd | 56,433 ANKR | 0.000001 ANKR (1e-6) | 0.00001 USD (1e-5) |
btcgusd | 5 BTC | 0.00000001 BTC (1e-8) | 0.01 GUSD |
ethgusd | 100 ETH | 0.000001 ETH (1e-6) | 0.01 GUSD |
ctxusd | 1,150 CTX | 0.000001 CTX (1e-6) | 0.0001 USD (1e-4) |
xtzusd | 2,500 XTZ | 0.000001 XTZ (1e-6) | 0.0001 USD (1e-4) |
axsusd | 228 AXS | 0.000001 AXS (1e-6) | 0.01 USD (1e-2) |
slpusd | 47,665 SLP | 0.000001 SLP (1e-6) | 0.00001 USD (1e-5) |
lunausd | 710 LUNA | 0.000001 LUNA (1e-6) | 0.00000001 USD (1e-8) |
ustusd | 10,000 UST | 0.000001 UST (1e-6) | 0.0001 USD (1e-4) |
mco2usd | 1,500 MCO2 | 0.000001 MCO2 (1e-6) | 0.01 USD (1e-2) |
wcfgusd | 5,319 WCFG | 0.000001 WCFG (1e-6) | 0.001 USD (1e-3) |
rareusd | 9,901 RARE | 0.000001 RARE (1e-6) | 0.001 USD (1e-3) |
radusd | 1,215 RAD | 0.000001 RAD (1e-6) | 0.001 USD (1e-3) |
qntusd | 35 QNT | 0.000001 QNT (1e-6) | 0.01 USD (1e-2) |
nmrusd | 244 NMR | 0.000001 NMR (1e-6) | 0.001 USD (1e-3) |
maskusd | 1,120 MASK | 0.000001 MASK (1e-6) | 0.001 USD (1e-3) |
fetusd | 14,002 FET | 0.000001 FET (1e-6) | 0.00001 USD (1e-5) |
ashusd | 535 ASH | 0.000001 ASH (1e-6) | 0.001 USD (1e-3) |
audiousd | 4,762 AUDIO | 0.000001 AUDIO (1e-6) | 0.001 USD (1e-3) |
api3usd | 3,205 API3 | 0.000001 API3 (1e-6) | 0.001 USD (1e-3) |
usdcusd | 10,000 USDC | 0.000001 USDC (1e-6) | 0.001 USD (1e-3) |
shibusd | 141,362,737 SHIB | 0.000001 SHIB (1e-6) | 0.000000001 USD (1e-9) |
rndrusd | 1,520 RNDR | 0.000001 RNDR (1e-6) | 0.001 USD (1e-3) |
mcusd | 1,245 MC | 0.000001 MC (1e-6) | 0.001 USD (1e-3) |
galausd | 44,817 GALA | 0.000001 GALA (1e-6) | 0.00001 USD (1e-5) |
ensusd | 203 ENS | 0.000001 ENS (1e-6) | 0.001 USD (1e-3) |
kp3rusd | 8 KP3R | 0.000001 KP3R (1e-6) | 0.01 USD (1e-2) |
cvcusd | 20,204 CVC | 0.000001 CVC (1e-6) | 0.00001 USD (1e-5) |
elonusd | 5,617,977,528 ELON | 0.000001 ELON (1e-6) | 0.000000001 USD (1e-9) |
mimusd | 10,000 MIM | 0.000001 MIM (1e-6) | 0.0001 USD (1e-4) |
spellusd | 528,725 SPELL | 0.000001 SPELL (1e-6) | 0.00001 USD (1e-5) |
tokeusd | 100 TOKE | 0.000001 TOKE (1e-6) | 0.001 USD (1e-3) |
ldousd | 2,000 LDO | 0.000001 LDO (1e-6) | 0.001 USD (1e-3) |
rlyusd | 20,000 RLY | 0.000001 RLY (1e-6) | 0.00001 USD (1e-5) |
solusd | 200 SOL | 0.000001 SOL (1e-6) | 0.001 USD (1e-3) |
rayusd | 6,000 RAY | 0.000001 RAY (1e-6) | 0.001 USD (1e-3) |
sbrusd | 300,000 SBR | 0.000001 SBR (1e-6) | 0.000001 USD (1e-6) |
apeusd | 4000 APE | 0.000001 APE (1e-6) | 0.001 USD (1e-3) |
rbnusd | 7000 RBN | 0.000001 RBN (1e-6) | 0.001 USD (1e-3) |
fxsusd | 600 FXS | 0.000001 FXS (1e-6) | 0.001 USD (1e-3) |
dpiusd | 60 DPI | 0.000001 DPI (1e-6) | 0.01 USD (1e-2) |
lqtyusd | 3000 LQTY | 0.000001 LQTY (1e-6) | 0.001 USD (1e-3) |
lusdusd | 10000 LUSD | 0.000001 LUSD (1e-6) | 0.001 USD (1e-3) |
fraxusd | 10000 FRAX | 0.000001 FRAX (1e-6) | 0.001 USD (1e-3) |
indexusd | 2000 INDEX | 0.000001 INDEX (1e-6) | 0.001 USD (1e-3) |
mplusd | 700 MPL | 0.000001 MPL (1e-6) | 0.001 USD (1e-3) |
gusdsgd | 30000 GUSD | 0.000001 GUSD (1e-6) | 0.001 SGD (1e-3) |
metisusd | 100 METIS | 0.000001 METIS (1e-6) | 0.01 USD (1e-2) |
qrdousd | 8000 QRDO | 0.000001 QRDO (1e-6) | 0.001 USD (1e-3) |
zbcusd | 500000 ZBC | 0.000001 ZBC (1e-6) | 0.00001 USD (1e-5) |
chzusd | 100000 CHZ | 0.000001 CHZ (1e-6) | 0.00001 USD (1e-5) |
revvusd | 200000 REVV | 0.000001 REVV (1e-6) | 0.00001 USD (1e-5) |
jamusd | 2000000 JAM | 0.000001 JAM (1e-6) | 0.00001 USD (1e-5) |
fidausd | 10000 FIDA | 0.000001 FIDA (1e-6) | 0.001 USD (1e-3) |
gmtusd | 30000 GMT | 0.000001 GMT (1e-6) | 0.00001 USD (1e-5) |
gfiusd | 9000 GFI | 0.000001 GFI (1e-6) | 0.001 USD (1e-3) |
orcausd | 10000 ORCA | 0.000001 ORCA (1e-6) | 0.001 USD (1e-3) |
aliusd | 500000 ALI | 0.000001 ALI (1e-6) | 0.000001 USD (1e-6) |
truusd | 200000 TRU | 0.000001 TRU (1e-6) | 0.00001 USD (1e-5) |
Block trading taker orders may optionally supply a minimum quantity: when present, this value must be greater than or equal to the minimum order size for the symbol. When absent, the minimum fill quantity will be the minimum order size for the symbol.
All Supported Symbols
btcusd
ethbtc
ethusd
zecusd
zecbtc
zeceth
zecbch
zecltc
bchusd
bchbtc
bcheth
ltcusd
ltcbtc
ltceth
ltcbch
batusd
daiusd
linkusd
oxtusd
batbtc
linkbtc
oxtbtc
bateth
linketh
oxteth
ampusd
compusd
paxgusd
mkrusd
zrxusd
kncusd
manausd
storjusd
snxusd
crvusd
balusd
uniusd
renusd
umausd
yfiusd
btcdai
ethdai
aaveusd
filusd
btceur
btcgbp
etheur
ethgbp
btcsgd
ethsgd
sklusd
grtusd
bntusd
1inchusd
enjusd
lrcusd
sandusd
cubeusd
lptusd
bondusd
maticusd
injusd
sushiusd
dogeusd
alcxusd
mirusd
ftmusd
ankrusd
btcgusd
ethgusd
ctxusd
xtzusd
axsusd
slpusd
lunausd
ustusd
mco2usd
dogebtc
dogeeth
wcfgusd
rareusd
radusd
qntusd
nmrusd
maskusd
fetusd
ashusd
audiousd
api3usd
usdcusd
shibusd
rndrusd
mcusd
galausd
ensusd
kp3rusd
cvcusd
elonusd
mimusd
spellusd
tokeusd
ldousd
rlyusd
solusd
rayusd
sbrusd
apeusd
rbnusd
fxsusd
dpiusd
lqtyusd
lusdusd
fraxusd
indexusd
mplusd
gusdsgd
metisusd
qrdousd
zbcusd
chzusd
revvusd
jamusd
fidausd
gmtusd
gfiusd
orcausd
aliusd
truusd
Precision
Quantity and price on incoming orders are strictly held to the minimums and increments on the table shown above.
However, notional values and average prices may exhibit additional precision down to two decimal places past the "minimum order increment" listed above.
Takers
Takers can place an IOI using FIX, REST, or the UI.
- IOIs are firm and cannot be cancelled.
- IOIs are anonymous.
- The IOI is broadcast to market makers with the following information:
- quantity
- minimum fill quantity
- collar price (which is the midpoint of the continuous book at the time the IOI was placed)
- expiry time
- Market makers have up until the expiry time to respond.
- After one minute, the block trading engine will auto-match the IOI with market maker responses.
- partial fills are allowed but the minimum fill quantity of the order must be met
- partial fills are allowed but the minimum fill quantity of the order must be met
FIX
Place an IOI by creating a New Order Single <D> message with:
- ExecInst <18> set to
j = Single Execution Requested For Block Trade
- TimeInForce<59> set to
3 = Immediate Or Cancel (IOC)
- MinQty <110> is optional - see Symbols and Minimums
- if present, must be greater than or equal to the minimum quantity for the symbol
- if absent, will default to the minimum quantity for the symbol
Example IOI
This is a New Order Single <D> message representing an IOI to sell 20 BTC (minimum fill quantity 10 BTC) at a limit price of 999.99 USD. Some details worth noting: - The block order’s limit price must be within 5% of the midpoint of the related continuous order book at the time of order submission.
RAW
8=FIX.4.4|9=149|35=D|34=2|49=DEV|52=20180322-22:20:54.327|56=GEMINI|11=eSdLCsZRXiyNtbh|18=j|38=20|40=2|44=999.99|54=2|55=BTCUSD|59=3|60=19700101-00:00:00.003|110=10|10=212|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 149
34 MsgSeqNum: 2
35 MsgType: NewOrderSingle (D)
49 SenderCompID: DEV
52 SendingTime: 20180322-22:20:54.327
56 TargetCompID: GEMINI
BODY
11 ClOrdID: eSdLCsZRXiyNtbh
18 ExecInst: SINGLE_EXECUTION_REQUESTED_FOR_BLOCK_TRADE (j)
38 OrderQty: 20
40 OrdType: LIMIT (2)
44 Price: 999.99
54 Side: SELL (2)
55 Symbol: BTCUSD
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180322-22:20:54.324
110 MinQty: 10
TRAILER
10 CheckSum: 212
IOI Accepted
Execution Report <8> showing that the IOI has been accepted.
RAW
8=FIX.4.4|9=171|35=8|34=2|49=GEMINI|52=20180322-22:20:54.588|56=DEV|6=0|11=eSdLCsZRXiyNtbh|14=0|17=29|37=28|38=20|39=0|44=999.99|54=2|55=BTCUSD|59=3|60=20180218-18:45:02.017|150=0|151=20|10=126|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 171
34 MsgSeqNum: 2
35 MsgType: ExecutionReport (8)
49 SenderCompID: GEMINI
52 SendingTime: 20180322-22:20:54.588
56 TargetCompID: DEV
BODY
6 AvgPx: 0
11 ClOrdID: eSdLCsZRXiyNtbh
14 CumQty: 0
17 ExecID: 29
37 OrderID: 28
38 OrderQty: 20
39 OrdStatus: NEW (0)
44 Price: 999.99
54 Side: SELL (2)
55 Symbol: BTCUSD
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180322-22:20:54.587
150 ExecType: NEW (0)
151 LeavesQty: 20
TRAILER
10 CheckSum: 126
IOI Executes
After the taker order is accepted, makers receive an IOI advertisement that contains the quantity, minimum quantity, and a collar price (the midpoint of the Gemini continuous book). The IOI has an expiry time of one minute, during which makers may submit but not cancel block orders.
In this example, imagine that a single maker placed a block order to buy 10 BTC at 1000 USD. When the block trade engine automatches the maker order against the taker order at the expiry time, this will partially fill the IOI.
The taker would receive two Execution Report <8> messages showing the partial fill and the remaining quantity being cancelled.
IOI Partial Fill
RAW
8=FIX.4.4|9=220|35=8|34=3|49=GEMINI|52=20180322-22:20:54.735|56=DEV|6=1000|11=eSdLCsZRXiyNtbh|12=100.0000|13=3|14=10|17=33|31=1000|32=10|37=28|38=20|39=1|44=999.99|54=2|55=BTCUSD|59=3|60=20180218-18:45:02.021|150=F|151=10|479=USD|851=2|10=122|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 220
34 MsgSeqNum: 3
35 MsgType: ExecutionReport (8)
49 SenderCompID: GEMINI
52 SendingTime: 20180322-22:20:54.735
56 TargetCompID: DEV
BODY
6 AvgPx: 1000
11 ClOrdID: eSdLCsZRXiyNtbh
12 Commission: 100.0000
13 CommType: ABSOLUTE (3)
14 CumQty: 10
17 ExecID: 33
31 LastPx: 1000
32 LastQty: 10
37 OrderID: 28
38 OrderQty: 20
39 OrdStatus: PARTIALLY_FILLED (1)
44 Price: 999.99
54 Side: SELL (2)
55 Symbol: BTCUSD
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180322-22:20:54.734
150 ExecType: TRADE (F)
151 LeavesQty: 10
479 CommCurrency: USD
851 LastLiquidityInd: REMOVED_LIQUIDITY (2)
TRAILER
10 CheckSum: 122
IOI Remaining Quantity Cancelled
RAW
8=FIX.4.4|9=199|35=8|34=4|49=GEMINI|52=20180322-22:20:54.746|56=DEV|6=1000|11=eSdLCsZRXiyNtbh|14=10|17=34|37=28|38=20|39=4|44=999.99|54=2|55=BTCUSD|58=IOI_UNFILLED_QUANTITY|59=3|60=20180218-18:45:02.022|150=4|151=0|10=050|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 199
34 MsgSeqNum: 4
35 MsgType: ExecutionReport (8)
49 SenderCompID: GEMINI
52 SendingTime: 20180322-22:20:54.746
56 TargetCompID: DEV
BODY
6 AvgPx: 1000
11 ClOrdID: eSdLCsZRXiyNtbh
14 CumQty: 10
17 ExecID: 34
37 OrderID: 28
38 OrderQty: 20
39 OrdStatus: CANCELED (4)
44 Price: 999.99
54 Side: SELL (2)
55 Symbol: BTCUSD
58 Text: IOI_UNFILLED_QUANTITY
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180218-18:45:02.022
150 ExecType: CANCELED (4)
151 LeavesQty: 0
TRAILER
10 CheckSum: 050
REST
Placing the IOI
Use the REST New Order endpoint to place an IOI by specifying the indication-of-interest
execution option.
import requests
import json
import base64
import hmac
import hashlib
import datetime, time
base_url = "https://api.gemini.com"
endpoint = "/v1/order/new"
url = base_url + endpoint
gemini_api_key = "mykey"
gemini_api_secret = "1234abcd".encode()
t = datetime.datetime.now()
payload_nonce = str(int(time.mktime(t.timetuple())*1000))
payload = {
"request": "/v1/order/new",
"nonce": payload_nonce,
"symbol": "btcusd",
"amount": "100",
"price": "3630.00",
"side": "buy",
"type": "exchange limit",
"options": ["indication-of-interest"]
}
encoded_payload = json.dumps(payload).encode()
b64 = base64.b64encode(encoded_payload)
signature = hmac.new(gemini_api_secret, b64, hashlib.sha384).hexdigest()
request_headers = { 'Content-Type': "text/plain",
'Content-Length': "0",
'X-GEMINI-APIKEY': gemini_api_key,
'X-GEMINI-PAYLOAD': b64,
'X-GEMINI-SIGNATURE': signature,
'Cache-Control': "no-cache" }
response = requests.post(url,
data=None,
headers=request_headers)
block_order = response.json()
print(block_order)
with this order status response
{
"order_id" : "3330619289",
"id" : "3330619289",
"symbol" : "btcusd",
"exchange" : "gemini",
"avg_execution_price" : "0.00",
"client_order_id": "20190110-4738721",
"side" : "buy",
"type" : "indication-of-interest limit",
"timestamp" : "1424285102",
"timestampms" : 1424285102000,
"is_live" : True,
"is_cancelled" : False,
"is_hidden" : True,
"was_forced" : False,
"executed_amount" : "0",
"remaining_amount" : "100",
"options" : ["indication-of-interest"],
"price" : "3360.00",
"original_amount" : "100"
}
Checking the status
Gemini recommends using our WebSocket Order Events API to get realtime notification of:
- your IOI order being accepted or rejected
- your IOI being filled
- your IOI being closed
However, if using our Order Entry API is not possible, then wait one minute and check the REST: Get Past Trades endpoint for trades referencing the order_id
shown in the response to the original order.
UI
Log in to https://exchange.gemini.com and use the Block Trading tab to place an IOI.
Makers
Block trade market makers receive and respond to indications of interest IOI <6> messages uaing a FIX Order Entry channel. REST and UI APIs are not available at this time.
For more information about becoming a market maker, contact bizdev@gemini.com.
Receive IOI
Once your account is set up as a block trade market maker, you will begin receiving IOI <6> messages on all your FIX Order Entry channels.
You may respond to the IOI on any channel but you will only receive execution reports on the channel that responds to the IOI. (Your drop copy channel will receive notifications of all trades; see FIX Drop Copy: Examples: Block Limit Order Filled for an example.)
In this example, the taker has placed an IOI to buy 15 BTC at a price of 1000.10 USD with a minimum fill quantity of 10 BTC.
The IOI the market maker receives has no side and the PRICE
stipulation shows a collar price of 1000.0 USD, the midpoint of the continuous book at the time the order was placed:
RAW
8=FIX.4.4|9=155|35=6|34=2|49=GEMINI|52=20180408-04:33:37.296|56=TESTOE001|23=28|27=15|28=N|54=7|55=BTCUSD|62=20180408-04:34:32.016|232=2|233=MINQTY|234=10|233=PRICE|234=1000.00|10=071|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 155
34 MsgSeqNum: 2
35 MsgType: IndicationOfInterest (6)
49 SenderCompID: GEMINI
52 SendingTime: 20180408-04:33:37.296
56 TargetCompID: TESTOE001
BODY
23 IOIID: 28
27 IOIQty: 15
28 IOITransType: NEW (N)
54 Side: UNDISCLOSED (7)
55 Symbol: BTCUSD
62 ValidUntilTime: 20180408-04:34:32.016
NoStipulations: count = 2
233 StipulationType: MINIMUM_QUANTITY (MINQTY)
234 StipulationValue: 10
----
233 StipulationType: PRICE_RANGE (PRICE)
234 StipulationValue: 1000.00
TRAILER
10 CheckSum: 071
Respond to IOI
Place an IOI by creating a New Order Single <D> message with:
- IOIID <23> set to the IOIID value in the IOIID
- TimeInForce<59> set to
3 = Immediate Or Cancel (IOC)
The response must be received before the ValidUntilTime <62> timestamp. All responses are fix and cannot be cancelled or changed.
In this example, the market maker places a buy order:
RAW
8=FIX.4.4|9=145|35=D|34=2|49=TESTOE001|52=20180408-04:33:37.466|56=GEMINI|11=dessertspoonfuls|23=28|38=10|40=2|44=1000.50|54=1|55=BTCUSD|59=3|60=19700101-00:00:00.013|10=004|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 145
34 MsgSeqNum: 2
35 MsgType: NewOrderSingle (D)
49 SenderCompID: TESTOE001
52 SendingTime: 20180408-04:33:37.466
56 TargetCompID: GEMINI
BODY
11 ClOrdID: dessertspoonfuls
23 IOIID: 28
38 OrderQty: 10
40 OrdType: LIMIT (2)
44 Price: 1000.50
54 Side: BUY (1)
55 Symbol: BTCUSD
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180408-04:33:37.465
TRAILER
10 CheckSum: 004
and receives an Execution Report <8> showing the order was accepted.
RAW
8=FIX.4.4|9=173|35=8|34=3|49=GEMINI|52=20180408-04:33:37.621|56=TESTOE001|6=0|11=dessertspoonfuls|14=0|17=31|37=30|38=10|39=0|44=1000.50|54=1|55=BTCUSD|59=3|60=20180408-04:33:37.602|150=0|151=10|10=204|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 173
34 MsgSeqNum: 3
35 MsgType: ExecutionReport (8)
49 SenderCompID: GEMINI
52 SendingTime: 20180408-04:33:37.621
56 TargetCompID: TESTOE001
BODY
6 AvgPx: 0
11 ClOrdID: dessertspoonfuls
14 CumQty: 0
17 ExecID: 31
37 OrderID: 30
38 OrderQty: 10
39 OrdStatus: NEW (0)
44 Price: 1000.50
54 Side: BUY (1)
55 Symbol: BTCUSD
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180408-04:33:37.602
150 ExecType: NEW (0)
151 LeavesQty: 10
TRAILER
10 CheckSum: 204
Similarly, a sell order:
RAW
8=FIX.4.4|9=144|35=D|34=3|49=TESTOE001|52=20180408-04:33:37.630|56=GEMINI|11=quasigeostrophic|23=28|38=10|40=2|44=999.25|54=2|55=BTCUSD|59=3|60=20180408-04:33:37.622|10=210|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 144
34 MsgSeqNum: 3
35 MsgType: NewOrderSingle (D)
49 SenderCompID: TESTOE001
52 SendingTime: 20180408-04:33:37.630
56 TargetCompID: GEMINI
BODY
11 ClOrdID: quasigeostrophic
23 IOIID: 28
38 OrderQty: 10
40 OrdType: LIMIT (2)
44 Price: 999.25
54 Side: SELL (2)
55 Symbol: BTCUSD
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180408-04:33:37.622
TRAILER
10 CheckSum: 210
Which is also accepted:
RAW
8=FIX.4.4|9=172|35=8|34=4|49=GEMINI|52=20180408-04:33:37.634|56=TESTOE001|6=0|11=quasigeostrophic|14=0|17=33|37=32|38=10|39=0|44=999.25|54=2|55=BTCUSD|59=3|60=20180408-04:33:37.615|150=0|151=10|10=161|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 172
34 MsgSeqNum: 4
35 MsgType: ExecutionReport (8)
49 SenderCompID: GEMINI
52 SendingTime: 20180408-04:33:37.634
56 TargetCompID: TESTOE001
BODY
6 AvgPx: 0
11 ClOrdID: quasigeostrophic
14 CumQty: 0
17 ExecID: 33
37 OrderID: 32
38 OrderQty: 10
39 OrdStatus: NEW (0)
44 Price: 999.25
54 Side: SELL (2)
55 Symbol: BTCUSD
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180408-04:33:37.615
150 ExecType: NEW (0)
151 LeavesQty: 10
TRAILER
10 CheckSum: 161
Block Trade Executes
At the end of one minute, the block trading engine will auto-match the IOI against all the market makers' orders. The market makers then receive execution reports indicating whether their orders were filled, partially filled, or cancelled. No quantity remains.
In this example, the sell order is completely filled:
RAW
8=FIX.4.4|9=224|35=8|34=5|49=GEMINI|52=20180408-04:33:37.694|56=TESTOE001|6=999.25|11=quasigeostrophic|12=0.000000|13=3|14=10|17=35|31=999.25|32=10|37=32|38=10|39=2|44=999.25|54=2|55=BTCUSD|59=3|60=20150218-18:45:02.023|150=F|151=0|479=USD|851=1|10=135|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 224
34 MsgSeqNum: 5
35 MsgType: ExecutionReport (8)
49 SenderCompID: GEMINI
52 SendingTime: 20180408-04:33:37.694
56 TargetCompID: TESTOE001
BODY
6 AvgPx: 999.25
11 ClOrdID: quasigeostrophic
12 Commission: 0.000000
13 CommType: ABSOLUTE (3)
14 CumQty: 10
17 ExecID: 35
31 LastPx: 999.25
32 LastQty: 10
37 OrderID: 32
38 OrderQty: 10
39 OrdStatus: FILLED (2)
44 Price: 999.25
54 Side: SELL (2)
55 Symbol: BTCUSD
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180408-04:33:37.694
150 ExecType: TRADE (F)
151 LeavesQty: 0
479 CommCurrency: USD
851 LastLiquidityInd: ADDED_LIQUIDITY (1)
TRAILER
10 CheckSum: 135
The buy order is cancelled:
RAW
8=FIX.4.4|9=205|35=8|34=6|49=GEMINI|52=20180408-04:33:37.705|56=TESTOE001|6=0|11=dessertspoonfuls|14=0|17=38|37=30|38=10|39=4|44=1000.50|54=1|55=BTCUSD|58=BLOCK_TRADE_UNFILLED_QUANTITY|59=3|60=20150218-18:45:02.026|150=4|151=0|10=031|
HEADER
8 BeginString: FIX.4.4
9 BodyLength: 205
34 MsgSeqNum: 6
35 MsgType: ExecutionReport (8)
49 SenderCompID: GEMINI
52 SendingTime: 20180408-04:33:37.705
56 TargetCompID: TESTOE001
BODY
6 AvgPx: 0
11 ClOrdID: dessertspoonfuls
14 CumQty: 0
17 ExecID: 38
37 OrderID: 30
38 OrderQty: 10
39 OrdStatus: CANCELED (4)
44 Price: 1000.50
54 Side: BUY (1)
55 Symbol: BTCUSD
58 Text: BLOCK_TRADE_UNFILLED_QUANTITY
59 TimeInForce: IMMEDIATE_OR_CANCEL (3)
60 TransactTime: 20180408-04:33:37.705
150 ExecType: CANCELED (4)
151 LeavesQty: 0
TRAILER
10 CheckSum: 031
Market data
When an IOI executes and one or more fills on a block trade occur, the participants will be informed immediately.
Ten minutes afterward, a single entry will print to Gemini public market data showing:
- the average price
- the total quantity filled
Gemini do not publicly disclose any of the following:
- original order quantity
- individual fill details (quantity or price)
Public market data on block trades is available via FIX, WebSocket, and REST APIs.
FIX
To receive block trade notifications via FIX, make a Market Data Request <V> that includes MDEntryType <269> with value 2 = Trade
in the NoMDEntryTypes <267> group.
Sample notification shown in FIX Market Data: Examples: Block Trades.
WebSocket
An established market data subscription will receive block trade events. See WebSocket Market Data: Block Trade Event for more information.
{
"type":"update",
"eventId":1111597035,
"socket_sequence":8,
"timestamp":1501175027,
"timestampms":1501175027304,
"events":[
{
"type":"block_trade",
"tid":1111597035,
"price":"10100.00",
"amount":"1000"
}
]
}
REST
Block trades appear in the REST: Trade History endpoint with type
set to block
.
[
{
"timestamp":1523049820,
"timestampms":1523049820790,
"tid":334450985,
"price":"6659.99",
"amount":"20",
"exchange":"gemini",
"type":"block"
},
{
"timestamp":1523049744,
"timestampms":1523049744076,
"tid":334450970,
"price":"6660.03",
"amount":"10",
"exchange":"gemini",
"type":"block"
},
...
]
Revision History
Date | Notes |
---|---|
2018/04/06 | Initial Block Trade API documentation |
2019/12/06 | Lowering BTCUSD minimum and removing auction restrictions |
2020/01/24 | Update Third Party Execution Report details |
2020/04/09 | Documentation for new token support: BAT , DAI , LINK , OXT |
2020/08/28 | Removing DAIBTC and DAIETH trading pairs |
2020/09/11 | Documentation for new token support: AMP , COMP , PAXG |
2020/09/24 | Documentation for new token support: MKR , ZRX , KNC , MANA , STORJ , SNX , CRV , BAL , UNI , REN , UMA , YFI |
2020/10/05 | Documentation for new order book support: BTCDAI and ETHDAI |
2020/10/07 | Documentation for new token support: AAVE |
2020/10/14 | Documentation for new token support: FIL |
2020/10/26 | Documentation for new fiat support: GBP and EUR |
2020/03/22 | Documentation for new token support: SKL , GRT , BNT , 1INCH , ENJ , LRC , SAND |
2021/04/27 | Documentation for new token support: CUBE , LPT , BOND , MATIC , INJ , SUSHI |
2021/05/05 | Documentation for new token support: DOGE |
2021/06/16 | Documentation for new token support: ALCX , MIR , FTM , ANKR |
2021/07/14 | Documentation for new token support: CTX |
2021/07/21 | Documentation for new token support: XTZ |
2021/09/15 | Documentation for new token support: AXS , SLP , LUNA , UST , MCO2 |
2021/11/13 | Documentation for new token support: WCFG , RARE , RAD , QNT , NMR , MASK , FET , ASH , AUDIO , API3 , USDC , SHIB |
2021/12/20 | Documentation for new token support: RNDR , MC , GALA , ENS , KP3R , CVC , ELON , MIM , SPELL |
2022/02/01 | Documentation for new token support: TOKE , LDO , RLY |
2022/02/28 | Documentation for new token support: SOL |
2022/03/01 | Documentation for new token support: RAY', 'SBR |
2022/03/16 | Documentation for new token support: APE |
2022/03/29 | Documentation for new token support: RBN , FXS , DPI , LQTY , LUSD , FRAX , INDEX , MPL |
2022/04/26 | Documentation for new token support: GUSDSGD |
2022/04/27 | Documentation for new token support: METIS , QRDO , ZBC , CHZ , REVV , JAM , FIDA , GMT |
2022/05/17 | Documentation for new token support: GFI , ORCA |
2022/06/14 | Documentation for new token support: ALI , TRU |
- Trust is Our Product™
- For trademarks and patents, please see the Legal Notice.
- NMLS #1518126
- © Copyright 2022 Gemini Trust Company, LLC.