Smart Contract Python Bindings Reference
afp.bindings
Typed bindings around the smart contracts of the Autonomous Futures Protocol.
Classes:
- AuctionConfig – Port of
struct AuctionConfig
on the IAuctioneer contract. - AuctionData – Port of
struct AuctionData
on the IAuctioneer contract. - BidData – Port of
struct BidData
on the IAuctioneer contract. - ClearingConfig – Port of
struct ClearingConfig
on the IClearing contract. - ClearingDiamond – ClearingDiamond contract binding.
- Config – Port of
struct Config
on the IClearing contract. - Intent – Port of
struct Intent
on the IClearing contract. - IntentData – Port of
struct IntentData
on the IClearing contract. - LAAData – Port of
struct LAAData
on the IBankruptcy contract. - MarginAccount – MarginAccount contract binding.
- MarginAccountRegistry – MarginAccountRegistry contract binding.
- OracleProvider – OracleProvider contract binding.
- OracleSpecification – Port of
struct OracleSpecification
on the IProductRegistry contract. - PositionData – Port of
struct PositionData
on the IMarginAccount contract. - PositionLossData – Port of
struct PositionLossData
on the IBankruptcy contract. - Product – Port of
struct Product
on the IProductRegistry contract. - ProductMetadata – Port of
struct ProductMetadata
on the IProductRegistry contract. - ProductRegistry – ProductRegistry contract binding.
- ProductState – Port of
enum ProductState
on the ProductRegistry contract. - Settlement – Port of
struct Settlement
on the IMarginAccount contract. - Side – Port of
enum Side
on the ClearingFacet contract. - SystemViewer – SystemViewer contract binding.
- Trade – Port of
struct Trade
on the IClearing contract. - TradingProtocol – TradingProtocol contract binding.
- UserMarginAccountData – Port of
struct UserMarginAccountData
on the ISystemViewer contract.
afp.bindings.AuctionConfig
AuctionConfig(restoration_buffer, liquidation_duration)
Port of struct AuctionConfig
on the IAuctioneer contract.
Attributes:
- liquidation_duration (
int
) – - restoration_buffer (
int
) –
afp.bindings.AuctionConfig.liquidation_duration
int liquidation_duration:
afp.bindings.AuctionConfig.restoration_buffer
int restoration_buffer:
afp.bindings.AuctionData
AuctionData(start_block, mae_at_initiation, mmu_at_initiation, mae_now, mmu_now)
Port of struct AuctionData
on the IAuctioneer contract.
Attributes:
- mae_at_initiation (
int
) – - mae_now (
int
) – - mmu_at_initiation (
int
) – - mmu_now (
int
) – - start_block (
int
) –
afp.bindings.AuctionData.mae_at_initiation
int mae_at_initiation:
afp.bindings.AuctionData.mae_now
int mae_now:
afp.bindings.AuctionData.mmu_at_initiation
int mmu_at_initiation:
afp.bindings.AuctionData.mmu_now
int mmu_now:
afp.bindings.AuctionData.start_block
int start_block:
afp.bindings.BidData
BidData(product_id, price, quantity, side)
Port of struct BidData
on the IAuctioneer contract.
Attributes:
afp.bindings.BidData.price
int price:
afp.bindings.BidData.product_id
product_id: hexbytes.HexBytes
afp.bindings.BidData.quantity
int quantity:
afp.bindings.BidData.side
side: Side
afp.bindings.ClearingConfig
ClearingConfig(clearing_fee_rate)
Port of struct ClearingConfig
on the IClearing contract.
Attributes:
- clearing_fee_rate (
int
) –
afp.bindings.ClearingConfig.clearing_fee_rate
int clearing_fee_rate:
afp.bindings.ClearingDiamond
ClearingDiamond(w3)
Bases: AuctioneerFacet
, BankruptcyFacet
, ClearingFacet
, FinalSettlementFacet
, MarkPriceTrackerFacet
ClearingDiamond contract binding.
Includes all functions inherited from various facets.
Parameters:
- w3 (
Web3
) –
Functions:
- auction_config – Binding for
auctionConfig
on the AuctioneerFacet contract. - auction_data – Binding for
auctionData
on the AuctioneerFacet contract. - bid_auction – Binding for
bidAuction
on the AuctioneerFacet contract. - can_terminate_auctions – Binding for
canTerminateAuctions
on the AuctioneerFacet contract. - clearing_fee_rate – Binding for
clearingFeeRate
on the ClearingFacet contract. - closeout_fee_rate – Binding for
CLOSEOUT_FEE_RATE
on the FinalSettlementFacet contract. - closeout_reward_rate – Binding for
CLOSEOUT_REWARD_RATE
on the FinalSettlementFacet contract. - config – Binding for
config
on the ClearingFacet contract. - estimate_fees – Binding for
estimateFees
on the ClearingFacet contract. - execute – Binding for
execute
on the ClearingFacet contract. - finalize_fsp – Binding for
finalizeFsp
on the FinalSettlementFacet contract. - finalize_initialization – Binding for
finalizeInitialization
on the ClearingFacet contract. - get_admin – Binding for
getAdmin
on the ClearingFacet contract. - get_fsp – Binding for
getFsp
on the FinalSettlementFacet contract. - get_margin_account_registry – Binding for
getMarginAccountRegistry
on the ClearingFacet contract. - get_product_registry – Binding for
getProductRegistry
on the ClearingFacet contract. - get_treasury – Binding for
getTreasury
on the ClearingFacet contract. - hash_intent – Binding for
hashIntent
on the ClearingFacet contract. - initialize – Binding for
initialize
on the ClearingFacet contract. - initiate_final_settlement – Binding for
initiateFinalSettlement
on the FinalSettlementFacet contract. - is_admin_active – Binding for
isAdminActive
on the ClearingFacet contract. - is_liquidatable – Binding for
isLiquidatable
on the AuctioneerFacet contract. - is_liquidating – Binding for
isLiquidating
on the AuctioneerFacet contract. - last_traded_timestamp – Binding for
lastTradedTimestamp
on the BankruptcyFacet contract. - mae_check_on_bid – Binding for
maeCheckOnBid
on the AuctioneerFacet contract. - max_mae_offered – Binding for
maxMaeOffered
on the AuctioneerFacet contract. - max_trading_fee_rate – Binding for
MAX_TRADING_FEE_RATE
on the ClearingFacet contract. - mutualize_losses – Binding for
mutualizeLosses
on the BankruptcyFacet contract. - open_interest – Binding for
openInterest
on the FinalSettlementFacet contract. - request_liquidation – Binding for
requestLiquidation
on the AuctioneerFacet contract. - set_active – Binding for
setActive
on the ClearingFacet contract. - set_admin – Binding for
setAdmin
on the ClearingFacet contract. - set_config – Binding for
setConfig
on the ClearingFacet contract. - terminate_auctions – Binding for
terminateAuctions
on the AuctioneerFacet contract. - unique_trader_count – Binding for
uniqueTraderCount
on the BankruptcyFacet contract. - validate_auctions – Binding for
validateAuctions
on the AuctioneerFacet contract. - validate_la_as – Binding for
validateLAAs
on the BankruptcyFacet contract. - valuation – Binding for
valuation
on the MarkPriceTrackerFacet contract. - valuation_after_trade – Binding for
valuationAfterTrade
on the MarkPriceTrackerFacet contract. - version – Binding for
version
on the ClearingFacet contract.
Attributes:
- Auctioned (
ContractEvent
) – Binding forevent Auctioned
on the AuctioneerFacet contract. - LiquidationStarted (
ContractEvent
) – Binding forevent LiquidationStarted
on the AuctioneerFacet contract. - LiquidationTerminated (
ContractEvent
) – Binding forevent LiquidationTerminated
on the AuctioneerFacet contract. - TradeExecuted (
ContractEvent
) – Binding forevent TradeExecuted
on the ClearingFacet contract.
afp.bindings.ClearingDiamond.Auctioned
Auctioned: contract.ContractEvent
Binding for event Auctioned
on the AuctioneerFacet contract.
afp.bindings.ClearingDiamond.LiquidationStarted
LiquidationStarted: contract.ContractEvent
Binding for event LiquidationStarted
on the AuctioneerFacet contract.
afp.bindings.ClearingDiamond.LiquidationTerminated
LiquidationTerminated: contract.ContractEvent
Binding for event LiquidationTerminated
on the AuctioneerFacet contract.
afp.bindings.ClearingDiamond.TradeExecuted
TradeExecuted: contract.ContractEvent
Binding for event TradeExecuted
on the ClearingFacet contract.
afp.bindings.ClearingDiamond.auction_config
auction_config()
Binding for auctionConfig
on the AuctioneerFacet contract.
Returns:
afp.bindings.ClearingDiamond.auction_data
auction_data(margin_account_id, collateral)
Binding for auctionData
on the AuctioneerFacet contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - collateral (
ChecksumAddress
) –
Returns:
afp.bindings.ClearingDiamond.bid_auction
bid_auction(margin_account_id, collateral_token, bids)
Binding for bidAuction
on the AuctioneerFacet contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - collateral_token (
ChecksumAddress
) – - bids (
List[BidData]
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.can_terminate_auctions
can_terminate_auctions(margin_account_id, collateral)
Binding for canTerminateAuctions
on the AuctioneerFacet contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - collateral (
ChecksumAddress
) –
Returns:
bool
–
afp.bindings.ClearingDiamond.clearing_fee_rate
clearing_fee_rate()
Binding for clearingFeeRate
on the ClearingFacet contract.
Returns:
int
–
afp.bindings.ClearingDiamond.closeout_fee_rate
closeout_fee_rate()
Binding for CLOSEOUT_FEE_RATE
on the FinalSettlementFacet contract.
Returns:
int
–
afp.bindings.ClearingDiamond.closeout_reward_rate
closeout_reward_rate()
Binding for CLOSEOUT_REWARD_RATE
on the FinalSettlementFacet contract.
Returns:
int
–
afp.bindings.ClearingDiamond.config
config()
Binding for config
on the ClearingFacet contract.
Returns:
Config
–
afp.bindings.ClearingDiamond.estimate_fees
estimate_fees(product_id, price, quantity, trading_fee_rate)
Binding for estimateFees
on the ClearingFacet contract.
Parameters:
Returns:
afp.bindings.ClearingDiamond.execute
execute(trade, fallback_on_failure)
Binding for execute
on the ClearingFacet contract.
Parameters:
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.finalize_fsp
finalize_fsp(product_id)
Binding for finalizeFsp
on the FinalSettlementFacet contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.finalize_initialization
finalize_initialization(margin_account_registry)
Binding for finalizeInitialization
on the ClearingFacet contract.
Parameters:
- margin_account_registry (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.get_admin
get_admin()
Binding for getAdmin
on the ClearingFacet contract.
Returns:
afp.bindings.ClearingDiamond.get_fsp
get_fsp(product_id)
Binding for getFsp
on the FinalSettlementFacet contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
afp.bindings.ClearingDiamond.get_margin_account_registry
get_margin_account_registry()
Binding for getMarginAccountRegistry
on the ClearingFacet contract.
Returns:
afp.bindings.ClearingDiamond.get_product_registry
get_product_registry()
Binding for getProductRegistry
on the ClearingFacet contract.
Returns:
afp.bindings.ClearingDiamond.get_treasury
get_treasury()
Binding for getTreasury
on the ClearingFacet contract.
Returns:
afp.bindings.ClearingDiamond.hash_intent
hash_intent(intent)
Binding for hashIntent
on the ClearingFacet contract.
Parameters:
- intent (
Intent
) –
Returns:
HexBytes
–
afp.bindings.ClearingDiamond.initialize
initialize(_product_registry, _treasury)
Binding for initialize
on the ClearingFacet contract.
Parameters:
- _product_registry (
ChecksumAddress
) – - _treasury (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.initiate_final_settlement
initiate_final_settlement(product_id, accounts)
Binding for initiateFinalSettlement
on the FinalSettlementFacet contract.
Parameters:
- product_id (
HexBytes
) – - accounts (
List[ChecksumAddress]
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.is_admin_active
is_admin_active()
Binding for isAdminActive
on the ClearingFacet contract.
Returns:
bool
–
afp.bindings.ClearingDiamond.is_liquidatable
is_liquidatable(margin_account_id, collateral_token)
Binding for isLiquidatable
on the AuctioneerFacet contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - collateral_token (
ChecksumAddress
) –
Returns:
bool
–
afp.bindings.ClearingDiamond.is_liquidating
is_liquidating(margin_account_id, collateral_token)
Binding for isLiquidating
on the AuctioneerFacet contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - collateral_token (
ChecksumAddress
) –
Returns:
bool
–
afp.bindings.ClearingDiamond.last_traded_timestamp
last_traded_timestamp(product_id, trader)
Binding for lastTradedTimestamp
on the BankruptcyFacet contract.
Parameters:
- product_id (
HexBytes
) – - trader (
ChecksumAddress
) –
Returns:
int
–
afp.bindings.ClearingDiamond.mae_check_on_bid
mae_check_on_bid(liquidator_margin_account_id, liquidating_margin_account_id, collateral, bids)
Binding for maeCheckOnBid
on the AuctioneerFacet contract.
Parameters:
- liquidator_margin_account_id (
ChecksumAddress
) – - liquidating_margin_account_id (
ChecksumAddress
) – - collateral (
ChecksumAddress
) – - bids (
List[BidData]
) –
Returns:
afp.bindings.ClearingDiamond.max_mae_offered
max_mae_offered(margin_account_id, collateral, mmu_decreased)
Binding for maxMaeOffered
on the AuctioneerFacet contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - collateral (
ChecksumAddress
) – - mmu_decreased (
int
) –
Returns:
int
–
afp.bindings.ClearingDiamond.max_trading_fee_rate
max_trading_fee_rate()
Binding for MAX_TRADING_FEE_RATE
on the ClearingFacet contract.
Returns:
int
–
afp.bindings.ClearingDiamond.mutualize_losses
mutualize_losses(bankrupt_account_id, collateral_token, product_ids, laas)
Binding for mutualizeLosses
on the BankruptcyFacet contract.
Parameters:
- bankrupt_account_id (
ChecksumAddress
) – - collateral_token (
ChecksumAddress
) – - product_ids (
List[HexBytes]
) – - laas (
List[List[ChecksumAddress]]
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.open_interest
open_interest(product_id)
Binding for openInterest
on the FinalSettlementFacet contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ClearingDiamond.request_liquidation
request_liquidation(margin_account_id, collateral_token)
Binding for requestLiquidation
on the AuctioneerFacet contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - collateral_token (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.set_active
set_active(active)
Binding for setActive
on the ClearingFacet contract.
Parameters:
- active (
bool
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.set_admin
set_admin(new_admin)
Binding for setAdmin
on the ClearingFacet contract.
Parameters:
- new_admin (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.set_config
set_config(_config)
Binding for setConfig
on the ClearingFacet contract.
Parameters:
- _config (
Config
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.terminate_auctions
terminate_auctions(margin_account_id, collateral)
Binding for terminateAuctions
on the AuctioneerFacet contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - collateral (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ClearingDiamond.unique_trader_count
unique_trader_count(product_id)
Binding for uniqueTraderCount
on the BankruptcyFacet contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ClearingDiamond.validate_auctions
validate_auctions(margin_account_id, collateral_token, bids)
Binding for validateAuctions
on the AuctioneerFacet contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - collateral_token (
ChecksumAddress
) – - bids (
List[BidData]
) –
Returns:
bool
–
afp.bindings.ClearingDiamond.validate_la_as
validate_la_as(margin_account, bankrupt_account, product_id, product_owners)
Binding for validateLAAs
on the BankruptcyFacet contract.
Parameters:
- margin_account (
ChecksumAddress
) – - bankrupt_account (
ChecksumAddress
) – - product_id (
HexBytes
) – - product_owners (
List[ChecksumAddress]
) –
Returns:
afp.bindings.ClearingDiamond.valuation
valuation(product_id)
Binding for valuation
on the MarkPriceTrackerFacet contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ClearingDiamond.valuation_after_trade
valuation_after_trade(product_id, price, quantity)
Binding for valuationAfterTrade
on the MarkPriceTrackerFacet contract.
Parameters:
Returns:
int
–
afp.bindings.ClearingDiamond.version
version()
Binding for version
on the ClearingFacet contract.
Returns:
str
–
afp.bindings.Config
Config(auction_config, clearing_config)
Port of struct Config
on the IClearing contract.
Attributes:
afp.bindings.Config.auction_config
auction_config: AuctionConfig
afp.bindings.Config.clearing_config
clearing_config: ClearingConfig
afp.bindings.Intent
hash, data, signature) Intent(margin_account_id, intent_account_id,
Port of struct Intent
on the IClearing contract.
Attributes:
- data (
IntentData
) – - hash (
HexBytes
) – - intent_account_id (
ChecksumAddress
) – - margin_account_id (
ChecksumAddress
) – - signature (
HexBytes
) –
afp.bindings.Intent.data
data: IntentData
afp.bindings.Intent.hash
hash: hexbytes.HexBytes
afp.bindings.Intent.intent_account_id
intent_account_id: eth_typing.ChecksumAddress
afp.bindings.Intent.margin_account_id
margin_account_id: eth_typing.ChecksumAddress
afp.bindings.Intent.signature
signature: hexbytes.HexBytes
afp.bindings.IntentData
IntentData(nonce, trading_protocol_id, product_id, limit_price, quantity, max_trading_fee_rate, good_until, side)
Port of struct IntentData
on the IClearing contract.
Attributes:
- good_until (
int
) – - limit_price (
int
) – - max_trading_fee_rate (
int
) – - nonce (
int
) – - product_id (
HexBytes
) – - quantity (
int
) – - side (
Side
) – - trading_protocol_id (
ChecksumAddress
) –
afp.bindings.IntentData.good_until
int good_until:
afp.bindings.IntentData.limit_price
int limit_price:
afp.bindings.IntentData.max_trading_fee_rate
int max_trading_fee_rate:
afp.bindings.IntentData.nonce
int nonce:
afp.bindings.IntentData.product_id
product_id: hexbytes.HexBytes
afp.bindings.IntentData.quantity
int quantity:
afp.bindings.IntentData.side
side: Side
afp.bindings.IntentData.trading_protocol_id
trading_protocol_id: eth_typing.ChecksumAddress
afp.bindings.LAAData
LAAData(owner, quantity, last_traded_timestamp, position_age)
Port of struct LAAData
on the IBankruptcy contract.
Attributes:
- last_traded_timestamp (
int
) – - owner (
ChecksumAddress
) – - position_age (
int
) – - quantity (
int
) –
afp.bindings.LAAData.last_traded_timestamp
int last_traded_timestamp:
afp.bindings.LAAData.owner
owner: eth_typing.ChecksumAddress
afp.bindings.LAAData.position_age
int position_age:
afp.bindings.LAAData.quantity
int quantity:
afp.bindings.MarginAccount
MarginAccount(w3, address)
MarginAccount contract binding.
Parameters:
- w3 (
Web3
) – - address (
ChecksumAddress
) – The address of a deployed MarginAccount contract.
Functions:
- authorize – Binding for
authorize
on the MarginAccount contract. - authorized – Binding for
authorized
on the MarginAccount contract. - batch_mae_check – Binding for
batchMaeCheck
on the MarginAccount contract. - batch_settle – Binding for
batchSettle
on the MarginAccount contract. - capital – Binding for
capital
on the MarginAccount contract. - clearing – Binding for
clearing
on the MarginAccount contract. - collateral_asset – Binding for
collateralAsset
on the MarginAccount contract. - collateral_token – Binding for
collateralToken
on the MarginAccount contract. - collect_fee – Binding for
collectFee
on the MarginAccount contract. - deposit – Binding for
deposit
on the MarginAccount contract. - disperse_fees – Binding for
disperseFees
on the MarginAccount contract. - estimate_liquidation_price – Binding for
estimateLiquidationPrice
on the MarginAccount contract. - estimate_liquidation_price_for_position – Binding for
estimateLiquidationPriceForPosition
on the MarginAccount contract. - initialize – Binding for
initialize
on the MarginAccount contract. - mae – Binding for
mae
on the MarginAccount contract. - mae_and_mmu_after_batch_trade – Binding for
maeAndMmuAfterBatchTrade
on the MarginAccount contract. - mae_check – Binding for
maeCheck
on the MarginAccount contract. - mma – Binding for
mma
on the MarginAccount contract. - mmu – Binding for
mmu
on the MarginAccount contract. - pnl – Binding for
pnl
on the MarginAccount contract. - position_age – Binding for
positionAge
on the MarginAccount contract. - position_count – Binding for
positionCount
on the MarginAccount contract. - position_data – Binding for
positionData
on the MarginAccount contract. - position_pn_l – Binding for
positionPnL
on the MarginAccount contract. - position_quantity – Binding for
positionQuantity
on the MarginAccount contract. - positions – Binding for
positions
on the MarginAccount contract. - product_registry – Binding for
productRegistry
on the MarginAccount contract. - revoke_authorization – Binding for
revokeAuthorization
on the MarginAccount contract. - settle – Binding for
settle
on the MarginAccount contract. - valuation – Binding for
valuation
on the MarginAccount contract. - withdraw – Binding for
withdraw
on the MarginAccount contract. - withdrawable – Binding for
withdrawable
on the MarginAccount contract.
Attributes:
- FeeCollected (
ContractEvent
) – Binding forevent FeeCollected
on the MarginAccount contract. - FeeDispersed (
ContractEvent
) – Binding forevent FeeDispersed
on the MarginAccount contract. - Initialized (
ContractEvent
) – Binding forevent Initialized
on the MarginAccount contract. - PositionUpdated (
ContractEvent
) – Binding forevent PositionUpdated
on the MarginAccount contract.
afp.bindings.MarginAccount.FeeCollected
FeeCollected: contract.ContractEvent
Binding for event FeeCollected
on the MarginAccount contract.
afp.bindings.MarginAccount.FeeDispersed
FeeDispersed: contract.ContractEvent
Binding for event FeeDispersed
on the MarginAccount contract.
afp.bindings.MarginAccount.Initialized
Initialized: contract.ContractEvent
Binding for event Initialized
on the MarginAccount contract.
afp.bindings.MarginAccount.PositionUpdated
PositionUpdated: contract.ContractEvent
Binding for event PositionUpdated
on the MarginAccount contract.
afp.bindings.MarginAccount.batch_mae_check
batch_mae_check(margin_account, settlements, mark_price_if_settled)
Binding for batchMaeCheck
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) – - settlements (
List[Settlement]
) – - mark_price_if_settled (
List[int]
) –
Returns:
afp.bindings.MarginAccount.batch_settle
batch_settle(margin_account_id, settlements)
Binding for batchSettle
on the MarginAccount contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - settlements (
List[Settlement]
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccount.capital
capital(margin_account)
Binding for capital
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) –
Returns:
int
–
afp.bindings.MarginAccount.clearing
clearing()
Binding for clearing
on the MarginAccount contract.
Returns:
afp.bindings.MarginAccount.collateral_asset
collateral_asset()
Binding for collateralAsset
on the MarginAccount contract.
Returns:
afp.bindings.MarginAccount.collateral_token
collateral_token()
Binding for collateralToken
on the MarginAccount contract.
Returns:
afp.bindings.MarginAccount.collect_fee
collect_fee(margin_account, capital_amount)
Binding for collectFee
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) – - capital_amount (
int
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccount.deposit
deposit(amount)
Binding for deposit
on the MarginAccount contract.
Parameters:
- amount (
int
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccount.disperse_fees
disperse_fees(recipients, capital_amounts)
Binding for disperseFees
on the MarginAccount contract.
Parameters:
- recipients (
List[ChecksumAddress]
) – - capital_amounts (
List[int]
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccount.estimate_liquidation_price
estimate_liquidation_price(margin_account_id, product_id, price, quantity)
Binding for estimateLiquidationPrice
on the MarginAccount contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - product_id (
HexBytes
) – - price (
int
) – - quantity (
int
) –
Returns:
int
–
afp.bindings.MarginAccount.estimate_liquidation_price_for_position
estimate_liquidation_price_for_position(margin_account_id, position_id)
Binding for estimateLiquidationPriceForPosition
on the MarginAccount contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - position_id (
HexBytes
) –
Returns:
int
–
afp.bindings.MarginAccount.initialize
initialize(_collateral_token, _valuation, _product_registry, _clearing)
Binding for initialize
on the MarginAccount contract.
Parameters:
- _collateral_token (
ChecksumAddress
) – - _valuation (
ChecksumAddress
) – - _product_registry (
ChecksumAddress
) – - _clearing (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccount.mae
mae(margin_account)
Binding for mae
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) –
Returns:
int
–
afp.bindings.MarginAccount.mae_and_mmu_after_batch_trade
mae_and_mmu_after_batch_trade(margin_account, settlements, mark_price_if_settled)
Binding for maeAndMmuAfterBatchTrade
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) – - settlements (
List[Settlement]
) – - mark_price_if_settled (
List[int]
) –
Returns:
afp.bindings.MarginAccount.mae_check
mae_check(margin_account, settlement, mark_price_if_settled)
Binding for maeCheck
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) – - settlement (
Settlement
) – - mark_price_if_settled (
int
) –
Returns:
afp.bindings.MarginAccount.mma
mma(margin_account)
Binding for mma
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) –
Returns:
int
–
afp.bindings.MarginAccount.mmu
mmu(margin_account)
Binding for mmu
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) –
Returns:
int
–
afp.bindings.MarginAccount.pnl
pnl(margin_account)
Binding for pnl
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) –
Returns:
int
–
afp.bindings.MarginAccount.position_age
position_age(margin_account_id, position_id)
Binding for positionAge
on the MarginAccount contract.
Parameters:
- margin_account_id (
ChecksumAddress
) – - position_id (
HexBytes
) –
Returns:
int
–
afp.bindings.MarginAccount.position_count
position_count(margin_account)
Binding for positionCount
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) –
Returns:
int
–
afp.bindings.MarginAccount.position_data
position_data(margin_account, position_id)
Binding for positionData
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) – - position_id (
HexBytes
) –
Returns:
afp.bindings.MarginAccount.position_pn_l
position_pn_l(margin_account, position_id)
Binding for positionPnL
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) – - position_id (
HexBytes
) –
Returns:
int
–
afp.bindings.MarginAccount.position_quantity
position_quantity(margin_account, position_id)
Binding for positionQuantity
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) – - position_id (
HexBytes
) –
Returns:
int
–
afp.bindings.MarginAccount.positions
positions(margin_account)
Binding for positions
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) –
Returns:
afp.bindings.MarginAccount.product_registry
product_registry()
Binding for productRegistry
on the MarginAccount contract.
Returns:
afp.bindings.MarginAccount.settle
settle(margin_account, intent_account, settlement)
Binding for settle
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) – - intent_account (
ChecksumAddress
) – - settlement (
Settlement
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccount.valuation
valuation()
Binding for valuation
on the MarginAccount contract.
Returns:
afp.bindings.MarginAccount.withdraw
withdraw(amount)
Binding for withdraw
on the MarginAccount contract.
Parameters:
- amount (
int
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccount.withdrawable
withdrawable(margin_account)
Binding for withdrawable
on the MarginAccount contract.
Parameters:
- margin_account (
ChecksumAddress
) –
Returns:
int
–
afp.bindings.MarginAccountRegistry
MarginAccountRegistry(w3)
Bases: MarginAccountRegistry
MarginAccountRegistry contract binding.
Parameters:
- w3 (
Web3
) –
Functions:
- clearing – Binding for
clearing
on the MarginAccountRegistry contract. - get_admin – Binding for
getAdmin
on the MarginAccountRegistry contract. - get_margin_account – Binding for
getMarginAccount
on the MarginAccountRegistry contract. - initialize – Binding for
initialize
on the MarginAccountRegistry contract. - initialize_margin_account – Binding for
initializeMarginAccount
on the MarginAccountRegistry contract. - is_admin_active – Binding for
isAdminActive
on the MarginAccountRegistry contract. - margin_accounts – Binding for
marginAccounts
on the MarginAccountRegistry contract. - owner – Binding for
owner
on the MarginAccountRegistry contract. - product_registry – Binding for
productRegistry
on the MarginAccountRegistry contract. - proxiable_uuid – Binding for
proxiableUUID
on the MarginAccountRegistry contract. - renounce_ownership – Binding for
renounceOwnership
on the MarginAccountRegistry contract. - set_active – Binding for
setActive
on the MarginAccountRegistry contract. - set_admin – Binding for
setAdmin
on the MarginAccountRegistry contract. - transfer_ownership – Binding for
transferOwnership
on the MarginAccountRegistry contract. - upgrade_interface_version – Binding for
UPGRADE_INTERFACE_VERSION
on the MarginAccountRegistry contract. - upgrade_to_and_call – Binding for
upgradeToAndCall
on the MarginAccountRegistry contract. - valuation – Binding for
valuation
on the MarginAccountRegistry contract.
Attributes:
- Initialized (
ContractEvent
) – Binding forevent Initialized
on the MarginAccountRegistry contract. - MarginAccountCreated (
ContractEvent
) – Binding forevent MarginAccountCreated
on the MarginAccountRegistry contract. - OwnershipTransferred (
ContractEvent
) – Binding forevent OwnershipTransferred
on the MarginAccountRegistry contract. - Upgraded (
ContractEvent
) – Binding forevent Upgraded
on the MarginAccountRegistry contract.
afp.bindings.MarginAccountRegistry.Initialized
Initialized: contract.ContractEvent
Binding for event Initialized
on the MarginAccountRegistry contract.
afp.bindings.MarginAccountRegistry.MarginAccountCreated
MarginAccountCreated: contract.ContractEvent
Binding for event MarginAccountCreated
on the MarginAccountRegistry contract.
afp.bindings.MarginAccountRegistry.OwnershipTransferred
OwnershipTransferred: contract.ContractEvent
Binding for event OwnershipTransferred
on the MarginAccountRegistry contract.
afp.bindings.MarginAccountRegistry.Upgraded
Upgraded: contract.ContractEvent
Binding for event Upgraded
on the MarginAccountRegistry contract.
afp.bindings.MarginAccountRegistry.clearing
clearing()
Binding for clearing
on the MarginAccountRegistry contract.
Returns:
afp.bindings.MarginAccountRegistry.get_admin
get_admin()
Binding for getAdmin
on the MarginAccountRegistry contract.
Returns:
afp.bindings.MarginAccountRegistry.get_margin_account
get_margin_account(collateral_asset)
Binding for getMarginAccount
on the MarginAccountRegistry contract.
Parameters:
- collateral_asset (
ChecksumAddress
) –
Returns:
afp.bindings.MarginAccountRegistry.initialize
initialize(_clearing, _valuation, _product_registry, beacon_)
Binding for initialize
on the MarginAccountRegistry contract.
Parameters:
- _clearing (
ChecksumAddress
) – - _valuation (
ChecksumAddress
) – - _product_registry (
ChecksumAddress
) – - beacon_ (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccountRegistry.initialize_margin_account
initialize_margin_account(collateral_asset)
Binding for initializeMarginAccount
on the MarginAccountRegistry contract.
Parameters:
- collateral_asset (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccountRegistry.is_admin_active
is_admin_active()
Binding for isAdminActive
on the MarginAccountRegistry contract.
Returns:
bool
–
afp.bindings.MarginAccountRegistry.margin_accounts
margin_accounts(key0)
Binding for marginAccounts
on the MarginAccountRegistry contract.
Parameters:
- key0 (
ChecksumAddress
) –
Returns:
afp.bindings.MarginAccountRegistry.owner
owner()
Binding for owner
on the MarginAccountRegistry contract.
Returns:
afp.bindings.MarginAccountRegistry.product_registry
product_registry()
Binding for productRegistry
on the MarginAccountRegistry contract.
Returns:
afp.bindings.MarginAccountRegistry.proxiable_uuid
proxiable_uuid()
Binding for proxiableUUID
on the MarginAccountRegistry contract.
Returns:
HexBytes
–
afp.bindings.MarginAccountRegistry.renounce_ownership
renounce_ownership()
Binding for renounceOwnership
on the MarginAccountRegistry contract.
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccountRegistry.set_active
set_active(active)
Binding for setActive
on the MarginAccountRegistry contract.
Parameters:
- active (
bool
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccountRegistry.set_admin
set_admin(new_admin)
Binding for setAdmin
on the MarginAccountRegistry contract.
Parameters:
- new_admin (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccountRegistry.transfer_ownership
transfer_ownership(new_owner)
Binding for transferOwnership
on the MarginAccountRegistry contract.
Parameters:
- new_owner (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccountRegistry.upgrade_interface_version
upgrade_interface_version()
Binding for UPGRADE_INTERFACE_VERSION
on the MarginAccountRegistry contract.
Returns:
str
–
afp.bindings.MarginAccountRegistry.upgrade_to_and_call
upgrade_to_and_call(new_implementation, data)
Binding for upgradeToAndCall
on the MarginAccountRegistry contract.
Parameters:
- new_implementation (
ChecksumAddress
) – - data (
HexBytes
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.MarginAccountRegistry.valuation
valuation()
Binding for valuation
on the MarginAccountRegistry contract.
Returns:
afp.bindings.OracleProvider
OracleProvider(w3)
Bases: OracleProvider
OracleProvider contract binding.
Parameters:
- w3 (
Web3
) –
Functions:
- get_admin – Binding for
getAdmin
on the OracleProvider contract. - initialize – Binding for
initialize
on the OracleProvider contract. - is_admin_active – Binding for
isAdminActive
on the OracleProvider contract. - owner – Binding for
owner
on the OracleProvider contract. - product_registry – Binding for
productRegistry
on the OracleProvider contract. - proxiable_uuid – Binding for
proxiableUUID
on the OracleProvider contract. - renounce_ownership – Binding for
renounceOwnership
on the OracleProvider contract. - resolve – Binding for
resolve
on the OracleProvider contract. - set_active – Binding for
setActive
on the OracleProvider contract. - set_admin – Binding for
setAdmin
on the OracleProvider contract. - submit – Binding for
submit
on the OracleProvider contract. - transfer_ownership – Binding for
transferOwnership
on the OracleProvider contract. - upgrade_interface_version – Binding for
UPGRADE_INTERFACE_VERSION
on the OracleProvider contract. - upgrade_to_and_call – Binding for
upgradeToAndCall
on the OracleProvider contract.
Attributes:
- Initialized (
ContractEvent
) – Binding forevent Initialized
on the OracleProvider contract. - OwnershipTransferred (
ContractEvent
) – Binding forevent OwnershipTransferred
on the OracleProvider contract. - PriceSubmitted (
ContractEvent
) – Binding forevent PriceSubmitted
on the OracleProvider contract. - Upgraded (
ContractEvent
) – Binding forevent Upgraded
on the OracleProvider contract.
afp.bindings.OracleProvider.Initialized
Initialized: contract.ContractEvent
Binding for event Initialized
on the OracleProvider contract.
afp.bindings.OracleProvider.OwnershipTransferred
OwnershipTransferred: contract.ContractEvent
Binding for event OwnershipTransferred
on the OracleProvider contract.
afp.bindings.OracleProvider.PriceSubmitted
PriceSubmitted: contract.ContractEvent
Binding for event PriceSubmitted
on the OracleProvider contract.
afp.bindings.OracleProvider.Upgraded
Upgraded: contract.ContractEvent
Binding for event Upgraded
on the OracleProvider contract.
afp.bindings.OracleProvider.get_admin
get_admin()
Binding for getAdmin
on the OracleProvider contract.
Returns:
afp.bindings.OracleProvider.initialize
initialize(_product_registry)
Binding for initialize
on the OracleProvider contract.
Parameters:
- _product_registry (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.OracleProvider.is_admin_active
is_admin_active()
Binding for isAdminActive
on the OracleProvider contract.
Returns:
bool
–
afp.bindings.OracleProvider.owner
owner()
Binding for owner
on the OracleProvider contract.
Returns:
afp.bindings.OracleProvider.product_registry
product_registry()
Binding for productRegistry
on the OracleProvider contract.
Returns:
afp.bindings.OracleProvider.proxiable_uuid
proxiable_uuid()
Binding for proxiableUUID
on the OracleProvider contract.
Returns:
HexBytes
–
afp.bindings.OracleProvider.renounce_ownership
renounce_ownership()
Binding for renounceOwnership
on the OracleProvider contract.
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.OracleProvider.resolve
resolve(product_id, key1)
Binding for resolve
on the OracleProvider contract.
Parameters:
Returns:
int
–
afp.bindings.OracleProvider.set_active
set_active(active)
Binding for setActive
on the OracleProvider contract.
Parameters:
- active (
bool
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.OracleProvider.set_admin
set_admin(admin)
Binding for setAdmin
on the OracleProvider contract.
Parameters:
- admin (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.OracleProvider.submit
submit(key, fsp)
Binding for submit
on the OracleProvider contract.
Parameters:
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.OracleProvider.transfer_ownership
transfer_ownership(new_owner)
Binding for transferOwnership
on the OracleProvider contract.
Parameters:
- new_owner (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.OracleProvider.upgrade_interface_version
upgrade_interface_version()
Binding for UPGRADE_INTERFACE_VERSION
on the OracleProvider contract.
Returns:
str
–
afp.bindings.OracleProvider.upgrade_to_and_call
upgrade_to_and_call(new_implementation, data)
Binding for upgradeToAndCall
on the OracleProvider contract.
Parameters:
- new_implementation (
ChecksumAddress
) – - data (
HexBytes
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.OracleSpecification
OracleSpecification(oracle_address, fsv_decimals, fsp_alpha, fsp_beta, fsv_calldata)
Port of struct OracleSpecification
on the IProductRegistry contract.
Attributes:
- fsp_alpha (
int
) – - fsp_beta (
int
) – - fsv_calldata (
HexBytes
) – - fsv_decimals (
int
) – - oracle_address (
ChecksumAddress
) –
afp.bindings.OracleSpecification.fsp_alpha
int fsp_alpha:
afp.bindings.OracleSpecification.fsp_beta
int fsp_beta:
afp.bindings.OracleSpecification.fsv_calldata
fsv_calldata: hexbytes.HexBytes
afp.bindings.OracleSpecification.fsv_decimals
int fsv_decimals:
afp.bindings.OracleSpecification.oracle_address
oracle_address: eth_typing.ChecksumAddress
afp.bindings.PositionData
PositionData(position_id, quantity, cost_basis, maintenance_margin, pnl)
Port of struct PositionData
on the IMarginAccount contract.
Attributes:
- cost_basis (
int
) – - maintenance_margin (
int
) – - pnl (
int
) – - position_id (
HexBytes
) – - quantity (
int
) –
afp.bindings.PositionData.cost_basis
int cost_basis:
afp.bindings.PositionData.maintenance_margin
int maintenance_margin:
afp.bindings.PositionData.pnl
int pnl:
afp.bindings.PositionData.position_id
position_id: hexbytes.HexBytes
afp.bindings.PositionData.quantity
int quantity:
afp.bindings.PositionLossData
PositionLossData(position_id, bankrupt_account_u_pn_l, bankrupt_account_quantity, mark_price, point_value, tick_size, laa_data)
Port of struct PositionLossData
on the IBankruptcy contract.
Attributes:
- bankrupt_account_quantity (
int
) – - bankrupt_account_u_pn_l (
int
) – - laa_data (
List[LAAData]
) – - mark_price (
int
) – - point_value (
int
) – - position_id (
HexBytes
) – - tick_size (
int
) –
afp.bindings.PositionLossData.bankrupt_account_quantity
int bankrupt_account_quantity:
afp.bindings.PositionLossData.bankrupt_account_u_pn_l
int bankrupt_account_u_pn_l:
afp.bindings.PositionLossData.laa_data
laa_data: typing.List[LAAData]
afp.bindings.PositionLossData.mark_price
int mark_price:
afp.bindings.PositionLossData.point_value
int point_value:
afp.bindings.PositionLossData.position_id
position_id: hexbytes.HexBytes
afp.bindings.PositionLossData.tick_size
int tick_size:
afp.bindings.Product
Product(metadata, oracle_spec, price_quotation, collateral_asset, start_time, earliest_fsp_submission_time, unit_value, initial_margin_requirement, maintenance_margin_requirement, offer_price_buffer, auction_bounty, tradeout_interval, tick_size, extended_metadata)
Port of struct Product
on the IProductRegistry contract.
Attributes:
- auction_bounty (
int
) – - collateral_asset (
ChecksumAddress
) – - earliest_fsp_submission_time (
int
) – - extended_metadata (
str
) – - initial_margin_requirement (
int
) – - maintenance_margin_requirement (
int
) – - metadata (
ProductMetadata
) – - offer_price_buffer (
int
) – - oracle_spec (
OracleSpecification
) – - price_quotation (
str
) – - start_time (
int
) – - tick_size (
int
) – - tradeout_interval (
int
) – - unit_value (
int
) –
afp.bindings.Product.auction_bounty
int auction_bounty:
afp.bindings.Product.collateral_asset
collateral_asset: eth_typing.ChecksumAddress
afp.bindings.Product.earliest_fsp_submission_time
int earliest_fsp_submission_time:
afp.bindings.Product.extended_metadata
str extended_metadata:
afp.bindings.Product.initial_margin_requirement
int initial_margin_requirement:
afp.bindings.Product.maintenance_margin_requirement
int maintenance_margin_requirement:
afp.bindings.Product.metadata
metadata: ProductMetadata
afp.bindings.Product.offer_price_buffer
int offer_price_buffer:
afp.bindings.Product.oracle_spec
oracle_spec: OracleSpecification
afp.bindings.Product.price_quotation
str price_quotation:
afp.bindings.Product.start_time
int start_time:
afp.bindings.Product.tick_size
int tick_size:
afp.bindings.Product.tradeout_interval
int tradeout_interval:
afp.bindings.Product.unit_value
int unit_value:
afp.bindings.ProductMetadata
ProductMetadata(builder, symbol, description)
Port of struct ProductMetadata
on the IProductRegistry contract.
Attributes:
- builder (
ChecksumAddress
) – - description (
str
) – - symbol (
str
) –
afp.bindings.ProductMetadata.builder
builder: eth_typing.ChecksumAddress
afp.bindings.ProductMetadata.description
str description:
afp.bindings.ProductMetadata.symbol
str symbol:
afp.bindings.ProductRegistry
ProductRegistry(w3)
Bases: ProductRegistry
ProductRegistry contract binding.
Parameters:
- w3 (
Web3
) –
Functions:
- auction_bounty – Binding for
auctionBounty
on the ProductRegistry contract. - clearing – Binding for
clearing
on the ProductRegistry contract. - collateral_asset – Binding for
collateralAsset
on the ProductRegistry contract. - earliest_fsp_submission_time – Binding for
earliestFSPSubmissionTime
on the ProductRegistry contract. - id – Binding for
id
on the ProductRegistry contract. - imr – Binding for
imr
on the ProductRegistry contract. - initialize – Binding for
initialize
on the ProductRegistry contract. - mmr – Binding for
mmr
on the ProductRegistry contract. - offer_price_buffer – Binding for
offerPriceBuffer
on the ProductRegistry contract. - oracle_specification – Binding for
oracleSpecification
on the ProductRegistry contract. - owner – Binding for
owner
on the ProductRegistry contract. - point_value – Binding for
pointValue
on the ProductRegistry contract. - products – Binding for
products
on the ProductRegistry contract. - proxiable_uuid – Binding for
proxiableUUID
on the ProductRegistry contract. - register – Binding for
register
on the ProductRegistry contract. - renounce_ownership – Binding for
renounceOwnership
on the ProductRegistry contract. - set_clearing – Binding for
setClearing
on the ProductRegistry contract. - state – Binding for
state
on the ProductRegistry contract. - tick_size – Binding for
tickSize
on the ProductRegistry contract. - transfer_ownership – Binding for
transferOwnership
on the ProductRegistry contract. - upgrade_interface_version – Binding for
UPGRADE_INTERFACE_VERSION
on the ProductRegistry contract. - upgrade_to_and_call – Binding for
upgradeToAndCall
on the ProductRegistry contract.
Attributes:
- Initialized (
ContractEvent
) – Binding forevent Initialized
on the ProductRegistry contract. - OwnershipTransferred (
ContractEvent
) – Binding forevent OwnershipTransferred
on the ProductRegistry contract. - ProductRegistered (
ContractEvent
) – Binding forevent ProductRegistered
on the ProductRegistry contract. - Upgraded (
ContractEvent
) – Binding forevent Upgraded
on the ProductRegistry contract.
afp.bindings.ProductRegistry.Initialized
Initialized: contract.ContractEvent
Binding for event Initialized
on the ProductRegistry contract.
afp.bindings.ProductRegistry.OwnershipTransferred
OwnershipTransferred: contract.ContractEvent
Binding for event OwnershipTransferred
on the ProductRegistry contract.
afp.bindings.ProductRegistry.ProductRegistered
ProductRegistered: contract.ContractEvent
Binding for event ProductRegistered
on the ProductRegistry contract.
afp.bindings.ProductRegistry.Upgraded
Upgraded: contract.ContractEvent
Binding for event Upgraded
on the ProductRegistry contract.
afp.bindings.ProductRegistry.auction_bounty
auction_bounty(product_id)
Binding for auctionBounty
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ProductRegistry.clearing
clearing()
Binding for clearing
on the ProductRegistry contract.
Returns:
afp.bindings.ProductRegistry.collateral_asset
collateral_asset(product_id)
Binding for collateralAsset
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
afp.bindings.ProductRegistry.earliest_fsp_submission_time
earliest_fsp_submission_time(product_id)
Binding for earliestFSPSubmissionTime
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ProductRegistry.id
id(product)
Binding for id
on the ProductRegistry contract.
Parameters:
- product (
Product
) –
Returns:
HexBytes
–
afp.bindings.ProductRegistry.imr
imr(product_id)
Binding for imr
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ProductRegistry.initialize
initialize()
Binding for initialize
on the ProductRegistry contract.
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ProductRegistry.mmr
mmr(product_id)
Binding for mmr
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ProductRegistry.offer_price_buffer
offer_price_buffer(product_id)
Binding for offerPriceBuffer
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ProductRegistry.oracle_specification
oracle_specification(product_id)
Binding for oracleSpecification
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
afp.bindings.ProductRegistry.owner
owner()
Binding for owner
on the ProductRegistry contract.
Returns:
afp.bindings.ProductRegistry.point_value
point_value(product_id)
Binding for pointValue
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ProductRegistry.products
products(product_id)
Binding for products
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
Product
–
afp.bindings.ProductRegistry.proxiable_uuid
proxiable_uuid()
Binding for proxiableUUID
on the ProductRegistry contract.
Returns:
HexBytes
–
afp.bindings.ProductRegistry.register
register(product)
Binding for register
on the ProductRegistry contract.
Parameters:
- product (
Product
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ProductRegistry.renounce_ownership
renounce_ownership()
Binding for renounceOwnership
on the ProductRegistry contract.
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ProductRegistry.set_clearing
set_clearing(clearing_)
Binding for setClearing
on the ProductRegistry contract.
Parameters:
- clearing_ (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ProductRegistry.state
state(product_id)
Binding for state
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
afp.bindings.ProductRegistry.tick_size
tick_size(product_id)
Binding for tickSize
on the ProductRegistry contract.
Parameters:
- product_id (
HexBytes
) –
Returns:
int
–
afp.bindings.ProductRegistry.transfer_ownership
transfer_ownership(new_owner)
Binding for transferOwnership
on the ProductRegistry contract.
Parameters:
- new_owner (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ProductRegistry.upgrade_interface_version
upgrade_interface_version()
Binding for UPGRADE_INTERFACE_VERSION
on the ProductRegistry contract.
Returns:
str
–
afp.bindings.ProductRegistry.upgrade_to_and_call
upgrade_to_and_call(new_implementation, data)
Binding for upgradeToAndCall
on the ProductRegistry contract.
Parameters:
- new_implementation (
ChecksumAddress
) – - data (
HexBytes
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.ProductState
Bases: IntEnum
Port of enum ProductState
on the ProductRegistry contract.
Attributes:
afp.bindings.ProductState.EXPIRED
= 5 EXPIRED
afp.bindings.ProductState.FINAL_SETTLEMENT
= 4 FINAL_SETTLEMENT
afp.bindings.ProductState.LIVE
= 2 LIVE
afp.bindings.ProductState.NOT_EXIST
= 0 NOT_EXIST
afp.bindings.ProductState.PENDING
= 1 PENDING
afp.bindings.ProductState.TRADEOUT
= 3 TRADEOUT
afp.bindings.Settlement
Settlement(position_id, quantity, price)
Port of struct Settlement
on the IMarginAccount contract.
Attributes:
afp.bindings.Settlement.position_id
position_id: hexbytes.HexBytes
afp.bindings.Settlement.price
int price:
afp.bindings.Settlement.quantity
int quantity:
afp.bindings.Side
Bases: IntEnum
Port of enum Side
on the ClearingFacet contract.
Attributes:
afp.bindings.Side.ASK
= 1 ASK
afp.bindings.Side.BID
= 0 BID
afp.bindings.SystemViewer
SystemViewer(w3)
Bases: SystemViewer
SystemViewer contract binding.
Parameters:
- w3 (
Web3
) –
Functions:
- clearing – Binding for
clearing
on the SystemViewer contract. - initialize – Binding for
initialize
on the SystemViewer contract. - mae_by_collateral_asset – Binding for
maeByCollateralAsset
on the SystemViewer contract. - mae_by_collateral_assets – Binding for
maeByCollateralAssets
on the SystemViewer contract. - mae_checks_by_collateral_asset – Binding for
maeChecksByCollateralAsset
on the SystemViewer contract. - margin_account_registry – Binding for
marginAccountRegistry
on the SystemViewer contract. - owner – Binding for
owner
on the SystemViewer contract. - positions_by_collateral_asset – Binding for
positionsByCollateralAsset
on the SystemViewer contract. - positions_by_collateral_assets – Binding for
positionsByCollateralAssets
on the SystemViewer contract. - product_details – Binding for
productDetails
on the SystemViewer contract. - product_registry – Binding for
productRegistry
on the SystemViewer contract. - product_states – Binding for
productStates
on the SystemViewer contract. - proxiable_uuid – Binding for
proxiableUUID
on the SystemViewer contract. - renounce_ownership – Binding for
renounceOwnership
on the SystemViewer contract. - transfer_ownership – Binding for
transferOwnership
on the SystemViewer contract. - upgrade_interface_version – Binding for
UPGRADE_INTERFACE_VERSION
on the SystemViewer contract. - upgrade_to_and_call – Binding for
upgradeToAndCall
on the SystemViewer contract. - user_margin_data_by_collateral_asset – Binding for
userMarginDataByCollateralAsset
on the SystemViewer contract. - user_margin_data_by_collateral_assets – Binding for
userMarginDataByCollateralAssets
on the SystemViewer contract. - valuations – Binding for
valuations
on the SystemViewer contract.
Attributes:
- Initialized (
ContractEvent
) – Binding forevent Initialized
on the SystemViewer contract. - OwnershipTransferred (
ContractEvent
) – Binding forevent OwnershipTransferred
on the SystemViewer contract. - Upgraded (
ContractEvent
) – Binding forevent Upgraded
on the SystemViewer contract.
afp.bindings.SystemViewer.Initialized
Initialized: contract.ContractEvent
Binding for event Initialized
on the SystemViewer contract.
afp.bindings.SystemViewer.OwnershipTransferred
OwnershipTransferred: contract.ContractEvent
Binding for event OwnershipTransferred
on the SystemViewer contract.
afp.bindings.SystemViewer.Upgraded
Upgraded: contract.ContractEvent
Binding for event Upgraded
on the SystemViewer contract.
afp.bindings.SystemViewer.clearing
clearing()
Binding for clearing
on the SystemViewer contract.
Returns:
afp.bindings.SystemViewer.initialize
initialize(_clearing, _product_registry, _margin_account_registry)
Binding for initialize
on the SystemViewer contract.
Parameters:
- _clearing (
ChecksumAddress
) – - _product_registry (
ChecksumAddress
) – - _margin_account_registry (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.SystemViewer.mae_by_collateral_asset
mae_by_collateral_asset(collateral_asset, accounts)
Binding for maeByCollateralAsset
on the SystemViewer contract.
Parameters:
- collateral_asset (
ChecksumAddress
) – - accounts (
List[ChecksumAddress]
) –
Returns:
afp.bindings.SystemViewer.mae_by_collateral_assets
mae_by_collateral_assets(collateral_assets, accounts)
Binding for maeByCollateralAssets
on the SystemViewer contract.
Parameters:
- collateral_assets (
List[ChecksumAddress]
) – - accounts (
List[ChecksumAddress]
) –
Returns:
afp.bindings.SystemViewer.mae_checks_by_collateral_asset
mae_checks_by_collateral_asset(collateral_asset, accounts, settlements)
Binding for maeChecksByCollateralAsset
on the SystemViewer contract.
Parameters:
- collateral_asset (
ChecksumAddress
) – - accounts (
List[ChecksumAddress]
) – - settlements (
List[Settlement]
) –
Returns:
afp.bindings.SystemViewer.margin_account_registry
margin_account_registry()
Binding for marginAccountRegistry
on the SystemViewer contract.
Returns:
afp.bindings.SystemViewer.owner
owner()
Binding for owner
on the SystemViewer contract.
Returns:
afp.bindings.SystemViewer.positions_by_collateral_asset
positions_by_collateral_asset(collateral_asset, accounts)
Binding for positionsByCollateralAsset
on the SystemViewer contract.
Parameters:
- collateral_asset (
ChecksumAddress
) – - accounts (
List[ChecksumAddress]
) –
Returns:
List[List[PositionData]]
–
afp.bindings.SystemViewer.positions_by_collateral_assets
positions_by_collateral_assets(collateral_assets, accounts)
Binding for positionsByCollateralAssets
on the SystemViewer contract.
Parameters:
- collateral_assets (
List[ChecksumAddress]
) – - accounts (
List[ChecksumAddress]
) –
Returns:
List[List[PositionData]]
–
afp.bindings.SystemViewer.product_details
product_details(product_ids)
Binding for productDetails
on the SystemViewer contract.
Parameters:
Returns:
afp.bindings.SystemViewer.product_registry
product_registry()
Binding for productRegistry
on the SystemViewer contract.
Returns:
afp.bindings.SystemViewer.product_states
product_states(product_ids)
Binding for productStates
on the SystemViewer contract.
Parameters:
Returns:
List[ProductState]
–
afp.bindings.SystemViewer.proxiable_uuid
proxiable_uuid()
Binding for proxiableUUID
on the SystemViewer contract.
Returns:
HexBytes
–
afp.bindings.SystemViewer.renounce_ownership
renounce_ownership()
Binding for renounceOwnership
on the SystemViewer contract.
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.SystemViewer.transfer_ownership
transfer_ownership(new_owner)
Binding for transferOwnership
on the SystemViewer contract.
Parameters:
- new_owner (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.SystemViewer.upgrade_interface_version
upgrade_interface_version()
Binding for UPGRADE_INTERFACE_VERSION
on the SystemViewer contract.
Returns:
str
–
afp.bindings.SystemViewer.upgrade_to_and_call
upgrade_to_and_call(new_implementation, data)
Binding for upgradeToAndCall
on the SystemViewer contract.
Parameters:
- new_implementation (
ChecksumAddress
) – - data (
HexBytes
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.SystemViewer.user_margin_data_by_collateral_asset
user_margin_data_by_collateral_asset(collateral_asset, accounts)
Binding for userMarginDataByCollateralAsset
on the SystemViewer contract.
Parameters:
- collateral_asset (
ChecksumAddress
) – - accounts (
List[ChecksumAddress]
) –
Returns:
afp.bindings.SystemViewer.user_margin_data_by_collateral_assets
user_margin_data_by_collateral_assets(collateral_assets, accounts)
Binding for userMarginDataByCollateralAssets
on the SystemViewer contract.
Parameters:
- collateral_assets (
List[ChecksumAddress]
) – - accounts (
List[ChecksumAddress]
) –
Returns:
afp.bindings.SystemViewer.valuations
valuations(product_ids)
Binding for valuations
on the SystemViewer contract.
Parameters:
Returns:
afp.bindings.Trade
Trade(product_id, protocol_id, trade_id, price, timestamp, accounts, quantities, fee_rates, intents)
Port of struct Trade
on the IClearing contract.
Attributes:
- accounts (
List[ChecksumAddress]
) – - fee_rates (
List[int]
) – - intents (
List[Intent]
) – - price (
int
) – - product_id (
HexBytes
) – - protocol_id (
ChecksumAddress
) – - quantities (
List[int]
) – - timestamp (
int
) – - trade_id (
int
) –
afp.bindings.Trade.accounts
accounts: typing.List[eth_typing.ChecksumAddress]
afp.bindings.Trade.fee_rates
int] fee_rates: typing.List[
afp.bindings.Trade.intents
intents: typing.List[Intent]
afp.bindings.Trade.price
int price:
afp.bindings.Trade.product_id
product_id: hexbytes.HexBytes
afp.bindings.Trade.protocol_id
protocol_id: eth_typing.ChecksumAddress
afp.bindings.Trade.quantities
int] quantities: typing.List[
afp.bindings.Trade.timestamp
int timestamp:
afp.bindings.Trade.trade_id
int trade_id:
afp.bindings.TradingProtocol
TradingProtocol(w3, address)
TradingProtocol contract binding.
Parameters:
- w3 (
Web3
) – - address (
ChecksumAddress
) – The address of a deployed TradingProtocol contract.
Functions:
- add_trade_submitter – Binding for
addTradeSubmitter
on the TradingProtocol contract. - change_owner – Binding for
changeOwner
on the TradingProtocol contract. - default_admin_role – Binding for
DEFAULT_ADMIN_ROLE
on the TradingProtocol contract. - deposit – Binding for
deposit
on the TradingProtocol contract. - execute – Binding for
execute
on the TradingProtocol contract. - execute_sequence – Binding for
executeSequence
on the TradingProtocol contract. - get_role_admin – Binding for
getRoleAdmin
on the TradingProtocol contract. - get_role_member – Binding for
getRoleMember
on the TradingProtocol contract. - get_role_member_count – Binding for
getRoleMemberCount
on the TradingProtocol contract. - get_role_members – Binding for
getRoleMembers
on the TradingProtocol contract. - grant_role – Binding for
grantRole
on the TradingProtocol contract. - has_role – Binding for
hasRole
on the TradingProtocol contract. - initialize – Binding for
initialize
on the TradingProtocol contract. - proxiable_uuid – Binding for
proxiableUUID
on the TradingProtocol contract. - remove_trade_submitter – Binding for
removeTradeSubmitter
on the TradingProtocol contract. - renounce_role – Binding for
renounceRole
on the TradingProtocol contract. - revoke_role – Binding for
revokeRole
on the TradingProtocol contract. - supports_interface – Binding for
supportsInterface
on the TradingProtocol contract. - trade_submitter_role – Binding for
TRADE_SUBMITTER_ROLE
on the TradingProtocol contract. - upgrade_interface_version – Binding for
UPGRADE_INTERFACE_VERSION
on the TradingProtocol contract. - upgrade_to_and_call – Binding for
upgradeToAndCall
on the TradingProtocol contract. - withdraw – Binding for
withdraw
on the TradingProtocol contract.
Attributes:
- Initialized (
ContractEvent
) – Binding forevent Initialized
on the TradingProtocol contract. - RoleAdminChanged (
ContractEvent
) – Binding forevent RoleAdminChanged
on the TradingProtocol contract. - RoleGranted (
ContractEvent
) – Binding forevent RoleGranted
on the TradingProtocol contract. - RoleRevoked (
ContractEvent
) – Binding forevent RoleRevoked
on the TradingProtocol contract. - SequenceExecuted (
ContractEvent
) – Binding forevent SequenceExecuted
on the TradingProtocol contract. - Upgraded (
ContractEvent
) – Binding forevent Upgraded
on the TradingProtocol contract.
afp.bindings.TradingProtocol.Initialized
Initialized: contract.ContractEvent
Binding for event Initialized
on the TradingProtocol contract.
afp.bindings.TradingProtocol.RoleAdminChanged
RoleAdminChanged: contract.ContractEvent
Binding for event RoleAdminChanged
on the TradingProtocol contract.
afp.bindings.TradingProtocol.RoleGranted
RoleGranted: contract.ContractEvent
Binding for event RoleGranted
on the TradingProtocol contract.
afp.bindings.TradingProtocol.RoleRevoked
RoleRevoked: contract.ContractEvent
Binding for event RoleRevoked
on the TradingProtocol contract.
afp.bindings.TradingProtocol.SequenceExecuted
SequenceExecuted: contract.ContractEvent
Binding for event SequenceExecuted
on the TradingProtocol contract.
afp.bindings.TradingProtocol.Upgraded
Upgraded: contract.ContractEvent
Binding for event Upgraded
on the TradingProtocol contract.
afp.bindings.TradingProtocol.add_trade_submitter
add_trade_submitter(submitter)
Binding for addTradeSubmitter
on the TradingProtocol contract.
Parameters:
- submitter (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.change_owner
change_owner(new_owner)
Binding for changeOwner
on the TradingProtocol contract.
Parameters:
- new_owner (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.default_admin_role
default_admin_role()
Binding for DEFAULT_ADMIN_ROLE
on the TradingProtocol contract.
Returns:
HexBytes
–
afp.bindings.TradingProtocol.deposit
deposit(margin_account_contract, amount)
Binding for deposit
on the TradingProtocol contract.
Parameters:
- margin_account_contract (
ChecksumAddress
) – - amount (
int
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.execute
execute(trade, fallback_on_failure)
Binding for execute
on the TradingProtocol contract.
Parameters:
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.execute_sequence
execute_sequence(trades, fallback_on_failure)
Binding for executeSequence
on the TradingProtocol contract.
Parameters:
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.get_role_admin
get_role_admin(role)
Binding for getRoleAdmin
on the TradingProtocol contract.
Parameters:
- role (
HexBytes
) –
Returns:
HexBytes
–
afp.bindings.TradingProtocol.get_role_member
get_role_member(role, index)
Binding for getRoleMember
on the TradingProtocol contract.
Parameters:
Returns:
afp.bindings.TradingProtocol.get_role_member_count
get_role_member_count(role)
Binding for getRoleMemberCount
on the TradingProtocol contract.
Parameters:
- role (
HexBytes
) –
Returns:
int
–
afp.bindings.TradingProtocol.get_role_members
get_role_members(role)
Binding for getRoleMembers
on the TradingProtocol contract.
Parameters:
- role (
HexBytes
) –
Returns:
afp.bindings.TradingProtocol.grant_role
grant_role(role, account)
Binding for grantRole
on the TradingProtocol contract.
Parameters:
- role (
HexBytes
) – - account (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.has_role
has_role(role, account)
Binding for hasRole
on the TradingProtocol contract.
Parameters:
- role (
HexBytes
) – - account (
ChecksumAddress
) –
Returns:
bool
–
afp.bindings.TradingProtocol.initialize
initialize(clearing_address)
Binding for initialize
on the TradingProtocol contract.
Parameters:
- clearing_address (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.proxiable_uuid
proxiable_uuid()
Binding for proxiableUUID
on the TradingProtocol contract.
Returns:
HexBytes
–
afp.bindings.TradingProtocol.remove_trade_submitter
remove_trade_submitter(submitter)
Binding for removeTradeSubmitter
on the TradingProtocol contract.
Parameters:
- submitter (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.renounce_role
renounce_role(role, caller_confirmation)
Binding for renounceRole
on the TradingProtocol contract.
Parameters:
- role (
HexBytes
) – - caller_confirmation (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.revoke_role
revoke_role(role, account)
Binding for revokeRole
on the TradingProtocol contract.
Parameters:
- role (
HexBytes
) – - account (
ChecksumAddress
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.supports_interface
supports_interface(interface_id)
Binding for supportsInterface
on the TradingProtocol contract.
Parameters:
- interface_id (
HexBytes
) –
Returns:
bool
–
afp.bindings.TradingProtocol.trade_submitter_role
trade_submitter_role()
Binding for TRADE_SUBMITTER_ROLE
on the TradingProtocol contract.
Returns:
HexBytes
–
afp.bindings.TradingProtocol.upgrade_interface_version
upgrade_interface_version()
Binding for UPGRADE_INTERFACE_VERSION
on the TradingProtocol contract.
Returns:
str
–
afp.bindings.TradingProtocol.upgrade_to_and_call
upgrade_to_and_call(new_implementation, data)
Binding for upgradeToAndCall
on the TradingProtocol contract.
Parameters:
- new_implementation (
ChecksumAddress
) – - data (
HexBytes
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.TradingProtocol.withdraw
withdraw(margin_account_contract, amount)
Binding for withdraw
on the TradingProtocol contract.
Parameters:
- margin_account_contract (
ChecksumAddress
) – - amount (
int
) –
Returns:
ContractFunction
– A contract function instance to be sent in a transaction.
afp.bindings.UserMarginAccountData
UserMarginAccountData(collateral_asset, margin_account_id, mae, mmu, positions)
Port of struct UserMarginAccountData
on the ISystemViewer contract.
Attributes:
- collateral_asset (
ChecksumAddress
) – - mae (
int
) – - margin_account_id (
ChecksumAddress
) – - mmu (
int
) – - positions (
List[PositionData]
) –
afp.bindings.UserMarginAccountData.collateral_asset
collateral_asset: eth_typing.ChecksumAddress
afp.bindings.UserMarginAccountData.mae
int mae:
afp.bindings.UserMarginAccountData.margin_account_id
margin_account_id: eth_typing.ChecksumAddress
afp.bindings.UserMarginAccountData.mmu
int mmu:
afp.bindings.UserMarginAccountData.positions
positions: typing.List[PositionData]