Everything you need to know to integrate with Meteora’s DBC Program
poolState.quoteReserve
state in a DBC pool.nextSqrtPrice
in the swap CPI logs.EvtSwap2
swap CPI logs.get_quote_token_from_sqrt_price
function
getQuoteReserveFromNextSqrtPrice
function in the DBC TypeScript SDK as it is the typescript version of the above function.
EvtSwap2
swap CPI logsEvtSwap2
swap CPI logs:
BaseFeeMode
can only be enums 0, 1, or 2.
0 = Linear Fee Scheduler
1 = Exponential Fee Scheduler
2 = Rate LimitercliffFeeNumerator
in the baseFee
object if firstFactor
, secondFactor
, and thirdFactor
are all 0.
poolState.activationType
.poolState.activationType == 0
, then numberOfPeriod
and periodFrequency
is calculated in SLOT == 400ms
poolState.activationType == 1
, then numberOfPeriod
and periodFrequency
is calculated in SECONDS == 1000ms
numberOfPeriod
, periodFrequency
, and reductionFactor
which are paired with the firstFactor
, secondFactor
, and thirdFactor
respectively.
baseFeeMode
can only be 0 or 1.
feeIncrementBps
, maxLimiterDuration
, and referenceAmount
which are paired with the firstFactor
, secondFactor
, and thirdFactor
respectively.
baseFeeMode
can only be 2.
TokenAmountIn
OR TokenAmountOut
. Plotting the token chart price from these will lead to a very ugly chart.EvtSwap2
CPI logs from the Swap transaction.
EvtSwap
is an older version of the swap CPI logs and might be deprecated in the future. Use EvtSwap2
instead.isMigrated
flag from the DBC pool state.MigrationProgress
parameter.quoteReserve
to migrate the pool provided quoteReserve >= migrationQuoteThreshold
.quoteReserve
is less than 750 USD worth of quoteToken
), you can use the Manual Migrator to manually migrate the pool.