nqs_sdk.bindings.protocols.cex.cex_protocol module

nqs_sdk.bindings.protocols.cex.cex_protocol.compute_cex_target_amounts(token0_balance, token1_balance, weight_0, weight_1, execution_price, fee)[source]
Return type:

tuple[Decimal, Decimal]

class nqs_sdk.bindings.protocols.cex.cex_protocol.MarginPosition(token_id, margin_token, direction, margin_amount, collateral_token, collateral_amount, opening_price, opening_timestamp, opening_fee, liquidation_price, maintenance_margin_ratio)[source]

Bases: object

token_id: str
margin_token: str
direction: bool
margin_amount: Decimal
collateral_token: str
collateral_amount: Decimal
opening_price: Decimal
opening_timestamp: int
opening_fee: Decimal
liquidation_price: Decimal
maintenance_margin_ratio: Decimal
__init__(token_id, margin_token, direction, margin_amount, collateral_token, collateral_amount, opening_price, opening_timestamp, opening_fee, liquidation_price, maintenance_margin_ratio)
class nqs_sdk.bindings.protocols.cex.cex_protocol.CEX(markets)[source]

Bases: Protocol, ObservableConsumer

__init__(markets)[source]
id()[source]
Return type:

str

initialize(parameters)[source]
Return type:

None

consume(parameters, clock)[source]
Return type:

Tuple[List[MetricName], Optional[int]]

build_tx_payload(source, sender, call)[source]
Return type:

TxRequest

execute_tx(clock, state, tx)[source]
Return type:

None