Skip to content

fix: Migrate airdrop fetcher from zkLend (Starknet) to Stellar protocol #56

@YaronZaki

Description

@YaronZaki

Problem Statement

quantara/web_app/contract_tools/airdrop.py:27 defines REWARD_API_ENDPOINT = "https://app.zklend.com/api/reward/all/" — a zkLend (Starknet lending protocol) endpoint. Quantara is on Stellar, but the airdrop fetcher queries a Starknet protocol's rewards API.

Evidence

# quantara/web_app/contract_tools/airdrop.py:26-27
# Default endpoint – replace with the actual protocol airdrop API
REWARD_API_ENDPOINT = "https://app.zklend.com/api/reward/all/"

The comment acknowledges it needs replacement but it was never changed. Airdrop checking queries wrong blockchain's protocol.

Impact

High — incorrect airdrop data. Users see incorrect or no airdrop information. The AirdropFetcher.get_contract_airdrop() method queries zkLend for airdrop data that may not correspond to any Stellar-based protocol. The AirdropResponseModel parsing expects zkLend's response format.

Proposed Solution

Replace zkLend API with an equivalent Stellar protocol's airdrop/rewards API. Update AirdropFetcher to parse the new API response format. If no Stellar protocol has airdrop programs, remove or stub the functionality.

Acceptance Criteria

  • REWARD_API_ENDPOINT changed to Stellar protocol endpoint (or airdrop feature removed)
  • AirdropFetcher._validate_response() updated for new response format
  • Airdrop tests updated or removed
  • test_zklend_airdrop.py renamed/removed as it's Starknet-specific
  • All existing tests pass

File Map

  • quantara/web_app/contract_tools/airdrop.py:27 — change REWARD_API_ENDPOINT
  • quantara/web_app/tasks/claim_airdrops.py — update claim logic
  • quantara/web_app/tests/test_airdrop.py — update tests
  • quantara/web_app/tests/test_zklend_airdrop.py — rename/remove

Testing Strategy

  • Unit: Test AirdropFetcher with mocked new API responses
  • Integration: Query real Stellar protocol airdrop API if available

Security Considerations

Querying wrong blockchain's API may return confusing or misleading data displayed to users. If functionality is not needed, removing it reduces attack surface.

Definition of Done

  • Code implemented and peer-reviewed
  • Tests written and passing
  • PR linked and merged

Labels: bug
Priority: High
Difficulty: Advanced
Estimated Effort: 1d

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignbugSomething isn't working

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