Reference
This page holds documentation on properties and class methods for all scripts.
Public APIs
Public
Class to fetch public data from the Gemini REST API
Source code in gemini_api/endpoints/public.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
|
get_auction_history(pair, since=None)
Retrieves auction events data since the specified timestamp as a whole number in unix time format, up to seven calendar days of market data. Returns most recent data if timestamp is not specified.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pair |
str
|
Trading pair e.g."BTCGBP" |
required |
since |
str
|
Date in YYYYDDMM format |
None
|
Returns:
Type | Description |
---|---|
List[Dict[str, Any]]
|
List of dictionary objects |
Source code in gemini_api/endpoints/public.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
|
get_candles(pair, time_frame)
Retrieves time-intervaled data for the trading pair and time frame - accepts the following time frames: 1m, 5m, 15m, 30m, 1hr, 6hr, 1day
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pair |
str
|
Trading pair e.g."BTCGBP" |
required |
time_frame |
str
|
Timeframe |
required |
Returns:
Type | Description |
---|---|
List[List[float]]
|
Nested lists of time-intervaled prices |
Source code in gemini_api/endpoints/public.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
get_current_auction(pair)
Retrieves current auction information, including auction price or indicative price
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pair |
str
|
Trading pair e.g."BTCGBP" |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dictionary of current auction information |
Source code in gemini_api/endpoints/public.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
get_order_book(pair)
Retrieves the current order book information, including bids and asks prices.
The quantities and prices returned are returned as strings rather than numbers. The numbers returned are exact, not rounded, and it can be dangerous to treat them as floating point numbers.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pair |
str
|
Trading pair e.g."BTCGBP" |
required |
Returns:
Type | Description |
---|---|
Dict[str, List[Dict[str, str]]]
|
Dictionary with keys "bids" and "asks" |
Source code in gemini_api/endpoints/public.py
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
get_pair_details(pair)
Retrieves the details for the trading pair
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pair |
str
|
Trading pair e.g."BTCGBP" |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dictionary containing the details of the trading pair |
Source code in gemini_api/endpoints/public.py
32 33 34 35 36 37 38 39 40 41 42 43 |
|
get_pairs()
Retrieves an array of available trading pairs
Returns:
Type | Description |
---|---|
List[str]
|
List of trading pairs, e.g. "BTCGBP" |
Source code in gemini_api/endpoints/public.py
19 20 21 22 23 24 25 26 27 28 29 30 |
|
get_price_feed()
Retrieves list of dictionary containing price and percentage change in last 24h for each trading pair
Returns:
Type | Description |
---|---|
List[Dict[str, str]]
|
List of dictionaries containing the price and change in price |
Source code in gemini_api/endpoints/public.py
186 187 188 189 190 191 192 193 194 195 196 197 |
|
get_ticker(pair)
Retrieves information about recent trading activity for the trading pair, including bid size, last price and volume
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pair |
str
|
Trading pair e.g."BTCGBP" |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dictionary containing the details of the pair's recent trades |
Source code in gemini_api/endpoints/public.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|
get_ticker_prices(pair)
Retrieves information about recent trading activity for the trading pair, including open, close, high, low and prices from every hour.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pair |
str
|
Trading pair e.g."BTCGBP" |
required |
Returns:
Type | Description |
---|---|
Dict[str, Any]
|
Dictionary containing the details of the pair's recent trades |
Source code in gemini_api/endpoints/public.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
get_trades_history(pair, since=None)
Retrieves executed trades data since the specified timestamp as a whole number in unix time format, up to seven calendar days of market data. Returns most recent data if timestamp is not specified
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pair |
str
|
Trading pair e.g."BTCGBP" |
required |
since |
str
|
Date in YYYYDDMM format |
None
|
Returns:
Type | Description |
---|---|
List[Dict[str, Any]]
|
List of dictionary objects containing the trade history |
Source code in gemini_api/endpoints/public.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
Authentication
Authentication
Bases: object
Class to manage authentication.
Class provides methods to authenticate and make requests to Gemini's APIs
Attributes:
Name | Type | Description |
---|---|---|
_public_key |
str
|
a public key for authentication |
_private_key |
str
|
a private_key for authentication |
_url |
base URL for Gemini API |
Methods
make_request: makes a request to an endpoint URL
Source code in gemini_api/authentication.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
__init__(public_key, private_key, sandbox=False)
Initialise authentication
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sandbox |
bool
|
flag for connecting to Sandbox environment |
False
|
Source code in gemini_api/authentication.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
make_request(endpoint, payload=None)
Makes a request to an endpoint in the API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
endpoint |
str
|
String to add to base URL |
required |
payload |
Dict[Any, Any]
|
Data to pass into encoded payload |
None
|
Returns:
Type | Description |
---|---|
Union[Dict[Any, Any], Any]
|
Dictionary containing response data |
Source code in gemini_api/authentication.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
Order Placement/Status APIs
Order
Class that manages order book placement to create new orders, wrap orders and cancel orders.
Source code in gemini_api/endpoints/order.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
|
__init__(auth, order_data)
Initialise Order class
Source code in gemini_api/endpoints/order.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
aggressor()
property
Property for whether this order was the taker in the trade
Returns:
Type | Description |
---|---|
bool
|
True if taker in the trade, False otherwise |
Source code in gemini_api/endpoints/order.py
465 466 467 468 469 470 471 472 473 |
|
avg_execution_price()
property
Property for the average price at which this order as been executed so far. 0 if the order has not been executed at all
Returns:
Type | Description |
---|---|
str
|
avg_execution_price |
Source code in gemini_api/endpoints/order.py
212 213 214 215 216 217 218 219 220 221 |
|
break_type()
property
Property for the break if the trade is broken
Returns:
Type | Description |
---|---|
str
|
Break |
Source code in gemini_api/endpoints/order.py
516 517 518 519 520 521 522 523 524 |
|
cancel_active_orders(auth)
classmethod
Method to cancel all active orders
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
Returns:
Type | Description |
---|---|
List[Order]
|
Order object |
Source code in gemini_api/endpoints/order.py
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 |
|
cancel_order(auth, order_id)
classmethod
Method to cancel an order
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
order_id |
str
|
The order id |
required |
Returns:
Type | Description |
---|---|
Order
|
Order object |
Source code in gemini_api/endpoints/order.py
616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 |
|
cancel_session_orders(auth)
classmethod
Method to cancel all session orders
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
Returns:
Type | Description |
---|---|
List[Order]
|
Order object |
Source code in gemini_api/endpoints/order.py
674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 |
|
client_order_id()
property
Property for the Client Order ID
Returns:
Type | Description |
---|---|
str
|
Client Order ID |
Source code in gemini_api/endpoints/order.py
182 183 184 185 186 187 188 189 190 |
|
deposit_fee()
property
Property for the deposit fee quantity - will be applied if a debit card is used for the order. Will return 0 if there is no deposit fee
Returns:
Type | Description |
---|---|
str
|
depositFee |
Source code in gemini_api/endpoints/order.py
443 444 445 446 447 448 449 450 451 452 453 |
|
deposit_fee_currency()
property
Property for the currency in which the deposit fee is taken
Returns:
Type | Description |
---|---|
str
|
Currency |
Source code in gemini_api/endpoints/order.py
455 456 457 458 459 460 461 462 463 |
|
exchange()
property
Property for the exchange (always "gemini")
Returns:
Type | Description |
---|---|
str
|
exchange |
Source code in gemini_api/endpoints/order.py
202 203 204 205 206 207 208 209 210 |
|
executed_amount()
property
Property for the amount of the order that has been filled
Returns:
Type | Description |
---|---|
float
|
Executed amount |
Source code in gemini_api/endpoints/order.py
319 320 321 322 323 324 325 326 327 |
|
fee()
property
Property for the fee amount charged
Returns:
Type | Description |
---|---|
str
|
Fee |
Source code in gemini_api/endpoints/order.py
423 424 425 426 427 428 429 430 431 |
|
fee_amount()
property
Property for the amount charged
Returns:
Type | Description |
---|---|
str
|
Fee |
Source code in gemini_api/endpoints/order.py
475 476 477 478 479 480 481 482 483 |
|
fee_currency()
property
Property for the currency that the fee was paid in
Returns:
Type | Description |
---|---|
str
|
Currency |
Source code in gemini_api/endpoints/order.py
433 434 435 436 437 438 439 440 441 |
|
get_active_orders(auth)
classmethod
Method to get active orders
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
Returns:
Type | Description |
---|---|
List[Order]
|
List of Order objects |
Source code in gemini_api/endpoints/order.py
793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 |
|
get_past_trades(auth, symbol, since=None, limit_trades=None)
classmethod
Method to get past trades
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
symbol |
str
|
Trading pair |
required |
since |
str
|
Date in YYYYMMDD format |
None
|
limit_trades |
int
|
Maximum number of trades to return, min 50 max 500 |
None
|
Returns:
Type | Description |
---|---|
List[Order]
|
List of Order objects |
Source code in gemini_api/endpoints/order.py
817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 |
|
heartbeat()
property
Property for the heartbeat if set as an option in api settings which always returns "ok"
Returns:
Type | Description |
---|---|
str
|
Result |
Source code in gemini_api/endpoints/order.py
526 527 528 529 530 531 532 533 534 535 |
|
id()
property
Property for the ID
Returns:
Type | Description |
---|---|
str
|
ID |
Source code in gemini_api/endpoints/order.py
172 173 174 175 176 177 178 179 180 |
|
is_auction_fill()
property
Property for the auction status
Returns:
Type | Description |
---|---|
bool
|
True if the trade was filled at an auction, False otherwise |
Source code in gemini_api/endpoints/order.py
495 496 497 498 499 500 501 502 503 |
|
is_cancelled()
property
Property for the cancelled status of an order
Returns:
Type | Description |
---|---|
bool
|
True if the order has been canceled |
Source code in gemini_api/endpoints/order.py
288 289 290 291 292 293 294 295 296 |
|
is_clearing_fill()
property
Property for the clearing status
Returns:
Type | Description |
---|---|
bool
|
True if the trade was a clearing trade at and not on an |
bool
|
on-exchange trade, False otherwise |
Source code in gemini_api/endpoints/order.py
505 506 507 508 509 510 511 512 513 514 |
|
is_hidden()
property
Property for the hidden status of an order
Returns:
Type | Description |
---|---|
bool
|
Will always return false unless the order was placed with |
bool
|
the indication-of-interest execution option. |
Source code in gemini_api/endpoints/order.py
298 299 300 301 302 303 304 305 306 307 |
|
is_live()
property
Property for the active status of an order
Returns:
Type | Description |
---|---|
bool
|
True if the order is on the book (has remaining quantity |
bool
|
and has not been canceled), false otherwise |
Source code in gemini_api/endpoints/order.py
277 278 279 280 281 282 283 284 285 286 |
|
message()
property
Property for the error message
Returns:
Type | Description |
---|---|
str
|
Error message description |
Source code in gemini_api/endpoints/order.py
557 558 559 560 561 562 563 564 565 |
|
new_order(auth, symbol, amount, price, side, options=[], stop_limit=False, stop_price=None, client_order_id=None)
classmethod
Method to create a new limit or stop-limit order
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
symbol |
str
|
Trading pair |
required |
amount |
str
|
Quoted decimal amount to purchase |
required |
price |
str
|
Quoted decimal amount to spend per unit |
required |
options |
List[str]
|
Option of order execution, defaults to limit order |
[]
|
stop_price |
Optional[str]
|
The price to trigger a stop-limit order |
None
|
stop_limit |
bool
|
True if stop_price is provided |
False
|
client_order_id |
str
|
Client-specified order if |
None
|
Returns:
Type | Description |
---|---|
Order
|
Order object |
Source code in gemini_api/endpoints/order.py
567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 |
|
options()
property
Property for the options containing at most one supported order execution option
Returns:
Type | Description |
---|---|
List[str]
|
Options |
Source code in gemini_api/endpoints/order.py
339 340 341 342 343 344 345 346 347 348 |
|
order_id()
property
Property for the order ID
Returns:
Type | Description |
---|---|
Union[str, Dict[int, bool]]
|
Order ID |
Source code in gemini_api/endpoints/order.py
162 163 164 165 166 167 168 169 170 |
|
order_status(auth, order_id, include_trades, client_order_id=None)
classmethod
Method to get order status
The order id to get information on - cannot be used in combination with client_order_id
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
order_id |
str
|
The order id |
required |
include_trades |
bool
|
Include trade details of all fills from the order |
required |
client_order_id |
str
|
Client-specified order |
None
|
Returns:
Type | Description |
---|---|
Order
|
Order object |
Source code in gemini_api/endpoints/order.py
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 |
|
order_type()
property
Property for the description of the type: exchange limit, auction-only exchange limit, market buy, market sell, indication-of-interest
Returns:
Type | Description |
---|---|
str
|
type |
Source code in gemini_api/endpoints/order.py
233 234 235 236 237 238 239 240 241 242 243 |
|
original_amount()
property
Property for the originally submitted amount of the order.
Returns:
Type | Description |
---|---|
str
|
Original amount |
Source code in gemini_api/endpoints/order.py
360 361 362 363 364 365 366 367 368 |
|
price()
property
Property for the price the order was issued at
Returns:
Type | Description |
---|---|
str
|
Price |
Source code in gemini_api/endpoints/order.py
350 351 352 353 354 355 356 357 358 |
|
price_currency()
property
Property for the price_currency
Returns:
Type | Description |
---|---|
str
|
price_currency |
Source code in gemini_api/endpoints/order.py
370 371 372 373 374 375 376 377 378 |
|
quantity()
property
Property for the quantity
Returns:
Type | Description |
---|---|
str
|
quantity |
Source code in gemini_api/endpoints/order.py
380 381 382 383 384 385 386 387 388 |
|
quantity_currency()
property
Property for the currency quantity label for the quantity field in wrap orders - matches 'CCY1' in the symbol
Returns:
Type | Description |
---|---|
str
|
Currency quantity label |
Source code in gemini_api/endpoints/order.py
390 391 392 393 394 395 396 397 398 399 |
|
reason()
property
Property for the reason of errors
Returns:
Type | Description |
---|---|
str
|
Short error description |
Source code in gemini_api/endpoints/order.py
547 548 549 550 551 552 553 554 555 |
|
remaining_amount()
property
Property for the amount of the order that has not been filled
Returns:
Type | Description |
---|---|
str
|
Remaining amount |
Source code in gemini_api/endpoints/order.py
329 330 331 332 333 334 335 336 337 |
|
result()
property
Property for the result upon errors or the state of a request
Returns:
Type | Description |
---|---|
str
|
Result |
Source code in gemini_api/endpoints/order.py
537 538 539 540 541 542 543 544 545 |
|
revive_heartbeat(auth)
classmethod
Method to revive the heartbeat
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
Returns:
Type | Description |
---|---|
Order
|
Order object |
Source code in gemini_api/endpoints/order.py
859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
|
side()
property
Property for the side (either "buy" or "sell")
Returns:
Type | Description |
---|---|
str
|
Side |
Source code in gemini_api/endpoints/order.py
223 224 225 226 227 228 229 230 231 |
|
symbol()
property
Property for the symbol of the order
Returns:
Type | Description |
---|---|
str
|
Symbol |
Source code in gemini_api/endpoints/order.py
192 193 194 195 196 197 198 199 200 |
|
timestamp()
property
Property for the timestamp the order was submitted. Note that for compatibility reasons, this is returned as a string. Recommend using the timestampms field instead
Returns:
Type | Description |
---|---|
str
|
The number of seconds since 1970-01-01 UTC (unix epoch) |
Source code in gemini_api/endpoints/order.py
245 246 247 248 249 250 251 252 253 254 255 |
|
timestampms()
property
Property for the timestamp the order was submitted in milliseconds
Returns:
Type | Description |
---|---|
int
|
The number of milliseconds since 1970-01-01 UTC |
Source code in gemini_api/endpoints/order.py
257 258 259 260 261 262 263 264 265 |
|
total_spend()
property
Property for the total quantity to spend for the order - will be the sum inclusive of all fees and amount to be traded
Returns:
Type | Description |
---|---|
str
|
Total spend |
Source code in gemini_api/endpoints/order.py
401 402 403 404 405 406 407 408 409 410 |
|
total_spend_currency()
property
Property for the currency of the total spend to be spent on the order
Returns:
Type | Description |
---|---|
str
|
Total spend currency |
Source code in gemini_api/endpoints/order.py
412 413 414 415 416 417 418 419 420 421 |
|
trade_id()
property
Property for the unique trade id
Returns:
Type | Description |
---|---|
int
|
Trade id |
Source code in gemini_api/endpoints/order.py
485 486 487 488 489 490 491 492 493 |
|
trades()
property
Property for the trades containing trade details
Returns:
Type | Description |
---|---|
List[Dict[str, Any]]
|
List of trade dictionary objects |
Source code in gemini_api/endpoints/order.py
267 268 269 270 271 272 273 274 275 |
|
was_forced()
property
Property for the forced status of an order (always False)
Returns:
Type | Description |
---|---|
bool
|
False. |
Source code in gemini_api/endpoints/order.py
309 310 311 312 313 314 315 316 317 |
|
wrap_order(auth, amount, side, symbol, client_order_id=None)
classmethod
Method to wrap or unwrap Gemini isued assets
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
amount |
str
|
Amount of currency to purchase |
required |
side |
str
|
Either "buy" or "sell" |
required |
symbol |
str
|
Trading pair |
required |
client_order_id |
str
|
Client-specified order id |
None
|
Returns:
Type | Description |
---|---|
Order
|
Order object |
Source code in gemini_api/endpoints/order.py
638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 |
|
Fee and Volume APIs
FeeVolume
Class that manages Fee and Volumes APIs
Source code in gemini_api/endpoints/fee_volume.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
|
__init__(auth, volume_data)
Initialise FeeVolume class
Source code in gemini_api/endpoints/fee_volume.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
api_auction_fee_bps()
property
Property for the api auction fee
Returns:
Type | Description |
---|---|
int
|
Auction fee for all symbols in basis point for API orders |
Source code in gemini_api/endpoints/fee_volume.py
210 211 212 213 214 215 216 217 218 |
|
api_maker_fee_bps()
property
Property for the api maker fee
Returns:
Type | Description |
---|---|
int
|
Maker fee for all symbols in basis point for API orders |
Source code in gemini_api/endpoints/fee_volume.py
191 192 193 194 195 196 197 198 199 |
|
api_taker_fee_bps()
property
Property for the api taker fee
Returns:
Type | Description |
---|---|
int
|
Taker fee for all symbols in basis point for API orders |
Source code in gemini_api/endpoints/fee_volume.py
201 202 203 204 205 206 207 208 |
|
base_currency()
property
Property for the base currency that the quantity is denominated in
Returns:
Type | Description |
---|---|
float
|
Base currency |
Source code in gemini_api/endpoints/fee_volume.py
302 303 304 305 306 307 308 309 310 |
|
block_maker_fee_bps()
property
Property for the block maker fee
Returns:
Type | Description |
---|---|
int
|
Maker fee for all symbols in basis point for block orders |
Source code in gemini_api/endpoints/fee_volume.py
250 251 252 253 254 255 256 257 258 |
|
block_taker_fee_bps()
property
Property for the block taker fee
Returns:
Type | Description |
---|---|
int
|
Taker fee for all symbols in basis point for block orders |
Source code in gemini_api/endpoints/fee_volume.py
260 261 262 263 264 265 266 267 268 |
|
buy_maker_base()
property
Property for the buy maker base where the account was a maker on the buy side of the trade
Returns:
Type | Description |
---|---|
float
|
Quantity for this day |
Source code in gemini_api/endpoints/fee_volume.py
356 357 358 359 360 361 362 363 364 365 |
|
buy_maker_count()
property
Property for the buy maker count where the account was a maker on the buy side of the trade
Returns:
Type | Description |
---|---|
float
|
Number of trades for this day |
Source code in gemini_api/endpoints/fee_volume.py
378 379 380 381 382 383 384 385 386 387 |
|
buy_maker_notional()
property
Property for the notional value where the account was a maker on the buy side of the trade
Returns:
Type | Description |
---|---|
float
|
Notional value for this day |
Source code in gemini_api/endpoints/fee_volume.py
367 368 369 370 371 372 373 374 375 376 |
|
buy_taker_base()
property
Property for the buy taker base value where the account was a taker on the buy side of the trade
Returns:
Type | Description |
---|---|
float
|
Quantity for this day |
Source code in gemini_api/endpoints/fee_volume.py
422 423 424 425 426 427 428 429 430 431 |
|
buy_taker_count()
property
Property for the buy taker count where the account was a taker on the buy side of the trade
Returns:
Type | Description |
---|---|
float
|
Number of trades for this day |
Source code in gemini_api/endpoints/fee_volume.py
444 445 446 447 448 449 450 451 452 453 |
|
buy_taker_notional()
property
Property for the buy taker notional value where the account was a taker on the buy side of the trade
Returns:
Type | Description |
---|---|
float
|
Notional value for this day |
Source code in gemini_api/endpoints/fee_volume.py
433 434 435 436 437 438 439 440 441 442 |
|
data_date()
property
Property for the data date
Returns:
Type | Description |
---|---|
str
|
UTC date in yyyy-mm-dd format |
Source code in gemini_api/endpoints/fee_volume.py
323 324 325 326 327 328 329 330 331 |
|
date()
property
Property for the UTC date
Returns:
Type | Description |
---|---|
str
|
date in yyyy-mm-dd format |
Source code in gemini_api/endpoints/fee_volume.py
141 142 143 144 145 146 147 148 149 |
|
fix_auction_fee_bps()
property
Property for the fix auction fee
Returns:
Type | Description |
---|---|
int
|
Auction fee for all symbols in basis point for FIX orders |
Source code in gemini_api/endpoints/fee_volume.py
240 241 242 243 244 245 246 247 248 |
|
fix_maker_fee_bps()
property
Property for the fix maker fee
Returns:
Type | Description |
---|---|
int
|
Maker fee for all symbols in basis point for FIX orders |
Source code in gemini_api/endpoints/fee_volume.py
220 221 222 223 224 225 226 227 228 |
|
fix_taker_fee_bps()
property
Property for the fix taken fee
Returns:
Type | Description |
---|---|
int
|
Taker fee for all symbols in basis point for FIX orders |
Source code in gemini_api/endpoints/fee_volume.py
230 231 232 233 234 235 236 237 238 |
|
get_notional_volume(auth)
classmethod
Method to get the notional volume in price currency that has been traded across all pairs over a period of 30 days.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
Returns:
Type | Description |
---|---|
Optional[FeeVolume]
|
FeeVolume object |
Source code in gemini_api/endpoints/fee_volume.py
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 |
|
get_trade_volume(auth)
classmethod
Method to
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
Returns:
Type | Description |
---|---|
List[FeeVolume]
|
FeeVolume object |
Source code in gemini_api/endpoints/fee_volume.py
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
|
last_updated_ms()
property
Property for the last update timestamp
Returns:
Type | Description |
---|---|
int
|
Unix timestamp in millisecond of the last update |
Source code in gemini_api/endpoints/fee_volume.py
151 152 153 154 155 156 157 158 159 |
|
maker_buy_sell_ratio()
property
Property for the maker buy/sell ratio - the proportion of maker base volume on trades where the account was on the buy side versus all maker trades. If no maker base volume on the buy side, then this value is 0
Returns:
Type | Description |
---|---|
float
|
Maker buy/sell ratio |
Source code in gemini_api/endpoints/fee_volume.py
343 344 345 346 347 348 349 350 351 352 353 354 |
|
message()
property
Property for the error message
Returns:
Type | Description |
---|---|
str
|
Error message description |
Source code in gemini_api/endpoints/fee_volume.py
508 509 510 511 512 513 514 515 516 |
|
notional_1d_volume()
property
Property for the 1 day notional 1 day trading volume for the past 30 days
Returns:
Type | Description |
---|---|
List[Dict[str, Any]]
|
List of 1 day notional volumes |
Source code in gemini_api/endpoints/fee_volume.py
281 282 283 284 285 286 287 288 289 290 |
|
notional_30d_volume()
property
Property for the notional 30 day trading volume for the past 30 days, including auction volume
Returns:
Type | Description |
---|---|
float
|
Maker plus taker trading volume |
Source code in gemini_api/endpoints/fee_volume.py
270 271 272 273 274 275 276 277 278 279 |
|
notional_currency()
property
Property for the notional currency - price is denominated as the amount of notional currency per one unit of base currency
Returns:
Type | Description |
---|---|
float
|
Notional currency |
Source code in gemini_api/endpoints/fee_volume.py
312 313 314 315 316 317 318 319 320 321 |
|
reason()
property
Property for the reason of errors
Returns:
Type | Description |
---|---|
str
|
Short error description |
Source code in gemini_api/endpoints/fee_volume.py
498 499 500 501 502 503 504 505 506 |
|
result()
property
Property for the result upon errors or the state of a request
Returns:
Type | Description |
---|---|
str
|
Result |
Source code in gemini_api/endpoints/fee_volume.py
488 489 490 491 492 493 494 495 496 |
|
sell_maker_base()
property
Property for the sell maker base where the account was a maker on the sell side of the trade
Returns:
Type | Description |
---|---|
float
|
Quantity for this day |
Source code in gemini_api/endpoints/fee_volume.py
389 390 391 392 393 394 395 396 397 398 |
|
sell_maker_count()
property
Property for the sell maker count where the account was a maker on the sell side of the trade
Returns:
Type | Description |
---|---|
float
|
Number of trades for this day |
Source code in gemini_api/endpoints/fee_volume.py
411 412 413 414 415 416 417 418 419 420 |
|
sell_maker_notional()
property
Property for the sell maker notional value where the account was a maker on the sell side of the trade
Returns:
Type | Description |
---|---|
float
|
Notional value for this day |
Source code in gemini_api/endpoints/fee_volume.py
400 401 402 403 404 405 406 407 408 409 |
|
sell_taker_base()
property
Property for the sell taker base where the account was a taker on the sell side of the trade
Returns:
Type | Description |
---|---|
float
|
Quantity for this day |
Source code in gemini_api/endpoints/fee_volume.py
455 456 457 458 459 460 461 462 463 464 |
|
sell_taker_count()
property
Property for the sell taker count where the account was a taker on the sell side of the trade
Returns:
Type | Description |
---|---|
float
|
Number of trades for this day |
Source code in gemini_api/endpoints/fee_volume.py
477 478 479 480 481 482 483 484 485 486 |
|
sell_taker_notional()
property
Property for the sell taker notional value where the account was a taker on the sell side of the trade
Returns:
Type | Description |
---|---|
float
|
Notional value for this day |
Source code in gemini_api/endpoints/fee_volume.py
466 467 468 469 470 471 472 473 474 475 |
|
symbol()
property
Property for the symbol
Returns:
Type | Description |
---|---|
str
|
Symbol |
Source code in gemini_api/endpoints/fee_volume.py
292 293 294 295 296 297 298 299 300 |
|
total_volume_base()
property
Property for the total volume base
Returns:
Type | Description |
---|---|
float
|
Total trade volume for this day |
Source code in gemini_api/endpoints/fee_volume.py
333 334 335 336 337 338 339 340 341 |
|
web_auction_fee_bps()
property
Property for the web auction fee
Returns:
Type | Description |
---|---|
int
|
Auction fee for all symbols in basis point for web orders |
Source code in gemini_api/endpoints/fee_volume.py
181 182 183 184 185 186 187 188 189 |
|
web_maker_fee_bps()
property
Property for the web maker fee
Returns:
Type | Description |
---|---|
int
|
Maker fee for all symbols in basis point for web orders |
Source code in gemini_api/endpoints/fee_volume.py
161 162 163 164 165 166 167 168 169 |
|
web_taker_fee_bps()
property
Property for the web taker fee
Returns:
Type | Description |
---|---|
int
|
Taker fee for all symbols in basis point for web orders |
Source code in gemini_api/endpoints/fee_volume.py
171 172 173 174 175 176 177 178 179 |
|
FX Rate API
FXRate
Class for FX Rate historical reference
Source code in gemini_api/endpoints/fx_rate.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
__init__(auth, fx_rate_data)
Initialise FXRate class
Source code in gemini_api/endpoints/fx_rate.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
as_of()
property
Property for the timestamp that the requested fx rate has been retrieved for
Returns:
Type | Description |
---|---|
int
|
Timstamp in Epoch time format |
Source code in gemini_api/endpoints/fx_rate.py
69 70 71 72 73 74 75 76 77 78 |
|
benchmark()
property
Property for the market for which the retrieved price applies to
Returns:
Type | Description |
---|---|
str
|
Market |
Source code in gemini_api/endpoints/fx_rate.py
90 91 92 93 94 95 96 97 98 |
|
fx_pair()
property
Property for the requested currency pair
Returns:
Type | Description |
---|---|
str
|
Currency pair |
Source code in gemini_api/endpoints/fx_rate.py
48 49 50 51 52 53 54 55 56 |
|
get_fx_rate(auth, symbol, since)
classmethod
Method to get the fx rate
Timestamp is rounded to the closest timestamp received for an update from BCB
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
symbol |
str
|
Trading pair |
required |
since |
str
|
Date in YYYYMMDD format |
required |
Returns:
Type | Description |
---|---|
FXRate
|
FXRate object |
Source code in gemini_api/endpoints/fx_rate.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
message()
property
Property for the error message
Returns:
Type | Description |
---|---|
str
|
Error message description |
Source code in gemini_api/endpoints/fx_rate.py
120 121 122 123 124 125 126 127 128 |
|
provider()
property
Property for the market data provider
Returns:
Type | Description |
---|---|
str
|
Market data provider |
Source code in gemini_api/endpoints/fx_rate.py
80 81 82 83 84 85 86 87 88 |
|
rate()
property
Property for the fx rate of the non USD currency. USD if the base currency and will always have a value of 1
Returns:
Type | Description |
---|---|
str
|
Rate |
Source code in gemini_api/endpoints/fx_rate.py
58 59 60 61 62 63 64 65 66 67 |
|
reason()
property
Property for the reason of errors
Returns:
Type | Description |
---|---|
str
|
Short error description |
Source code in gemini_api/endpoints/fx_rate.py
110 111 112 113 114 115 116 117 118 |
|
result()
property
Property for the result upon errors or the state of a request
Returns:
Type | Description |
---|---|
str
|
Result |
Source code in gemini_api/endpoints/fx_rate.py
100 101 102 103 104 105 106 107 108 |
|
Fund Management APIs
FundManagement
Class that manages Fund Management APIs
Source code in gemini_api/endpoints/fund_management.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 |
|
__init__(auth, fund_data)
Initialise FundManagement class
Source code in gemini_api/endpoints/fund_management.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
account_id()
property
Property for the custody account id
Returns:
Type | Description |
---|---|
int
|
Account id |
Source code in gemini_api/endpoints/fund_management.py
351 352 353 354 355 356 357 358 359 |
|
account_transfer_type()
property
Property for the type of account (always "exchange") or the transfer type (either "Deposit" or "Withdrawal")
Returns:
Type | Description |
---|---|
str
|
Type of account or transfer |
Source code in gemini_api/endpoints/fund_management.py
182 183 184 185 186 187 188 189 190 191 |
|
add_cad_bank(auth, swiftcode, accountnumber, type, name, institutionnumber=None, branchnumber=None)
classmethod
Method to add a CAD bank
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
swiftcode |
str
|
The account SWIFT code |
required |
accountnumber |
str
|
Account number of bank account to be added |
required |
type |
str
|
Type of bank account to be added |
required |
institutionnumber |
str
|
the institution number of the account |
None
|
branchnumber |
str
|
The branch number |
None
|
Returns:
Type | Description |
---|---|
FundManagement
|
FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 |
|
add_us_bank(auth, accountnumber, routing, type, name)
classmethod
Method to add a US bank
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
accountnumber |
str
|
Account number of bank account to be added |
required |
routing |
str
|
Routing number of bank account to be added |
required |
type |
str
|
Type of bank account to be added |
required |
name |
str
|
Name of the bank account as shown on your account statements |
required |
Returns:
Type | Description |
---|---|
FundManagement
|
FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 |
|
address()
property
Property for the new cryptocurrency address
Returns:
Type | Description |
---|---|
str
|
Cryptocurrency address |
Source code in gemini_api/endpoints/fund_management.py
381 382 383 384 385 386 387 388 389 |
|
advance_eid()
property
Property for the deposit advance event id
Returns:
Type | Description |
---|---|
int
|
Deposit advance event id |
Source code in gemini_api/endpoints/fund_management.py
255 256 257 258 259 260 261 262 263 |
|
amount()
property
Property for the current balance or transfer amount
Returns:
Type | Description |
---|---|
float
|
Current balance or transfer amount |
Source code in gemini_api/endpoints/fund_management.py
152 153 154 155 156 157 158 159 160 |
|
amount_notional()
property
Property for the amount in notional
Returns:
Type | Description |
---|---|
float
|
Notional amount |
Source code in gemini_api/endpoints/fund_management.py
193 194 195 196 197 198 199 200 201 |
|
available()
property
Property for the amount that is available to trade
Returns:
Type | Description |
---|---|
float
|
Amount available to trade |
Source code in gemini_api/endpoints/fund_management.py
162 163 164 165 166 167 168 169 170 |
|
available_for_withdrawal()
property
Property for the amount that is available to withdraw
Returns:
Type | Description |
---|---|
float
|
Amount available to withdraw |
Source code in gemini_api/endpoints/fund_management.py
172 173 174 175 176 177 178 179 180 |
|
available_for_withdrawal_notional()
property
Property for the amount available to withdraw in notional
Returns:
Type | Description |
---|---|
float
|
Amount available to withdraw in notional |
Source code in gemini_api/endpoints/fund_management.py
213 214 215 216 217 218 219 220 221 |
|
available_notional()
property
Property for the amount available to trade in notional
Returns:
Type | Description |
---|---|
float
|
Amount available in notional |
Source code in gemini_api/endpoints/fund_management.py
203 204 205 206 207 208 209 210 211 |
|
balances()
property
Property for the balance information of available fiat payment methods containing details on the account type (always "exchange"), currency, amount, available amount for trading and available amount for withdrawal
Returns:
Type | Description |
---|---|
List[Dict[str, str]]
|
List of balances dictionaries |
Source code in gemini_api/endpoints/fund_management.py
508 509 510 511 512 513 514 515 516 517 518 519 |
|
banks()
property
Property for the bank information containing details on bank name and id
Returns:
Type | Description |
---|---|
List[Dict[str, str]]
|
List of bank dictionaries |
Source code in gemini_api/endpoints/fund_management.py
521 522 523 524 525 526 527 528 529 530 |
|
create_new_deposit_address(auth, network, label=None, since=None, legacy=False)
classmethod
Method to get custody fee records
The network can be bitcoin, ethereum, bitcoincash, litecoin, zcash, filecoin, dogecoin, tezos, or solana
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
network |
str
|
e.g. bitcoin |
required |
label |
str
|
The label for the new address if provided on creation |
None
|
since |
str
|
Date in YYYYMMDD format |
None
|
legacy |
bool
|
Whether to generate a legacy P2SH-P2PKH litecoin address |
False
|
Returns:
Type | Description |
---|---|
FundManagement
|
Fundmanagement object |
Source code in gemini_api/endpoints/fund_management.py
715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 |
|
currency()
property
Property for the currency code
Returns:
Type | Description |
---|---|
str
|
Currency code |
Source code in gemini_api/endpoints/fund_management.py
142 143 144 145 146 147 148 149 150 |
|
destination()
property
Property for the destination address for when the currency is a cryptocurrency
Returns:
Type | Description |
---|---|
str
|
Destination address |
Source code in gemini_api/endpoints/fund_management.py
319 320 321 322 323 324 325 326 327 328 |
|
eid()
property
Property for the transfer event id
Returns:
Type | Description |
---|---|
int
|
Transfer event id |
Source code in gemini_api/endpoints/fund_management.py
245 246 247 248 249 250 251 252 253 |
|
event_id()
property
Property for the custody fee event id
Returns:
Type | Description |
---|---|
int
|
Event id |
Source code in gemini_api/endpoints/fund_management.py
361 362 363 364 365 366 367 368 369 |
|
event_type()
property
Property for the custody fee event type
Returns:
Type | Description |
---|---|
str
|
Event type |
Source code in gemini_api/endpoints/fund_management.py
371 372 373 374 375 376 377 378 379 |
|
fee()
property
Property for the fee in kind applied to the transaction or the estimated gas fee for withdrawals
Returns:
Type | Description |
---|---|
Union[Dict[str, str], str]
|
Withdrawal fee or gas estimation fee |
Source code in gemini_api/endpoints/fund_management.py
412 413 414 415 416 417 418 419 420 421 |
|
fee_amount()
property
Property for the fee amount charged
Returns:
Type | Description |
---|---|
float
|
Fee amount |
Source code in gemini_api/endpoints/fund_management.py
265 266 267 268 269 270 271 272 273 |
|
fee_currency()
property
Property for the fee currency
Returns:
Type | Description |
---|---|
str
|
Currency the fee was paid in |
Source code in gemini_api/endpoints/fund_management.py
275 276 277 278 279 280 281 282 283 |
|
gas_fee_estimation(auth, address, amount, currency, account=['primary'])
classmethod
Method to estimate gas fees for ETH and ERC20 tokens
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
address |
str
|
Standard string format of cryptocurrency address |
required |
amount |
str
|
Quoted decimal amount to withdraw |
required |
currency |
str
|
Currency code of a supported crypto-currency, e.g. eth |
required |
account |
List[str]
|
The name of the account within the subaccount group |
['primary']
|
Returns:
Type | Description |
---|---|
FundManagement
|
FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 |
|
get_available_balances(auth)
classmethod
Method to get available balances in the supported currencies
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
Returns:
Type | Description |
---|---|
List[FundManagement]
|
List of FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 |
|
get_custody_fees(auth, since=None, limit_transfers=None)
classmethod
Method to get Custody fee records in the supported currencies
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
since |
str
|
Date in YYYYMMDD format |
None
|
limit_transfers |
int
|
The maximum nmber of transfers to return |
None
|
Returns:
Type | Description |
---|---|
List[FundManagement]
|
List of FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 |
|
get_deposit_address(auth, network, since=None)
classmethod
Method to get deposit address
The network can be bitcoin, ethereum, bitcoincash, litecoin, zcash, filecoin, dogecoin, tezos, or solana
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini API authentication object |
required |
network |
str
|
e.g. bitcoin |
required |
since |
str
|
Date in YYYYMMDD format |
None
|
Returns:
Type | Description |
---|---|
List[FundManagement]
|
List of FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 |
|
get_notional_balances(auth, currency)
classmethod
Method to get available balances in the supported currencies as well as the notional value in the currency specified
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
currency |
str
|
supported three-letter fiat currency code |
required |
Returns:
Type | Description |
---|---|
List[FundManagement]
|
List of FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 |
|
get_payment_methods(auth)
classmethod
Method to get data on balances in the account and linked banks
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
Returns:
Type | Description |
---|---|
FundManagement
|
FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 |
|
get_transfers(auth, since=None, show_completed_deposit_advances=None, limit_transfers=None, currency=None)
classmethod
Method to get transfers - shows deposits and withdrawals in the supported currencies. When deposits show as Advanced or Complete status, they are available for trading.
This method does not currently show cancelled advances, returned outgoing wires or ACH transactions, or other exceptional transaction circumstances.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
since |
str
|
Date in YYYYMMDD format |
None
|
show_completed_deposit_advances |
bool
|
Display completed deposit advances |
None
|
limit_transfers |
int
|
The maximum number of transfers to return |
None
|
currency |
str
|
Currency code symbols |
None
|
Returns:
Type | Description |
---|---|
List[FundManagement]
|
List of FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 |
|
is_override()
property
Property for the value that shows if an override on the customer's account for free withdrawals exists
Returns:
Type | Description |
---|---|
bool
|
True if override exists, False otherwise |
Source code in gemini_api/endpoints/fund_management.py
446 447 448 449 450 451 452 453 454 455 |
|
label()
property
Property for the label if provided upon creation of the cryptocurrency address
Returns:
Type | Description |
---|---|
str
|
address |
Source code in gemini_api/endpoints/fund_management.py
391 392 393 394 395 396 397 398 399 400 |
|
message()
property
Property for the human-readable English message describing the withdrawal - only shown for BTC, ZEC, LTC and BCH withdrawals. Also can be the error message description for failed requests.
Returns:
Type | Description |
---|---|
str
|
Message |
Source code in gemini_api/endpoints/fund_management.py
434 435 436 437 438 439 440 441 442 443 444 |
|
method()
property
Property for the transfer - if fiat currency, the method field will attempty to supply "ACH", "WIRE" or "SEN". If the transfer is internal, the method field will return "Internal"
Returns:
Type | Description |
---|---|
str
|
Transfer method |
Source code in gemini_api/endpoints/fund_management.py
285 286 287 288 289 290 291 292 293 294 295 |
|
monthly_limit()
property
Property for the total number of allowable fee-free withdrawals
Returns:
Type | Description |
---|---|
int
|
Number of fee-free withdrawals |
Source code in gemini_api/endpoints/fund_management.py
457 458 459 460 461 462 463 464 465 |
|
montly_remaining()
property
Property for the total number of allowable fee-free withdrawals left to use
Returns:
Type | Description |
---|---|
int
|
Number of fee-free withdrawals left to use |
Source code in gemini_api/endpoints/fund_management.py
467 468 469 470 471 472 473 474 475 476 |
|
network()
property
Property for the network
Returns:
Type | Description |
---|---|
str
|
address |
Source code in gemini_api/endpoints/fund_management.py
402 403 404 405 406 407 408 409 410 |
|
outputidx()
property
Property for the output index for transactions for when the currency is a cryptocurrency
Returns:
Type | Description |
---|---|
int
|
Output index |
Source code in gemini_api/endpoints/fund_management.py
308 309 310 311 312 313 314 315 316 317 |
|
purpose()
property
Property for the administrative field to supply a reason for certain types of advances
Returns:
Type | Description |
---|---|
str
|
Purpose |
Source code in gemini_api/endpoints/fund_management.py
330 331 332 333 334 335 336 337 338 339 |
|
reason()
property
Property for the reason of errors
Returns:
Type | Description |
---|---|
str
|
Short error description |
Source code in gemini_api/endpoints/fund_management.py
498 499 500 501 502 503 504 505 506 |
|
reference_id()
property
Property for the reference id for the new bank addition request
Returns:
Type | Description |
---|---|
str
|
Reference id |
Source code in gemini_api/endpoints/fund_management.py
478 479 480 481 482 483 484 485 486 |
|
result()
property
Property for the result upon errors or the state of a request
Returns:
Type | Description |
---|---|
str
|
Result |
Source code in gemini_api/endpoints/fund_management.py
488 489 490 491 492 493 494 495 496 |
|
sen_withdrawal(auth, bankId, amount)
classmethod
Method to withdraw USD via SEN
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
bankId |
str
|
Unique ID for your SEN bank account |
required |
amount |
float
|
Amount (USD) to transfer to your account |
required |
Returns:
Type | Description |
---|---|
FundManagement
|
FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 |
|
status()
property
Property for the transfer status which is either 'Advanced' or 'Complete'
Returns:
Type | Description |
---|---|
str
|
Status |
Source code in gemini_api/endpoints/fund_management.py
223 224 225 226 227 228 229 230 231 232 |
|
timestampms()
property
Property for the time of the transfer in milliseconds or the creation of the cryptocurrency address
Returns:
Type | Description |
---|---|
int
|
Number of milliseconds since 1970-01-01 UTC |
Source code in gemini_api/endpoints/fund_management.py
234 235 236 237 238 239 240 241 242 243 |
|
tx_hash()
property
Property for the transaction hash for when the currency is a cryptocurrency - only shown for ETH and GUSD for withdrawals
Returns:
Type | Description |
---|---|
str
|
Transaction hash |
Source code in gemini_api/endpoints/fund_management.py
297 298 299 300 301 302 303 304 305 306 |
|
tx_time()
property
Property for the time of custody fee record
Returns:
Type | Description |
---|---|
str
|
Time of custody fee record |
Source code in gemini_api/endpoints/fund_management.py
341 342 343 344 345 346 347 348 349 |
|
withdraw_crypto(auth, currency, address, amount, client_transfer_id=None)
classmethod
Method to withdraw crypto funds
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Authentication
|
Gemini authentication object |
required |
currency |
str
|
Currency code symbols |
required |
address |
str
|
Standard string format of cryptocurrency address |
required |
amount |
str
|
Quoted decimal amount to withdraw |
required |
client_transfer_id |
str
|
Unique identifier for withdrawal, uuid4 format |
None
|
Returns:
Type | Description |
---|---|
FundManagement
|
FundManagement object |
Source code in gemini_api/endpoints/fund_management.py
756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 |
|
withdrawal_id()
property
Property for the withdrawal id - only shown for BTC, ZEC, LTC and BCH withdrawals
Returns:
Type | Description |
---|---|
str
|
Unique withdrawal id |
Source code in gemini_api/endpoints/fund_management.py
423 424 425 426 427 428 429 430 431 432 |
|