Where proposals come from
- Suggested by TESA (
origem: tesa): when the rate spread between the assets exceeds the policy threshold. Thealocacao.propostaevent notifies the integration. - Created by the integration (
origem: cliente): withPOST /propostas, specifying the target allocation.
Flow
1
Receive or create the proposal
2
Review the movements
GET /propostas/{id} shows movimentos and alocacao_resultante. Check them before approving.3
Approve or reject
With an
admin key, call POST /propostas/{id}/aprovar or POST /propostas/{id}/rejeitar. Approval requires an Idempotency-Key and, in the current proposal, can be signed with HMAC.4
Sign with the custodian
The approved proposal includes
transacoes[].payload_nao_assinado. The custodian signs and broadcasts.5
Track execution
After on-chain confirmation, the proposal moves to
executada and records of type rebalanceamento appear in GET /registros.Changing the policy
To change the proportion permanently, not just once, usePUT /politica-de-alocacao. The new version applies to future deposits and becomes the reference for upcoming proposals. The percentages must add up to 100, otherwise the API returns 422 with politica_invalida.
Approving does not move funds. Funds move only after signing by the company’s custodian.