Skip to main content
@eco-incorp/sauce/svm is the Solana side: the client (createSauceSvmClient), clusters, PDAs, account resolution against the compiler’s account manifest, Kitchen and engine instructions, transactions and sending, token accounts, and compute planning for @sauce/router’s Solana venues. @eco-incorp/sauce/svm/engine exports the engine’s wire format and instruction builders, @eco-incorp/sauce/svm/verify verifies settle programs and engine CPI data, and @eco-incorp/sauce/svm/engine-artifacts (Node only) returns file paths to the packaged engine and Kitchen binaries.
Generated from the type declarations of @eco-incorp/sauce.

svmTickArray

Function · @eco-incorp/sauce/svm One tick array of layout, read: its start, span and initialized ticks; undefined for none.

svmTickAtSqrtPrice

Function · @eco-incorp/sauce/svm The tick whose sqrt price is the greatest at or below sqrt.

svmOwnLimit

Function · @eco-incorp/sauce/svm The router’s own limit for priceLimit at a pool of fee: its sqrt price (clmmOrder).

svmPoolWalk

Function · @eco-incorp/sauce/svm How far pool’s swap walks, held by nothing but its limit and its window, its cost and output: on Raydium’s code and Crema, on into the furthest tick array its slot gives where its limit takes it past the window (SvmWalk.deep), as its Stopped form walks with the deep tick its stop carries.

svmStopLimit

Function · @eco-incorp/sauce/svm The priceLimit that holds pool’s swap a tick inside tick, the first initialized tick it is not to cross: the loosest whose own limit, by the router’s arithmetic (svmOwnLimit), keeps the price short of it, found by halving, since the own limit moves with priceLimit one way only. Undefined where none does, a tick past what the router’s arithmetic reaches.

svmSkipStop

Function · @eco-incorp/sauce/svm The stop that skips a pool, whatever its price: a start bound past every tick the walk’s way (the least an i32 tick reads as paying the lower-key token, as the price falls, the greatest the other way), which every pool’s price has moved past, and no limit.

svmComputeStops

Function · @eco-incorp/sauce/svm Each pool’s stop for a cook whose venues’ programs may spend budget units between them. The pool whose walk buys the most per unit of compute goes first, each walking as far as its limit takes it within what is left; a pool the rest no longer covers is held a tick inside the first initialized tick it cannot pay to cross, and one that cannot pay for the swap itself is skipped. Every pool that trades is charged SVM_HEADROOM_TICKS crossings past its walk. A walk that goes on into the furthest tick array its slot gives (SvmWalk.deep) carries its deep tick, held or not, wherever it trades past its window.

svmProgramStops

Function · @eco-incorp/sauce/svm The stops of program’s swaps at a price, read through load from the accounts the cook resolved (accounts, by main’s parameter), with main’s Uint256 arguments by name (integers), for a limit a swap takes from one. fixed is the cook’s own units where a simulation measured them; scale shrinks what the venues are given, for a cook that ran out of units anyway. A swap in a loop is charged for each time the loop runs it (stoppableRuns); where a loop does not write its count out, or writes one that swap’s runs alone cannot pay for, none is held (unbounded). Undefined for a program with no stops.

svmStopValues

Function · @eco-incorp/sauce/svm The values a program compiled with stops.binding takes after its own arguments, one for each of its derivedValues: each held swap’s stop.

SvmStopLayout

Type · @eco-incorp/sauce/svm The concentrated-liquidity layouts a stop is worked out for.

SvmSwapCost

Interface · @eco-incorp/sauce/svm What a venue’s program charges one swap at a price, in compute units: base for the swap itself and tick for each initialized tick it crosses (a tick it walks past uninitialized costs next to nothing). Both are the venue program’s own units as the engine calls it, under CPI, as its log line reports them (Program <id> consumed N): the invoke itself and the accounts it serializes are the caller’s, in SVM_SWAP_FIXED, so a caller pricing the venue under its own CPI adds its own. base is at or above every walk of none measured and tick at or above the steepest step between two measured walks, on the venues’ own programs as mainnet runs them; the router suite holds both to those programs, so a program upgrade that moves them fails it. A whirlpool with an adaptive fee, which pays per step of its volatility too, is not priced here: the router skips it at a price.

SVM_SWAP_COSTS

Variable · @eco-incorp/sauce/svm

svmSwapCost

Variable · @eco-incorp/sauce/svm What program’s swap costs: its row of SVM_SWAP_COSTS, else the table’s dearest.

SVM_COOK_UNITS

Variable · @eco-incorp/sauce/svm The units a Solana cook may spend: the compute-unit limit its transaction asks for.

SVM_COOK_FIXED

Variable · @eco-incorp/sauce/svm What the cook spends besides the venues’ programs, as sauce tx estimates it with no simulation: the Kitchen, the engine and the program’s own work, SVM_COOK_FIXED; each swap at a price that trades, the router reading its pool and arrays, the balances around it and the venue’s invoke, SVM_SWAP_FIXED; each whose pool it reads and leaves (past its limit, an adaptive fee), SVM_SWAP_IDLE; and each with no pool at its key, SVM_SWAP_SKIPPED. Measured on the distributed swap’s program, a little above; sauce simulate and sauce run measure each cook’s own.

SVM_SWAP_FIXED

Variable · @eco-incorp/sauce/svm

SVM_SWAP_IDLE

Variable · @eco-incorp/sauce/svm

SVM_SWAP_SKIPPED

Variable · @eco-incorp/sauce/svm

SVM_HEADROOM_TICKS

Variable · @eco-incorp/sauce/svm The initialized ticks each pool that trades is charged past its walk, for a price that moves between the cook’s building and its landing: tick-spacing positions, each holding at most one initialized tick. A held pool’s Stopped form skips the pool where its price has moved further than that from where its walk was priced, so a held pool crosses at most this many more initialized ticks than were priced, while the ticks in its way stay as they were read: a position opened inside the walk in the meantime adds a crossing nothing charged.

SvmStopPool

Interface · @eco-incorp/sauce/svm A pool a swap at a price walks, as the cook’s builder reads it.

SvmWalk

Interface · @eco-incorp/sauce/svm How far a pool’s swap would walk, unheld, and what that costs and buys.

SvmComputeStop

Interface · @eco-incorp/sauce/svm A pool’s stop, as the cook’s builder worked it out.

SvmTick

Interface · @eco-incorp/sauce/svm An initialized tick, and the liquidity crossing it adds walking up.

SvmTickArray

Interface · @eco-incorp/sauce/svm An array’s first tick, its span in ticks, and its initialized ticks.

SvmPoolStop

Interface · @eco-incorp/sauce/svm A pool’s stop, with what a person reads of it.

SvmProgramStops

Interface · @eco-incorp/sauce/svm The stops of a cook: each swap’s, by its stop’s derivation (name), in the program’s order.