Adding new Jettons
Overview
DeDust Protocol creates a unique vault for every new Jetton.
When a new Jetton appears, we should set up its vault.
Then, we can establish a pool and add liquidity to it.
Create a vault
Setting up a new vault is very straightforward.
You can do it using the SDK or by manually sending the create_vault message (TL-B) to the Factory contract.
TypeScript
// Address of a new Jetton
const jettonAddress = Address.parse('EQBlqsm144Dq6SjbPI4jjZvA1hqTIP3CvHovbIfW_t-SCALE');
// Create a vault
await factory.sendCreateVault(sender, {
asset: Asset.jetton(jettonAddress),
});
Create a volatile pool
To set up a pool, you can either use the Factory method sendCreateVolatilePool or send the create_volatile_pool message (TL-B) directly to the Factory contract.
TypeScript
import { Asset, PoolType, ReadinessStatus } from '@dedust/sdk';
/* ... */
const TON = Asset.native();
const DUST = Asset.jetton(DUST_ADDRESS);
const pool = tonClient.open(
await factory.getPool(PoolType.VOLATILE, [TON, DUST]),
);
const poolReadiness = await pool.getReadinessStatus();
if (poolReadiness === ReadinessStatus.NOT_DEPLOYED) {
await factory.sendCreateVolatilePool(sender, {
assets: [TON, DUST],
});
}