bayesline.api.equity.PositionPinConstraint

bayesline.api.equity.PositionPinConstraint#

model PositionPinConstraint#

Fix the holding weight of listed assets to a target.

Targets are holding weights per unit of net nav, e.g. a hand-edited position that the rest of the book is optimized around. Ill-defined for a book whose net nav is ~0; such a book rejects an enabled pin at solve time.

Fields#

Field

Type

Required

Default

Constraints

enabled

bool

No

True

kind

Literal[‘position_pin’]

No

'position_pin'

space

Literal[‘total’, ‘active’]

No

'total'

targets

dict[str, float]

Yes

min_length=1

field enabled: bool [Optional]#

Whether this constraint is applied to the optimization problem.

field kind: Literal['position_pin'] [Optional]#
field space: Literal['total', 'active'] [Optional]#

Whether the targets are the portfolio’s holding weights (total) or its weights in excess of its benchmark’s (active).

field targets: dict[str, float] [Required]#

Target weights keyed by asset id, in the risk model’s asset id type.

Constraints:
  • min_length = 1