Skip to main content
Draft: specification in progress. Endpoints and fields may change.
Rebalancing means adjusting the proportion between USDY and BUIDL in the yielding balance. At TESA, every rebalancing starts as a proposal and only happens with the company’s approval.

Where proposals come from

  • Suggested by TESA (origem: tesa): when the rate spread between the assets exceeds the policy threshold. The alocacao.proposta event notifies the integration.
  • Created by the integration (origem: cliente): with POST /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, use PUT /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.