TradingPairKind#

API documentation for tradeexecutor.state.identifier.TradingPairKind Python class in Trading Strategy framework.

class TradingPairKind[source]#

Bases: Enum

What kind of trading position this is.

  • Spot markets are base:quote token pairs

  • Credit supplies are aToken:token pairs

__init__()#

Methods

is_interest_accruing()

Do base or quote or both gain interest during when the position is open.

is_credit_based()

is_credit_supply()

This trading pair is for gaining interest.

is_shorting()

This trading pair is for shorting.

is_longing()

This trading pair is for shorting.

is_leverage()

This is a leverage trade on a lending protocol.

is_spot()

This is a spot market pair.

Attributes

spot_market_hold

Bought tokens from DEX

spot_market_hold_rebalancing_token

Bought rebalancing tokens from DEX

credit_supply

Supplying credit to Aave reserves/gaining interest

lending_protocol_long

Leveraged long constructd using lending protocols

lending_protocol_short

Leveraged short constructd using lending protocols

spot_market_hold = 'spot_market_hold'#

Bought tokens from DEX

spot_market_hold_rebalancing_token = 'spot_market_rebalancing token'#

Bought rebalancing tokens from DEX

E.g. buy stETH or aUSD directly through DEX, instead of thru vault/reserves deposit.

credit_supply = 'credit_supply'#

Supplying credit to Aave reserves/gaining interest

lending_protocol_long = 'lending_protocol_long'#

Leveraged long constructd using lending protocols

lending_protocol_short = 'lending_protocol_short'#

Leveraged short constructd using lending protocols

is_interest_accruing()[source]#

Do base or quote or both gain interest during when the position is open.

Return type:

bool

is_credit_supply()[source]#

This trading pair is for gaining interest.

Return type:

bool

is_shorting()[source]#

This trading pair is for shorting.

Return type:

bool

is_longing()[source]#

This trading pair is for shorting.

Return type:

bool

is_leverage()[source]#

This is a leverage trade on a lending protocol.

Return type:

bool

is_spot()[source]#

This is a spot market pair.

Return type:

bool