USDTVLSizeRiskModel#

API documentation for tradeexecutor.strategy.tvl_size_risk.USDTVLSizeRiskModel Python class in Trading Strategy framework.

class USDTVLSizeRiskModel[source]#

Bases: BaseTVLSizeRiskModel

Estimate the trade size based historical USD TVL values.

  • Fast as we have preprocessed data available

  • Some tokens may spoof this value and give unrealistic sizes

__init__(pricing_model, per_trade_cap=1.0, per_position_cap=1.0)[source]#
Parameters:
  • per_trade_cap (float) – Maximum US dollar value of a single trade, or unlimited.

  • pricing_model (PricingModel) –

  • per_position_cap (float) –

Methods

__init__(pricing_model[, per_trade_cap, ...])

param per_trade_cap:

get_acceptable_size_for_buy(timestamp, pair, ...)

get_acceptable_size_for_position(timestamp, ...)

What this the maximum position amount.

get_acceptable_size_for_sell(timestamp, ...)

get_pair_cap(pair, sizing_type)

Get cap for an individual trade for a pair.

get_tvl(timestamp, pair)

Read the TVL from the underlying pricing model.

__init__(pricing_model, per_trade_cap=1.0, per_position_cap=1.0)[source]#
Parameters:
  • per_trade_cap (float) – Maximum US dollar value of a single trade, or unlimited.

  • pricing_model (PricingModel) –

  • per_position_cap (float) –

get_tvl(timestamp, pair)[source]#

Read the TVL from the underlying pricing model.

Parameters:
Return type:

float