forked from hummingbot/hummingbot
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10868b5
commit 34e9452
Showing
28 changed files
with
3,265 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
hummingbot/connector/exchange/graphene/README_core_changes.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
hummingbot/hummingbot/client/command/connect_command.py | ||
Change timeout for graphene exchanges | ||
Metanode may take some time to boot | ||
|
||
hummingbot/hummingbot/client/config/global_config_map.py | ||
Added currency symbol suggestions for decentralized tokens | ||
|
||
hummingbot/hummingbot/client/settings.py | ||
If the chain name is graphene change to peerplays by default | ||
|
||
hummingbot/hummingbot/connector/connector_status.py | ||
Add peerplays, bitshares, etc | ||
|
||
hummingbot/hummingbot/core/data_type/order_book_tracker.py | ||
Reverse pairs if they are not found | ||
|
||
hummingbot/hummingbot/core/rate_oracle/rate_oracle.py | ||
Add rate oracle for graphene | ||
|
||
hummingbot/hummingbot/user/user_balances.py | ||
FIXME | ||
|
||
hummingbot/hummingbot/connector/exchange/graphene/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cdef class dummy(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cdef class dummy(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# pylint: disable=bad-continuation | ||
|
||
|
||
|
||
def get_fee( | ||
self, | ||
base_currency: str, | ||
quote_currency: str, | ||
order_type: OrderType, | ||
order_side: TradeType, # TradeType.BUY TradeType.SELL | ||
amount: Decimal, | ||
price: Decimal = Decimal("nan"), | ||
is_maker: Optional[bool] = None, | ||
*_, | ||
**__, | ||
) -> TradeFeeBase: | ||
""" | ||
Calculates the estimated fee an order would pay | ||
""" | ||
# FIXME the hummingbot binance reference is a path to deprecation warning | ||
# there appears to be no functional reference material, see: | ||
# ~ | ||
# ~ BitshareExchange | ||
## ~ ExchangeBase | ||
### ~ ConnectorBase | ||
#### ~ estimate_fee_pct | ||
##### ~ core.utils.estimate_fee.estimate_fee << binance ends here not implemented | ||
# self.logger().info("get_fee") | ||
# I suspect the correct implementation will be: | ||
|
||
account = dict(self.metanode.account) # DISCRETE SQL QUERY | ||
objects = dict(self.metanode.objects) # DISCRETE SQL QUERY | ||
assets = dict(sels.metanode.assets) # DISCRETE SQL QUERY | ||
tx_currency = objects["1.3.0"]["name"] | ||
tx_amount = account["fees_account"]["create"] | ||
# you pay market fee on the currency you receive in the transaction | ||
market_currency = quote_currency | ||
maker_pct = assets[quote_currency]["fees_asset"]["maker"] | ||
taker_pct = assets[quote_currency]["fees_asset"]["taker"] | ||
if order_side == TradeType.BUY: | ||
market_currency = base_currency | ||
maker_pct = assets[base_currency]["fees_asset"]["maker"] | ||
taker_pct = assets[base_currency]["fees_asset"]["taker"] | ||
market_pct = maker_pct if is_maker else taker_pct | ||
# build a TradeFeeBase class object | ||
fee = TradeFeeBase() | ||
flat_fee = TokenAmount() | ||
flat_fee.token = tx_currency | ||
flat_fee.amount = Decimal(tx_amount) | ||
fee.flat_fees = [flat_fee] | ||
fee.percent = Decimal(market_pct) | ||
fee.percent_token = market_currency if market_currency != quote_currency else None | ||
|
||
# return fee | ||
# FIXME effectively ZERO | ||
return DeductedFromReturnsTradeFee(percent=self.estimate_fee_pct(False)) |
Oops, something went wrong.