Skip to content

Commit e840647

Browse files
bug fixes
1 parent d834237 commit e840647

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

chat-ui-quince/src/style.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,7 @@ body {
389389
cursor: pointer;
390390
padding: 5px;
391391
display: none; /* Hidden until signed in */
392+
border-radius: 50%;
392393
}
393394

394395
#refresh-stats-btn svg {

src/flare_ai_defai/blockchain/sparkdex.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -537,35 +537,8 @@ def swap_erc20_tokens_tx(self, user: UserInfo, token_in: str, token_out: str, am
537537
raise ValueError(f"Invalid amount_in: {amount_in} for {token_in}")
538538

539539
fee_tier = 500 # Assuming 0.05% pool fee
540-
amount_out_min = 0 # Fetch dynamically for slippage protection
540+
amount_out_min = 1 # Fetch dynamically for slippage protection
541541
deadline = self.w3.eth.get_block("latest")["timestamp"] + 300 # 5 minutes from now
542-
543-
544-
545-
546-
547-
fee_tiers = [500, 3000, 10000] # 0.05%, 0.3%, 1%
548-
549-
amount_out_wei = None
550-
for fee_tier in fee_tiers:
551-
params = (
552-
token_address[token_in.lower()],
553-
token_address[token_out.lower()],
554-
fee_tier,
555-
self.wallet_store.get_address(user),
556-
deadline,
557-
amount_in_wei,
558-
135540, # Minimum for estimation
559-
0
560-
)
561-
try:
562-
amount_out_wei = universal_router.functions.exactInputSingle(params).call()
563-
self.logger.debug(f"tiercheck - Found valid pool with fee tier {fee_tier}", extra={"amount_out_wei": amount_out_wei})
564-
break
565-
except Exception as e:
566-
self.logger.debug(f"tiercheck - Fee tier {fee_tier} failed: {str(e)}", extra={"params": params})
567-
568-
569542

570543

571544
# ---- Step 0.5: calculate amount_out_min
@@ -735,6 +708,7 @@ def wrap_flr_to_wflr_tx(self, user: UserInfo, amount_in: float):
735708
def add_swap_txs_to_queue(self, user: UserInfo, from_token: str, to_token: str, amount: float) -> str:
736709
self.reset_nonce(user)
737710

711+
738712
if from_token.lower() == "flr":
739713
wrap_tx = self.wrap_flr_to_wflr_tx(user, amount)
740714
if (to_token.lower() == "wflr"):

0 commit comments

Comments
 (0)