Skip to content

Add investor exposure cap tests (max_active_bids_per_investor and portfolio cap enforcement) #782

@Baskarayelu

Description

@Baskarayelu

Description

Add tests that assert per-investor limits cannot be bypassed by bid churn (place/cancel/expire) and that exposure caps are enforced consistently.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feature/investor-exposure-cap-tests
  • Implement changes
  • Write contract: quicklendx-contracts/src/bid.rs, quicklendx-contracts/src/verification.rs, quicklendx-contracts/src/protocol_limits.rs
  • Write comprehensive tests: quicklendx-contracts/src/test_bid.rs, quicklendx-contracts/src/test_protocol_limits.rs
  • Add documentation: docs/contracts/limits.md
  • Include NatSpec-style comments (Rust doc comments on public items)
  • Validate security assumptions (caps reduce concentrated risk and limit abuse)

Test and commit

  • Run tests
  • cd quicklendx-contracts && cargo test --verbose
  • Include test output and security notes

Example commit message

test: enforce investor exposure caps and active-bid limits

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbiddingDesign / UX backlog: biddingpriority-highAuto label for contract issues: priority-highprotocol-limitsAuto label for contract issues: protocol-limitssecurityAuto label for contract issues: securitysmart-contractsAuto label for contract issues: smart-contractstestingAuto label for contract issues: testing
No fields configured for Feature.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions