Addation of Prioritette Collections in Closing CLMM In Salon with SDK Raydium V2
Raydium, Popular Tenthralized Obmena Platform (DEX), predicted SDK V2 for deuting personalized bidding. The general wall, in which the policies can be found in the face of the adjusts, is concluded in the volume, which are trapped on the market shadow or the height. This one will be focused on you, adding a pre -dormitory of the concluding market) in the Solana, using the SDK V2 of the Raydium.
PROVIDIAL
- A sign with Raydium SDK and tongue programming by the way
- The main Ponimania of the Torgovo Logiki and the Priorites
Shag 1: Submit new wall
Submit the new file for your personalized script, for example, clmm_close_position.py
. This file will make the logic for closed gap with the SDK V2 Raydium.
`Solan-Program
Import {SDK} from ‘Raydium-SDK’;
/**
* Skript click clmming closes.
*
* @param {SDK} SDK – Raydium SDK copy.
*//
Export functions async (influencing) {
// Repeat the safety producer of the market (CM) and the shada closed.
Conc cm = position.cm;
Destraintrric = position.price;
// Check, there is a CM activated by the pre -iconic gatherings.
IF (cm.haspriorityfesenabled ()) {
// Read the transaction fee on the basis of the exposure/protruding market exam.
Const Fee = (ContingPrice – cm.bid) / cm.ak * 0.0001; // 100 skewers
// Close the post, Uspolza SDK V2 Ot Raydium.
Subtract sdk.closeposis (CM, Close -up, {
Sums: 1, // Close the United Tinnitsa
Platage,
});
} still {
// If the preorial gatherings are not active, the gattle, as it is.
Sadge sdk.closeposis (CM, closed);
}
}
`
Shag 2: Listen the wall with Raydium
To use the walls, you should spread it on the raydium. This is included in the new vessel of the walls and registration of your personalized function.
Solan-Program
{SCripT} Import} Raydium-SDK ‘;
// Create a new copy of the wall.
CONST CLMMCLOSPOSIS = NEW Script ();
// Write down the walls in raydium.
Clmmcloseposis.register (“Close”, Close);
`
Shag 3: Skript call in your commercial logic
To use the clip of the Clmm Close Position, you can release it from the commercial logic in the solan. Here's the Primer:
Solan-Program
Import {SDK} from ‘Raydium-SDK’;
// Repeat the safety producer of the market (CM) and the shada closed.
Conc cm = wat sdk.getmarketmaker ();
Contrureprice = wait sdk.getcloseprice (cm);
// Submit the clip of clmming click to close the post.
Edge, if clmmclose.Closeposis (closed);
“
With these steps, you can now use the SDK v2 and sola raydium program to add to the clicking in the closure clmm in your personal.