positions.getHoldings reports. There
is no amount and no partial close. Both models share this semantics; they differ only in
who signs.
- Managed (recommended)
- BYOW (client-signed)
For Cesto-managed wallets (provisioned via A
users.create),
Cesto signs server-side — one call, then poll:PARTIALLY_COMPLETED close means some legs sold and some didn’t; a fresh
close.start targets exactly what’s left. To get the USDC back to the user’s EVM
wallet afterwards, see Managed Wallets → Withdrawing.Existing Cesto users
When the wallet belongs to a Cesto account holder, the user approves once by signing a message and Cesto closes the position with their Cesto wallet — no per-transaction signing. Sameclose.start as the managed flow, plus a consent field:
amount:
the approval binds this wallet and this basket, and start resolves as soon as the job is
queued. It is never retried automatically — the approval is single-use.
External wallets that have never used Cesto return delegatedSigning: false and take the
BYOW flow above. See Users.
Results, errors, and security
Terminal statuses (COMPLETED, PARTIALLY_COMPLETED, FAILED), partial-completion
semantics, the common-error table, and the security model are identical to opening — see
Open a Position. Two close-specific notes:
- A wallet with no holdings of the basket has nothing to sell — check
positions.getHoldings(...).hasPositionbefore preparing a close. - A
PARTIALLY_COMPLETEDclose means some legs sold and some didn’t; the remaining holdings are still in the wallet and a fresh close (close.startorclose.prepare) will target exactly what’s left.