
    i                         d dl mZ d dlmZ d dlmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lmZ d dlmZ  G d dee          ZdS )    )Exchange)ImplicitAPI)BalancesIntMarketNumOrder	OrderBook	OrderSide	OrderTypeStrStringsTickerTickersTrade)List)AuthenticationError)ArgumentsRequired)
BadRequest)InsufficientFunds)InvalidOrder)	TICK_SIZE)Precisec                       e Zd Z fdZi fdee         fdZdefdZd&dedefdZ	i fde
defd	Zdi fd
edefdZdi fde
dedefdZd&dedefdZdddi fde
dededee         fdZd Zd&dedefdZdi fde
dedededef
dZdi fde
defdZdi fde
defdZdddi fdedededee         fdZ d&dede!fdZ"dddi fde
dededefdZ#dddi fdededefdZ$de%fd Z&i fde%fd!Z'd"d#i ddfd$Z(d% Z) xZ*S )'acec                    |                      t          t          |                                           i ddddddgddd	d
dddi dd ddddddddddddddddddddddddddddddddi d dd!dd"dd#dd$dd%dd&dd'dd(dd)dd*dd+dd,dd-dd.dd/dd0di d1dd2dd3dd4dd5dd6dd7dd8dd9dd:dd;dd<dd=dd>dd?dd@ddAdddddddddddB	dCdDdEdFdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVgdWdXdYdddZd[d\g d]id^g d_idTd`dad|                     db          |                     dc          ddidedfdgidht
          dit          t          t          t          t          t          t          t          t          t          t          t          t          dji dkdli           S )mNidr   nameACE	countriesTWversionv2	rateLimitd   proFhasCORSspotTmarginswapfutureoptioncancelAllOrderscancelOrdercancelOrderscloseAllPositionsclosePositioncreateOrder	editOrderfetchBalancefetchBorrowRateHistoriesfetchBorrowRateHistoryfetchClosedOrdersfetchCrossBorrowRatefetchCrossBorrowRatesfetchCurrenciesfetchDepositAddressfetchDepositsfetchFundingHistoryfetchFundingRatefetchFundingRateHistoryfetchFundingRatesfetchIndexOHLCVfetchIsolatedBorrowRatefetchIsolatedBorrowRatesfetchMarginModefetchMarketsfetchMarkOHLCVfetchMyTrades
fetchOHLCVfetchOpenInterestHistoryfetchOpenOrders
fetchOrderfetchOrderBookfetchOrdersfetchOrderTradesfetchPositionModefetchPositionsfetchPremiumIndexOHLCVfetchTickerfetchTickers	fetchTimefetchTradesfetchTradingFeefetchTradingFeesfetchTransactionFeesfetchTransactions)	fetchTransferfetchTransfersfetchWithdrawalfetchWithdrawalssetLeveragesetMarginModetransferwithdrawws
timeframes      
   <   x      i  i     F      )1m5m10m30m1h2h4h8h12h1d1w1Murlszdhttps://user-images.githubusercontent.com/1294454/216908003-fb314cf6-e66e-471c-b91d-1d86e4baaa90.jpgzhttps://ace.io/polarisexzhttps://ace.io/polarisex/open)publicprivatezhttps://ace.io/z4https://github.com/ace-exchange/ace-offical-api-docsz]https://helpcenter.ace.io/hc/zh-tw/articles/360018609132-%E8%B2%BB%E7%8E%87%E8%AA%AA%E6%98%8E)logoapiwwwdocfeesrequiredCredentials)apiKeysecretr~   get)zoapi/v2/list/tradePricezoapi/v2/list/marketPairzopen/v2/public/getOrderBookpost)zv2/coin/customerAccountzv2/kline/getKlinezv2/order/orderzv2/order/cancelzv2/order/getOrderListzv2/order/showOrderStatuszv2/order/showOrderHistoryzv2/order/getTradeListr   tradingz0.0005z0.001)
percentagemakertakeroptionsbrokerIdccxtprecisionMode
exceptions)2003200420052021203620392053206120639996100122018220183)exactbroadcommonCurrencies)
deep_extendsuperr   describeparse_numberr   r   r   r   r   )self	__class__s    \/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/ccxt/async_support/ace.pyr   zace.describe   s   c4 0 0 9 9 ; ; X>
%X>
EX>
 $X>
 t	X>

 X>
 5X>
  === %= 	=
 %= %= "5= t= = $U=  = t= U= = +E=  )%!=" $U#= =$ '%=& ('=( "5)=* &u+=,  -=. &u/=0 #E1=2 *53=4 $U5=6 "57=8 *59=: +E;=< "5==> ?=@ !%A=B  C=D dE= = =F +EG=H "4I=J dK=L !$M=N uO=P #DQ=R $US=T !%U=V )%W=X tY=Z [=\ U]=^ u_=` "5a=b #Ec=d 'e=f $Ug= =h "'"'#($)$!&!!y= = =X>
J  KX>
f ~8>  )J x gX>
~ "$ $X>
F      	 	 	 GX>
p "&!..x88!..w77 qX>
~ FX>
D YEX>
F (((-(((&(&00) ! GX>
l  !mX>
 X X X	    returnc                 d   K   |                                   d{V }|                     |          S )aC  
        retrieves data on all markets for ace
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#oapi-api---market-pair
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: an array of objects representing market data
        N)publicGetOapiV2ListMarketPairparse_markets)r   paramsresponses      r   fetch_marketszace.fetch_markets   sA       ;;======== !!(+++r   c                    |                      |d          }|                     |          }|                      |d          }|                     |          }|dz   |z   }i d|                      |d          dd d|d|d|d|d|d	d d
d dddddddddddddddd d d d d d d |                     |d          |                     |d          dd d dd d dd d dd|                     |                     |                      |d                              |                     |                     |                      |d                              dd d |dS )Nbasequote/r   symboluppercaseIdbaseIdquoteIdsettlesettleIdtyper)   Tr*   Fr+   r,   r-   contractlinearminLimitBaseAmountmaxLimitBaseAmount)minmax)amountpricecostleveragequotePrecisionbasePrecision)r   r   )inversecontractSizeexpiryexpiryDatetimestrike
optionTypelimits	precisionactivecreatedinfo)safe_stringsafe_currency_codesafe_numberr   parse_precision)r   marketr   r   r   r   r   s          r   parse_marketzace.parse_market   sS   !!&&11&&v..""6733''00e#1
$""68441
41
 f1
 D	1

 f1
 U1
 w1
 d1
 1
 F1
 D1
 e1
 E1
 e1
 e1
  !1
" d#1
$  "  ++F4HII++F4HII 
   
   
    & **4+?+?@P@PQWYi@j@j+k+kll++D,@,@AQAQRXZiAjAj,k,kll  a1
 1
 1
 1	
r   Nr   c                    |                      |d          }|                     ||          }|                     i d|dd dd dd dd dd dd d	d d
d dd dd d|                      |d          d|                      |d          dd dd dd dd |                      |d          |                      |d          |d|          S )Nr   r   	timestampdatetimehighlowbid	bidVolumeask	askVolumevwapopenclose
last_pricelastpreviousClosechanger   averagebase_volumequote_volume)
baseVolumequoteVolumer   )r   safe_symbolsafe_ticker)r   tickerr   marketIdr   s        r   parse_tickerzace.parse_ticker  sr    ##FD11!!(F33 !
f!
!
 !
 D	!

 4!
 4!
 !
 4!
 !
 D!
 D!
 T%%fl;;!
 D$$V\::!
 T!
 d!
  $!!
" t#!
$ **6=AA++FNCC)!
 !
 !
* +  	r   r   c                   K   |                                   d{V  |                     |          }|                     |           d{V }|d         }|                     ||i           }|                     ||          S )a   
        fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#oapi-api---trade-data
        :param str symbol: unified symbol of the market to fetch the ticker for
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
        Nr   )load_marketsr   publicGetOapiV2ListTradePrice
safe_valuer   )r   r   r   r   r   r   r   s          r   fetch_tickerzace.fetch_ticker"  s       !!!!!!!!!V$$;;FCCCCCCCC$<8R88   000r   symbolsc                   K   |                                   d{V  |                                  d{V }g }t          |                                          }t	          dt          |                    D ]`}||         }|                     |          }|                     ||          }	|                     |	|          }
|	                    |
           a| 
                    |d|          S )aA  
        fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#oapi-api---trade-data
        :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
        Nr   r   )r   r   listkeysrangelensafe_marketr   r   appendfilter_by_array_tickers)r   r   r   r   tickerspairsir   r   	rawTickerr   s              r   fetch_tickerszace.fetch_tickers:  s       !!!!!!!!!;;======== X]]__%%q#e**%% 	# 	#AQxH%%h//F(;;I&&y&99FNN6""""++GXwGGGr   limitc                 \  K   |                                   d{V  |                     |          }|d         |d         d}|||d<   |                     |                     ||                     d{V }|                     |d          }|                     ||d         ddd	          S )
ad  
        fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---order-books
        :param str symbol: unified symbol of the market to fetch the order book for
        :param int [limit]: the maximum amount of order book entries to return
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
        Nr   r   quoteCurrencyIdbaseCurrencyIddepth
attachmentr   bidsasks)r   r   !publicGetOpenV2PublicGetOrderBookextend	safe_dictparse_order_book)r   r   r  r   r   requestr   	orderBooks           r   fetch_order_bookzace.fetch_order_bookW  s       !!!!!!!!!V$$%i0$X.
 
 $GG??GU[@\@\]]]]]]]]L NN8\::	$$Yx0@$PVWWWr   c           	      >   |                      |d          }|                     |          }||dz
  }||                     |d          |                     |d          |                     |d          |                     |d          |                     |d          gS )N
createTime t	openPrice	highPricelowPrice
closePricevolume)r   	parse8601r   )r   ohlcvr   dateTimer   s        r   parse_ohlcvzace.parse_ohlcv  s     ##E<88NN8,,	 !H,IUK00UK00UJ//UL11UH--
 	
r   rn   sincec                 x  K   |                                   d{V  |                     |          }| j        |         |d         |d         d}|||d<   |||d<   |                     |                     ||                     d{V }|                     |dg           }	|                     |	||||          S )a  
        fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---klinecandlestick-data
        :param str symbol: unified symbol of the market to fetch OHLCV data for
        :param str timeframe: the length of time each candle represents
        :param int [since]: timestamp in ms of the earliest candle to fetch
        :param int [limit]: the maximum amount of candles to fetch
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns int[][]: A list of candles ordered, open, high, low, close, volume
        Nr   r   )durationr  r  r  	startTimer
  )r   r   rd   privatePostV2KlineGetKliner  r   parse_ohlcvs)
r   r   	timeframer   r  r   r   r  r   datas
             r   fetch_ohlcvzace.fetch_ohlcv  s       !!!!!!!!!V$$	2%i0$X.
 

 $GG#(GK 88Wf9U9UVVVVVVVVxr::&   vy%GGGr   c                 @    dddddd}|                      ||d           S )Nr   closedcanceled)01245)r   )r   statusstatusess      r   parse_order_statuszace.parse_order_status  s7    
 
 &$777r   c                    d }d }d }d }d }d }d }	d }
d }d }t          |t                    r|}ns|                     |d          }|                     |d          }|2|                     |d          }||                     |          }|dz
  }|                     |d          }|
|dk    rdnd}|                     |d	          }|                     |d
          }|                     |d          }|                     |d          }|
||dz   |z   }|                     |d          }|
|dk    rdnd}|                     |d          }
|                     |d          }|                     |                     |d                    }	|                     |d          }|                     i d|dd d|d|                     |          dd d|d|dd dd d|d
|dd d|d d d!|d"|
d#||	d d |d$|          S )%NorderNoorderTimeStamp	orderTimer  	buyOrSellre   buysellnumr   quoteCurrencyNamebaseCurrencyNamer   r   r  r   tradeNum	remainNumr1  averagePricer   clientOrderIdr   r   lastTradeTimestampr   timeInForcepostOnlyside	stopPricer   r   r   filled	remaining)r1  feetradesr   )	
isinstancestrr   safe_integerr  r   r3  
safe_orderiso8601)r   orderr   r   r   r   r   rE  r   r1  rG  rH  r   r   r  	orderSider   r   	orderTypes                      r   parse_orderzace.parse_order  s   8 		eS!! 	>BB!!%33B))%1ABBI ++E;??' $x 8 8I )H 4I((<<I$!*auuf%%eU33F$$UG44E&&u.ABBG%%e-?@@F"v'9#/((77I$#,>>ww%%eZ88F((<<I,,T-=-=eX-N-NOOF&&un==G  
" 
T 
  
 Y//	 

 !$ 
 f 
 D 
 4 
  
 D 
 U 
  
 f 
 D 
 w 
  f! 
" # 
$ + 
  
  
, -  	r   r   rE  r   r   c                   K   |                                   d{V  |                     |          }|                                }|                                }	|d         |d         |dk    rdnd|	dk    rdnd|                     ||          d}
|d	k    r|                     ||          |
d
<   |                     |                     |
|                     d{V }|                     |d          }|                     ||          S )a  
        create a trade order
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---new-order
        :param str symbol: unified symbol of the market to create an order in
        :param str type: 'market' or 'limit'
        :param str side: 'buy' or 'sell'
        :param float amount: how much of currency you want to trade in units of base currency
        :param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        Nr   r   LIMITre      BUY)r  r  r   r8  r;  r  r   r
  )	r   r   upperamount_to_precisionprice_to_precisionprivatePostV2OrderOrderr  r  rS  )r   r   r   rE  r   r   r   r   rR  rQ  r  r   r'  s                r   create_orderzace.create_order;  s+      !!!!!!!!!V$$JJLL	JJLL	$X.%i0#w..AAQ(E11++FF;;
 
 7??#66vuEEGG55dkk'66R6RSSSSSSSS ~~h55f---r   r   c                    K   |                                   d{V  d|i}|                     |                     ||                     d{V }|S )a  
        cancels an open order
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---cancel-order
        :param str id: order id
        :param str symbol: unified symbol of the market the order was made in
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        Nr5  )r   privatePostV2OrderCancelr  )r   r   r   r   r  r   s         r   cancel_orderzace.cancel_order`  st       !!!!!!!!!r
 66t{{7F7S7STTTTTTTT r   c                    K   |                                   d{V  d|i}|                     |                     ||                     d{V }|                     |d          }|                     |d          S )a  
        fetches information on an order made by the user
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---order-status
        :param str symbol: unified symbol of the market the order was made in
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        Nr5  r
  )r   !privatePostV2OrderShowOrderStatusr  r  rS  )r   r   r   r   r  r   r'  s          r   fetch_orderzace.fetch_orderx  s       !!!!!!!!!r
 ??GU[@\@\]]]]]]]]. ~~h55d+++r   c                   K   |t          | j        dz             |                                  d{V  |                     |          }|d         |d         d}|||d<   |                     |                     ||                     d{V }|                     |d          }|                     ||||          S )aN  
        fetch all unfilled currently open orders
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---order-list
        :param str symbol: unified market symbol of the market orders were made in
        :param int [since]: the earliest time in ms to fetch orders for
        :param int [limit]: the maximum number of order structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
        Nz- fetchOpenOrders() requires a symbol argumentr   r   r  sizer
  )r   r   r   r   privatePostV2OrderGetOrderListr  r   parse_orders)	r   r   r   r  r   r   r  r   orderss	            r   fetch_open_orderszace.fetch_open_orders  s       >#DG.]$]^^^!!!!!!!!!V$$%i0$X.
 

 #GFO<<T[[RX=Y=YZZZZZZZZ<88<   >>>r   c                    |                      |d          }|                      |d          }|                      |d          }|                     |d          }|1|                     |dd          }|                     |          }|dz
  }|d         }|                      |d	          }	|                      |d
          }
|	
|
|
dz   |	z   }d }|                     |d          }|
|dk    rdnd}|                      |d          }d }|.|                      |d          }t	          j        ||          |	d}|                     |||                      |d          ||d d ||d |||                     |          d|          S )NtradeNor   r;  tradeTimestamptime	tradeTimer  r   r<  r=  r   r8  re   r9  r:  rI  feeSave)r   currencyr5  )r   r   rP  r   rE  r   takerOrMakerr   r   r   rI  r   r   )r   rM  safe_string_2r  r   
string_sub
safe_traderO  )r   trader   r   r   r   r   r   r   r   r   rE  	tradeSide	feeStringrI  feeSaveStrings                   r   parse_tradezace.parse_trade  s   D eY//  00!!%//%%e-=>>	))%EEHx00I!H,I!""5*=>>!!%);<<6#5c\G+F%%e[99	 &!^^55&D$$UE22	  ,,UI>>M*9mDD# C %%eY77 "Y// 
  
   	r   c                 T  K   |                                   d{V  |                     |          }d|i}|                     |                     ||                     d{V }|                     |d          }	|                     |	dg           }
|                     |
|||          S )aI  
        fetch all the trades made from a single order
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---order-history
        :param str id: order id
        :param str symbol: unified market symbol
        :param int [since]: the earliest time in ms to fetch trades for
        :param int [limit]: the maximum number of trades to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
        Nr5  r
  rJ  )r   r   "privatePostV2OrderShowOrderHistoryr  r   	safe_listparse_trades)r   r   r   r   r  r   r   r  r   r'  rJ  s              r   fetch_order_tradeszace.fetch_order_trades  s       !!!!!!!!!!!&))r
 @@WV\A]A]^^^^^^^^D x66h33  >>>r   c                 n  K   |                                   d{V  |                     |          }i }|d         |d         |d<   |d         |d<   |||d<   |                     |                     ||                     d{V }|                     |dg           }|                     ||||          S )	a4  
        fetch all trades made by the user
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---trade-list
        :param str symbol: unified symbol of the market to fetch trades for
        :param int [since]: timestamp in ms of the earliest trade to fetch
        :param int [limit]: the maximum amount of trades to fetch
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
        Nr   r   r  r   r  rd  r
  )r   r   privatePostV2OrderGetTradeListr  r{  r|  )	r   r   r   r  r   r   r  r   rJ  s	            r   fetch_my_tradeszace.fetch_my_tradesU  s       !!!!!!!!!!!&))
 $<#)/	):G%&(.x(8G$%#GFO<<T[[RX=Y=YZZZZZZZZ> ,;;  >>>r   c                 F   d|i}t          dt          |                    D ]k}||         }|                     |d          }|                     |          }|                     |d          }|                     |d          }||d}	|	||<   l|                     |          S )Nr   r   currencyNamer   
cashAmount)freetotal)r   r   r   r   safe_balance)
r   r   resultr  balance
currencyIdcoder   	availableaccounts
             r   parse_balancezace.parse_balance  s     H
 q#h--(( 
	# 
	#AqkG))'>BBJ**:66D%%gx88F((,??I! G #F4LL  (((r   c                    K   |                                   d{V  |                     |           d{V }|                     |dg           }|                     |          S )a  
        query for balance and get the amount of funds available for trading or funds locked in orders
        :see: https://github.com/ace-exchange/ace-official-api-docs/blob/master/api_v2.md#open-api---account-balance
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
        Nr
  )r    privatePostV2CoinCustomerAccountr   r  )r   r   r   balancess       r   fetch_balancezace.fetch_balance  s|       !!!!!!!!!>>vFFFFFFFF??8\2>>" !!(+++r   r{   GETc                    d|                      ||          z   }|                     ||                     |                    }|i }|dk    r;|                                  |                                 }	d| j        z   }
|                     | j        |	d|          }t          |	                                          }| 
                    |ddd          }t          dt          |                    D ]#}||         }|
|                     ||          z  }
$|                     |                     |
          dd	          }||d
<   ddi}|dk    r"|                     | j        d          }|||d<   |                     |          }n)|dk    r#|dk    r|r|d|                     |          z   z  }| j        d         |         |z   }||||dS )Nr   r|   ACE_SIGN)r   	timeStampr   F sha256hexsignKeyzContent-Typez!application/x-www-form-urlencodedPOSTr   Refererr{   r  ?r~   )urlmethodbodyheaders)implode_paramsomitextract_paramscheck_required_credentialsmillisecondsr   r  r   r   r   sort_byr   r   r   hashencoder   	urlencoderz   )r   pathr~   r  r   r  r  r  querynonceauthr'  dataKeyssortedDataKeysr  key	signaturer   s                     r   signzace.sign  s   D''f555		&$"5"5d";";<<?G)++---%%''E+D;;+"     D DIIKK((H!\\(AubAAN1c.1122 4 4$Q'((s333		$++d"3"3XuEEI'DO CG ++DL*EE')1GI&>>$''DDH__5 3sT^^E2222is#c)fdwOOOr   c
                    |d S | j         dz   |z   }
|                     |dd          }|dk    rSt          |          }|                     | j        d         ||
           |                     | j        d         ||
           d S )N r1     r   r   )r   r   rL  throw_exactly_matched_exceptionr   throw_broadly_matched_exception)r   r  reasonr  r  r  r  r   requestHeadersrequestBodyfeedbackr1  	statusStrs                r   handle_errorszace.handle_errors  s    47S=4'!!(Hc::C<<FI001I9V^___001I9V^___tr   )N)+__name__
__module____qualname__r   r   r   r   r   r   r   rL  r   r   r   r  r   r
   r  r   r  r(  r3  r	   rS  r   r   floatr   r\  r   r_  rb  rh  r   rx  r}  r  r   r  r  r  r  __classcell__)r   s   @r   r   r      s       Y Y Y Y Yv *, , ,V , , , ,07
f 7
 7
 7
 7
r 6 V    B 68 1 1 1F 1 1 1 10 6:" H H7 H H H H H: @DB 8X 8XS 8X 8XS\ 8X 8X 8X 8Xt
 
 
4 
 
 
 
8 8<$]ajl *H *H *HC *HWZ *Hquvzq{ *H *H *H *HX8 8 8V V V5 V V V Vp mqy{ #. #. #.I #.Y #.X] #.fi #. #. #. #.J 9=R  S #    0 8<B $, $,C $, $, $, $, $,L 59tZ^gi 4? 4?c 4? 4?TW 4?nrsxny 4? 4? 4? 4?lI I I5 I I I IV ?CQUdhqs 4? 4?3 4? 4?3 4?^a 4? 4? 4? 4?l 37TX\eg 5? 5?C 5?s 5?RU 5? 5? 5? 5?n) ) ) ) )8 *, , , , , , ,8 &eBSW  P  P  P  PD	 	 	 	 	 	 	r   r   N) ccxt.async_support.base.exchanger   ccxt.abstract.acer   ccxt.base.typesr   r   r   r   r	   r
   r   r   r   r   r   r   r   typingr   ccxt.base.errorsr   r   r   r   r   ccxt.base.decimal_to_precisionr   ccxt.base.preciser   r    r   r   <module>r     s   6 5 5 5 5 5 ) ) ) ) ) ) E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E  E       0 0 0 0 0 0 . . . . . . ' ' ' ' ' ' . . . . . . ) ) ) ) ) ) 4 4 4 4 4 4 % % % % % %\ \ \ \ \(K \ \ \ \ \r   