Skip to content

Commit

Permalink
add flag to bfp
Browse files Browse the repository at this point in the history
  • Loading branch information
Tburm committed Sep 18, 2024
1 parent 22fa4da commit bb9051e
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/synthetix/perps/perps.py
Original file line number Diff line number Diff line change
Expand Up @@ -1879,3 +1879,30 @@ def liquidate(
return tx_hash
else:
return tx_params

def flag(
self,
account_id: int = None,
market_id: int = None,
market_name: str = None,
submit: bool = False,
):
""" """
market_id, market_name = self._resolve_market(market_id, market_name)
if account_id is None:
account_id = self.default_account_id

tx_params = write_erc7412(
self.snx,
self.market_proxy,
"flagPosition",
[account_id, market_id],
)
if submit:
tx_hash = self.snx.execute_transaction(tx_params)
self.logger.info(f"Flagging account {account_id} in market {market_name}")

self.logger.info(f"flagPosition tx: {tx_hash}")
return tx_hash
else:
return tx_params

0 comments on commit bb9051e

Please sign in to comment.