YieldRuleset#
API documentation for tradeexecutor.strategy.pandas_trader.yield_manager.YieldRuleset Python class in Trading Strategy framework.
- class YieldRuleset[source]#
Bases:
object
Define how the strategy can allocate idle cash for the yield management.
Risk management, etc.
Management of withdrawal delays
Example:
def create_yield_rules( parameters: StrategyParameters, strategy_universe: TradingStrategyUniverse, ) -> YieldRuleset: # Create yield rules for the strategy. aave_usdc = strategy_universe.get_credit_supply_pair() ipor_usdc = strategy_universe.get_pair_by_smart_contract(VAULTS[0][1]) maxapy_usdc = strategy_universe.get_pair_by_smart_contract(VAULTS[1][1]) # Check we have yield vault metadata loaded assert aave_usdc assert ipor_usdc assert maxapy_usdc return YieldRuleset( position_allocation=parameters.allocation, buffer_pct=parameters.directional_trade_yield_buffer_pct, cash_change_tolerance_usd=parameters.yield_flow_dust_threshold, weights=[ YieldWeightingRule(pair=maxapy_usdc, max_concentration=0.75), YieldWeightingRule(pair=ipor_usdc, max_concentration=0.75), YieldWeightingRule(pair=aave_usdc, max_concentration=1.0), ]
- __init__(position_allocation, buffer_pct, cash_change_tolerance_usd, weights)#
- Parameters:
position_allocation (float) –
buffer_pct (float) –
cash_change_tolerance_usd (float) –
weights (list[tradeexecutor.strategy.pandas_trader.yield_manager.YieldWeightingRule]) –
- Return type:
None
Methods
Attributes
How much total equity is allowed to directional + yield position.
buffer_pct
How much yield position allocation must change before we start to generate new trades.
Max weights of each yield position
- cash_change_tolerance_usd: float#
How much yield position allocation must change before we start to generate new trades.
- weights: list[tradeexecutor.strategy.pandas_trader.yield_manager.YieldWeightingRule]#
Max weights of each yield position