Skip to content

Update template to current cow protocol schema#36

Closed
jeffersonBastos wants to merge 3 commits intocowprotocol:mainfrom
bleu:jefferson/cow-502-update-python-template-to-current-cow-protocol-schema
Closed

Update template to current cow protocol schema#36
jeffersonBastos wants to merge 3 commits intocowprotocol:mainfrom
bleu:jefferson/cow-502-update-python-template-to-current-cow-protocol-schema

Conversation

@jeffersonBastos
Copy link

Fix Python Solver Template Schema Compatibility

�� Problem

The Python solver template was incompatible with the current CoW Protocol infrastructure, causing 422 validation errors when receiving auctions from the driver.

🔧 Solution

  • Schema Update: Updated Python models to match solvers_dto structure
  • Field Mapping: Implemented proper snake_case ↔ camelCase mapping using Pydantic aliases
  • Model Replacement: Replaced legacy BatchAuction with CowAuction and Solutions
  • Template Cleanup: Removed incompatible legacy models and utilities

Changes

  • ✅ Fixed schema incompatibility with current CoW infrastructure
  • ✅ Updated field naming to use Python standards with JSON aliases
  • ✅ Replaced legacy models with CoW Protocol compatible ones
  • ✅ Organized template structure for better development experience
  • ✅ Added examples and reference materials

- Fix fundamental schema incompatibility with current CoW infrastructure
- Update models to use snake_case with Pydantic aliases for camelCase JSON
- Replace legacy BatchAuction with CowAuction matching solvers_dto
- Add proper field aliases (sellToken -> sell_token, etc.)
- Remove incompatible legacy models and utilities
- Update server endpoint to use new schema structure
- Organize template structure with examples and reference materials

Resolves schema validation errors (422) when receiving auctions from driver.
Template now works seamlessly with current CoW Protocol infrastructure.
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedpydantic@​1.9.0 ⏵ 1.10.1293 +1100100100100
Updateduvicorn@​0.17.6 ⏵ 0.22.098 +1100100100100
Updatedfastapi@​0.65.2 ⏵ 0.95.2100 +1100100100100

View full report

@github-actions github-actions bot locked and limited conversation to collaborators Oct 2, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant