DeDust Hub
Technical Reference

Deposit

The Deposit contract is a short-lived "escrow" contract used during the liquidity provisioning process. Because a CPMM pool requires two different assets (Asset X and Asset Y) to mint liquidity, and TON transactions typically carry only one asset type at a time, the Deposit contract acts as a temporary accumulator.

Once it has received the required amounts of both assets, it triggers the JoinLiquidity call to the Pool. If the process is cancelled, it facilitates the refund of collected assets.

Getters

Method get_deposit_data

Returns the current state of the deposit process, including the target pool, expected amounts, and currently collected balances.

Arguments

This getter does not accept any arguments.

Returns

#NameTypeDescription
0poolAddressslice (address)Address of the Pool contract this deposit is intended for.
1recipientDestinationslice (address)Address that will receive the minted liquidity (or assets in case of a successful partial fill).
2refundDestinationslice (address)Address where assets will be returned if the deposit is cancelled or fails.
3amountXint (coins)Target amount of asset X to be collected.
4amountYint (coins)Target amount of asset Y to be collected.
5lockedLiquidityShareint (uint16)Share of minted liquidity to be locked (in BPS).
6minimalLiquidityint (coins)Slippage protection: minimum liquidity tokens expected to be minted.
7balanceXint (coins)Current amount of asset X already credited to this contract.
8balanceYint (coins)Current amount of asset Y already credited to this contract.

Incoming Messages

Message CreditAsset

Internal message sent by the Pool to credit an asset payment to this deposit contract. When the balances of both assets meet or exceed the target amounts (amountX, amountY), the contract automatically sends JoinLiquidity to the pool and self-destructs.

struct (0xdc5ddba1) CreditAsset {
    queryId: uint64
    isX: bool
    amount: coins
}
ParameterTypeDescription
queryIduint64Unique identifier for the transaction.
isXboolDirection: true if asset X is being credited, false for asset Y.
amountcoinsThe amount of the asset being credited.

Message CancelDeposit

Requests the cancellation of the deposit process. This message triggers a RefundDeposit call to the Pool, which returns all currently collected assets to the refundDestination. The contract self-destructs after sending the refund request.

struct (0x3db5f13a) CancelDeposit {
    queryId: uint64
}
ParameterTypeDescription
queryIduint64Unique identifier for the transaction.

Caller: Must be the initiator_address stored in the contract.

Other Types

Type DepositConfig

The configuration provided during the creation of the deposit, defining the parameters for liquidity minting and payouts.

struct DepositConfig {
    amountX: coins
    amountY: coins
    minimalLiquidity: coins
    lockedLiquidityShare: uint16
    payoutConfig: Cell<ExtendedPayoutConfig>
}
ParameterTypeDescription
amountXcoinsTarget amount of asset X.
amountYcoinsTarget amount of asset Y.
minimalLiquiditycoinsMinimum tokens to mint.
lockedLiquidityShareuint16Basis points of liquidity to lock in the resulting Position.
payoutConfigCell<ExtendedPayoutConfig>Payout settings defining recipients for minted liquidity and/or refunds.

On this page