Skip to main content

Overview

Ekiden uses Canton to manage collateral for trading. Users can deposit supported assets into their funding account and withdraw available collateral.

Supported collateral

The collateral registry lists every accepted asset, USDCx (the quote, asset_id 1) included:
See Collateral & Margin for how these apply.

Deposits

A deposit is a CIP-56 transfer from your wallet into the asset’s Funding vault, submitted from the user’s wallet (see CIP-0056).
1

Create the asset's vaults (first deposit of an asset only)

Returns 202 while the vaults are created on the ledger; repeating the request is harmless. The quote’s vaults exist from registration, so this is for other assets only. Returns 400 when the asset is unknown or not accepting deposits.
2

Fetch the contracts to disclose

Returns the live collateral_registry and the asset’s funding_fee_config (each as a disclosed contract: templateId, contractId, createdEventBlob, synchronizerId) and the asset’s fees. The registry contract is replaced whenever the registry changes, so fetch it right before submitting.
3

Submit the deposit

Exercise DepositIntoFundingAsset on your user contract with collateralRegistryCid and fundingFeeConfigCid from the previous step, disclosing both contracts. The transfer is amount + fees.deposit; your Funding balance is credited amount.
To trade with the asset, transfer it from your Funding to your Trading account. A transfer that would exceed the asset’s max_total_deposit or max_user_deposit is rejected and the funds stay in Funding.

Withdrawals

Exercise WithdrawFromFunding with the asset’s fundingFeeConfigCid. Your unlocked Funding balance must cover amount + fees.withdraw; you receive amount.
Withdrawals of assets other than USDCx settle as a direct CIP-56 transfer, so your party needs a transfer preapproval for that asset.

Fees

fees.deposit and fees.withdraw in the disclosures response are flat amounts in whole tokens of the asset, exactly what the ledger charges (e.g. "0.0005", or "0.00" when there is no fee). Size a submission from the fees and the funding_fee_config of the same response.