Skip to content

Commit a6e8b20

Browse files
committed
hard-code base USDC for backwards compatibility
1 parent 41512be commit a6e8b20

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/synthetix/spot/spot.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,16 @@ def atomic_order(
546546
"""
547547
market_id, market_name = self._resolve_market(market_id, market_name)
548548

549-
if min_amount_received is None:
549+
# first check if on Base where USDC and sUSD are 1:1
550+
if (
551+
self.snx.network_id in [8453, 84532]
552+
and market_name == "sUSDC"
553+
and min_amount_received is None
554+
):
555+
# assume this is a 1:1 swap
556+
min_amount_received = size
557+
min_amount_received_wei = ether_to_wei(min_amount_received)
558+
elif min_amount_received is None:
550559
# get the asset price
551560
token_symbol = self.markets_by_id[market_id]["symbol"]
552561
feed_id = self.snx.pyth.price_feed_ids[token_symbol]

0 commit comments

Comments
 (0)