Provide Liquidity (v1)
Provide liquidity on STON.fi v1 - add token pairs to pools and earn trading fees as LP
Jetton/Jetton pool deposit
import { TonClient, toNano } from "@ton/ton";
import { DEX } from "@ston-fi/sdk";
const USER_WALLET_ADDRESS = ""; // ! replace with your address
const JETTON_0_ADDRESS = "EQA2kCVNwVsil2EM2mB0SkXytxCqQjS4mttjDpnXmwG9T6bO"; // STON
const JETTON_1_ADDRESS = "EQBX6K9aXVl3nXINCyPPL86C4ONVmQ8vK360u6dykFKXpHCa"; // GEMSTON
const client = new TonClient({
endpoint: "https://toncenter.com/api/v2/jsonRPC",
});
const router = client.open(new DEX.v1.Router());
const txsParams = await Promise.all([
// deposit 0.5 STON to the STON/GEMSTON pool and get at least 1 nano LP token
router.getProvideLiquidityJettonTxParams({
userWalletAddress: USER_WALLET_ADDRESS,
sendTokenAddress: JETTON_0_ADDRESS,
sendAmount: toNano("0.5"),
otherTokenAddress: JETTON_1_ADDRESS,
minLpOut: "1",
queryId: 12345,
}),
// deposit 2 GEMSTON to the STON/GEMSTON pool and get at least 1 nano LP token
router.getProvideLiquidityJettonTxParams({
userWalletAddress: USER_WALLET_ADDRESS,
sendTokenAddress: JETTON_1_ADDRESS,
sendAmount: toNano("2.0"),
otherTokenAddress: JETTON_0_ADDRESS,
minLpOut: "1",
queryId: 123456,
}),
]);TON/Jetton pool deposit
Last updated