Skip to content

feat: position transfer — transfer ownership of an open position to another address #281

Description

@abayomicornelius

Summary

Allow a position holder to transfer their open position to another Stellar address. Useful for portfolio restructuring, OTC desk transfers, and DeFi composability.

Proposed Design

Add transfer_position(position_key: Bytes, new_owner: Address) to exchange_router.

  • Requires auth from the current position owner
  • Rewrites the position's owner field in data_store
  • New owner can then manage (increase, decrease, close) the position
  • Emits PositionTransferred { key, from, to }

Security Considerations

  • New owner cannot refuse the transfer (push model) — document this UX risk
  • Consider a pull model: new owner must accept within N ledgers
  • Referral code attribution follows the position (not the new owner's code)

Acceptance Criteria

  • Transfer updates owner in persistent storage
  • New owner can execute decrease/close orders
  • Old owner cannot access position after transfer
  • Integration test: transfer, old owner decrease attempt reverts, new owner succeeds
  • Pull-model variant discussed and a decision documented in the PR

Affected Contracts

exchange_router, order_handler, data_store

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions