assertIsNotHalted
func(operations []string)assertIsNotHalted rejects the call while any of operations is halted for DCA orders in gno.land/r/gnoswap/order/halt.
- OID
- 0782ac…7c8d:3
assertIsNotHalted details
haltedOperation
func(operations []string) (string, bool)haltedOperation returns the first of operations halted for DCA orders.
- OID
- 0782ac…7c8d:5
haltedOperation details
assertIsAuthorizedKeeper
func(target string, caller .uverse.address)assertIsAuthorizedKeeper rejects callers that gno.land/r/gnoswap/order/keeper does not allow to run rounds on target, the DCA proxy package path. ExecuteGroup is assigned to DCAKeeperRole at deployment; admin or governance grants it to keepers or reassigns the selector.
- OID
- 0782ac…7c8d:6
assertIsAuthorizedKeeper details
isAdminOrGovernance
func(caller .uverse.address) boolisAdminOrGovernance reports whether caller is the GnoSwap admin or governance.
- OID
- 0782ac…7c8d:7
isAdminOrGovernance details
assertIsValidPair
func(inputToken string, outputToken string)assertIsValidPair checks that inputToken and outputToken differ and that at least one whitelisted direct pool connects them.
- OID
- 0782ac…7c8d:8
assertIsValidPair details
assertHasPairPriceLimit
func(pairPriceLimits *v0.BPTree, inputToken string, outputToken string)assertHasPairPriceLimit checks that the pair direction has a price limit, without which its rounds cannot trade.
- OID
- 0782ac…7c8d:9
assertHasPairPriceLimit details
assertIsAllowedInterval
func(config *v0.Config, interval int64)assertIsAllowedInterval checks that new orders may use interval.
- OID
- 0782ac…7c8d:10
assertIsAllowedInterval details
assertIsAllowedSlot
func(config *v0.Config, interval int64, slotOffset int64)assertIsAllowedSlot checks that new orders may use slotOffset at interval.
- OID
- 0782ac…7c8d:11
assertIsAllowedSlot details
assertIsValidOrderSize
func(config *v0.Config, minAmountPerExecution int64, amountPerExecution int64, executionCount int64)assertIsValidOrderSize checks the order against the configured limits; minAmountPerExecution is the effective minimum of the input token (see minAmountPerExecution).
- OID
- 0782ac…7c8d:12
assertIsValidOrderSize details
assertIsOrderOwner
func(order *v0.Order, caller .uverse.address)assertIsOrderOwner checks that caller owns the order.
- OID
- 0782ac…7c8d:13
assertIsOrderOwner details
assertIsQuotedAmountIn
func(group *v0.Group, expectedAmountIn int64, amountOutMin int64)assertIsQuotedAmountIn checks that the round sells the input amountOutMin was quoted for. A floor quoted for a larger input would keep that trade's price impact, which is looser than the smaller round needs, so a changed orderAmount needs a new quote instead of a rescaled floor. Passing 0 for both skips the check.
- OID
- 0782ac…7c8d:14
assertIsQuotedAmountIn details
groupOrdersClaimResult
typegroupOrdersClaimResult describes one page of claimGroupOrders.
Value
v0.groupOrdersClaimResult
dcaBPTreeFanOut
intValue
16
maxExecutionCountLimit
int64Value
10000
minAllowedInterval
int64Value
60
maxAllowedInterval
int64Value
31536000
maxClaimBatchSizeLimit
int64Value
500
minOrderAmountOutFloor
int64Value
1
defaultMinAmountPerExecution
int64Value
1
defaultMaxExecutionCount
int64Value
1000
defaultMaxClaimBatchSize
int64Value
50
defaultExecutionFeeRate
int64// basis points
Value
15
defaultMinExecutionGapRate
int64Value
5000
defaultMaxPoolPriceDeviationRate
int64Value
2000
defaultMaxPairPriceLimitAge
int64Value
3600
minMaxPairPriceLimitAge
int64Value
60
maxMaxPairPriceLimitAge
int64Value
604800
intervalMinute
int64Intervals new orders may use after deployment, in seconds. A month is a fixed 30 days, so every round in a group has the same length.
Value
60
intervalHour
int64Intervals new orders may use after deployment, in seconds. A month is a fixed 30 days, so every round in a group has the same length.
Value
3600
intervalDay
int64Intervals new orders may use after deployment, in seconds. A month is a fixed 30 days, so every round in a group has the same length.
Value
86400
intervalWeek
int64Intervals new orders may use after deployment, in seconds. A month is a fixed 30 days, so every round in a group has the same length.
Value
604800
intervalMonth
int64Intervals new orders may use after deployment, in seconds. A month is a fixed 30 days, so every round in a group has the same length.
Value
2592000
defaultAllowedIntervals
func() []int64defaultAllowedIntervals returns the initial allowed intervals, ascending.
- OID
- 0782ac…7c8d:15
defaultAllowedIntervals details
defaultSlotSteps
func() map[int64]int64defaultSlotSteps returns the initial slot step of the intervals split into several slots: daily orders pick an hour, weekly and 30-day orders a day. A 30-day slot is a day of the 30-day cycle counted from the unix epoch, not a calendar date. Minute and hourly orders keep a single slot, offset 0: finer slots would split liquidity for little gain. Each slot is its own group, so the steps bound the groups per pair.
- OID
- 0782ac…7c8d:17
defaultSlotSteps details
emitGroupCreated
func(prevAddr .uverse.address, prevRealm string, group *v0.Group)- OID
- 0782ac…7c8d:18
emitGroupCreated details
emitOrderCreated
func(prevAddr .uverse.address, prevRealm string, order *v0.Order, group *v0.Group, depositAmount int64, referenceAmountOut int64)emitOrderCreated reports a new order. executionFeeRate is the rate the order snapshotted. referenceAmountOut is the output of selling the whole deposit at once when the order was placed, net of the order's execution fee (see quoteReferenceAmountOut), 0 when no pool could absorb it.
- OID
- 0782ac…7c8d:20
emitOrderCreated details
emitGroupExecuted
func(prevAddr .uverse.address, prevRealm string, group *v0.Group, result v0.groupRoundResult)emitGroupExecuted reports a round. executedAmountOut, the output credited to the orders, equals swapAmountOut: orders pay their execution fees when paid out.
- OID
- 0782ac…7c8d:21
emitGroupExecuted details
emitGroupOrdersClaimed
func(prevAddr .uverse.address, prevRealm string, groupID string, examinedOrderCount int, claimedOrderCount int, releasedExecutionLogCount int64, nextCursor uint64)- OID
- 0782ac…7c8d:22
emitGroupOrdersClaimed details
emitOrderClaimed
func(prevAddr .uverse.address, prevRealm string, order *v0.Order, group *v0.Group, payout v0.orderPayout, status v0.OrderStatus)emitOrderClaimed reports a payout. grossAmount is the accrued output paid out, executionFeeAmount the order's fee on it, and claimedAmount the rest, sent to the owner; the totals are the order's lifetime values.
- OID
- 0782ac…7c8d:23
emitOrderClaimed details
emitOrderCancelled
func(prevAddr .uverse.address, prevRealm string, order *v0.Order, group *v0.Group, payout v0.orderPayout, refundedAmount int64)- OID
- 0782ac…7c8d:24
emitOrderCancelled details
emitPayoutExecutionFee
func(prevAddr .uverse.address, prevRealm string, group *v0.Group, executionFeeAmount int64, pendingAmount int64)emitPayoutExecutionFee reports the execution fee a payout of the group's orders charged and kept as pending, if any.
- OID
- 0782ac…7c8d:25
emitPayoutExecutionFee details
emitExecutionFeeCollected
func(prevAddr .uverse.address, prevRealm string, groupID string, tokenPath string, round uint64, executionFeeAmount int64, forwardedAmount int64, pendingAmount int64)emitExecutionFeeCollected reports execution fees of tokenPath. executionFeeAmount is the fee payouts charged (0 for a round or CollectPendingExecutionFee), forwardedAmount what was sent to the protocol fee realm, and pendingAmount what this realm still holds. groupId is empty and round 0 for CollectPendingExecutionFee.
- OID
- 0782ac…7c8d:26
emitExecutionFeeCollected details
emitExecutionFeeRateChanged
func(prevAddr .uverse.address, prevRealm string, previousExecutionFeeRate int64, executionFeeRate int64)- OID
- 0782ac…7c8d:27
emitExecutionFeeRateChanged details
emitSlotStepChanged
func(prevAddr .uverse.address, prevRealm string, interval int64, previousSlotStep int64, slotStep int64)- OID
- 0782ac…7c8d:28
emitSlotStepChanged details
emitExecutionLogsReleased
func(prevAddr .uverse.address, prevRealm string, order *v0.Order, group *v0.Group, releasedExecutionLogCount int64)- OID
- 0782ac…7c8d:29
emitExecutionLogsReleased details
emitConfigUpdated
func(prevAddr .uverse.address, prevRealm string, key string, previousValue int64, value int64)- OID
- 0782ac…7c8d:30
emitConfigUpdated details
emitAllowedIntervalUpdated
func(prevAddr .uverse.address, prevRealm string, interval int64, allowed bool)- OID
- 0782ac…7c8d:31
emitAllowedIntervalUpdated details
emitOrderForceCancelled
func(prevAddr .uverse.address, prevRealm string, order *v0.Order, group *v0.Group, payout v0.orderPayout, refundedAmount int64, reason string)emitOrderForceCancelled reports an order closed by a keeper with ForceCancelOrder. It carries the fields of DCAOrderCancelled and the reason the order blocked its group (see ForceCancelOrder); the order's status is cancelled, and its output and refund went to the owner.
- OID
- 0782ac…7c8d:32
emitOrderForceCancelled details
emitTokenMinAmountPerExecutionUpdated
func(prevAddr .uverse.address, prevRealm string, tokenPath string, previousMinAmountPerExecution int64, minAmountPerExecution int64)- OID
- 0782ac…7c8d:33
emitTokenMinAmountPerExecutionUpdated details
emitPairPriceLimitUpdated
func(prevAddr .uverse.address, prevRealm string, inputToken string, outputToken string, previousMinOutputPerInputX128 string, minOutputPerInputX128 string, updatedAt int64)emitPairPriceLimitUpdated reports a pair price limit change; minOutputPerInputX128 "0" and updatedAt 0 mean the limit was removed.
- OID
- 0782ac…7c8d:34
emitPairPriceLimitUpdated details
errInvalidPool
untyped stringValue
"[GNOSWAP-ORDER-DCA-001] invalid pool"
errInvalidToken
untyped stringValue
"[GNOSWAP-ORDER-DCA-002] invalid token"
errInvalidInterval
untyped stringValue
"[GNOSWAP-ORDER-DCA-003] invalid interval"
errInvalidAmount
untyped stringValue
"[GNOSWAP-ORDER-DCA-004] invalid amount"
errInvalidExecutionCount
untyped stringValue
"[GNOSWAP-ORDER-DCA-005] invalid number of executions"
errOrderNotFound
untyped stringValue
"[GNOSWAP-ORDER-DCA-006] order not found"
errNotOrderOwner
untyped stringValue
"[GNOSWAP-ORDER-DCA-007] caller is not the order owner"
errGroupNotFound
untyped stringValue
"[GNOSWAP-ORDER-DCA-008] group not found"
errGroupNotExecutable
untyped stringValue
"[GNOSWAP-ORDER-DCA-009] group is not executable"
errSwapMismatch
untyped stringValue
"[GNOSWAP-ORDER-DCA-010] swap result mismatch"
errInvalidConfig
untyped stringValue
"[GNOSWAP-ORDER-DCA-011] invalid config"
errInvalidState
untyped stringValue
"[GNOSWAP-ORDER-DCA-012] invalid accounting state"
errOverflow
untyped stringValue
"[GNOSWAP-ORDER-DCA-013] overflow"
errReentrant
untyped stringValue
"[GNOSWAP-ORDER-DCA-014] reentrant call during group execution"
errInvalidCursor
untyped stringValue
"[GNOSWAP-ORDER-DCA-015] invalid cursor"
errNotKeeper
untyped stringValue
"[GNOSWAP-ORDER-DCA-016] caller is not an authorized keeper"
errNoEligiblePool
untyped stringValue
"[GNOSWAP-ORDER-DCA-017] no eligible pool"
errInvalidExecutionFeeRate
untyped stringValue
"[GNOSWAP-ORDER-DCA-018] invalid execution fee rate"
errInvalidSlotOffset
untyped stringValue
"[GNOSWAP-ORDER-DCA-019] invalid slot offset"
errInvalidSlotStep
untyped stringValue
"[GNOSWAP-ORDER-DCA-020] invalid slot step"
errHalted
untyped stringValue
"[GNOSWAP-ORDER-DCA-021] operation halted"
errAmountInMismatch
untyped stringValue
"[GNOSWAP-ORDER-DCA-022] round input does not match the quote"
errInsufficientOrderOutput
untyped stringValue
"[GNOSWAP-ORDER-DCA-024] insufficient output per order"
errInsufficientSwapOutput
untyped stringValue
"[GNOSWAP-ORDER-DCA-025] swap output below amountOutMin"
errInvalidPriceLimit
untyped stringValue
"[GNOSWAP-ORDER-DCA-026] invalid price limit"
errMissingPriceLimit
untyped stringValue
"[GNOSWAP-ORDER-DCA-027] missing price limit"
errOrderNotBlocking
untyped stringValue
"[GNOSWAP-ORDER-DCA-028] order does not block its group"
makeErrorWithDetails
func(message string, details string) .uverse.error- OID
- 0782ac…7c8d:35
makeErrorWithDetails details
groupRoundResult
typegroupRoundResult describes one executed round.
Value
v0.groupRoundResult
getPendingExecutionFeeAmount
func(pendingExecutionFees *v0.BPTree, tokenPath string) int64getPendingExecutionFeeAmount returns the execution fee of tokenPath held by this realm, 0 if none.
- OID
- 0782ac…7c8d:37
getPendingExecutionFeeAmount details
calculateClaimableAmount
func(order *v0.Order, group *v0.Group) (int64, .uverse.error)calculateClaimableAmount returns what the next Claim pays the owner, net of the order's execution fee.
- OID
- 0782ac…7c8d:39
calculateClaimableAmount details
isGroupExecutable
func(group *v0.Group, currentTimestamp int64) boolisGroupExecutable reports whether the schedule and the halts allow the group's next round now. Pools are not quoted here.
- OID
- 0782ac…7c8d:41
isGroupExecutable details
isExecutionHalted
func() boolisExecutionHalted reports whether execute or withdraw is halted, matching the checks ExecuteGroup makes before running a round.
- OID
- 0782ac…7c8d:42
isExecutionHalted details
marshal
func(fields map[string]*v0.Node) string- OID
- 0782ac…7c8d:43
marshal details
intNode
func(v int64) *v0.Node- OID
- 0782ac…7c8d:44
intNode details
cloneOrderEntry
func(value interface{...}) interface{...}- OID
- 0782ac…7c8d:45
cloneOrderEntry details
cloneGroupEntry
func(value interface{...}) interface{...}- OID
- 0782ac…7c8d:46
cloneGroupEntry details
clonePairPriceLimitEntry
func(value interface{...}) interface{...}- OID
- 0782ac…7c8d:47
clonePairPriceLimitEntry details
init.88
func()- OID
- 0782ac…7c8d:48
init.88 details
registerDCAOrderImpl
func()- OID
- 0782ac…7c8d:50
registerDCAOrderImpl details
initStoreData
func(int, rlm .uverse.realm, s v0.IDCAOrderStore) .uverse.error- OID
- 0782ac…7c8d:51
initStoreData details
dcaOrderImpl
typeValue
v0.dcaOrderImpl
NewDCAOrderImpl
func(dcaStore v0.IDCAOrderStore) v0.IDCAOrderNewDCAOrderImpl creates the implementation over the shared store.
- OID
- 0782ac…7c8d:52
NewDCAOrderImpl details
getTokenMinAmountPerExecution
func(s v0.IDCAOrderStore, tokenPath string) int64getTokenMinAmountPerExecution returns the minimum input per execution set for tokenPath, or 0 if none is set.
- OID
- 0782ac…7c8d:54
getTokenMinAmountPerExecution details
forceCancelBelowMinAmount
untyped stringReasons ForceCancelOrder accepts, reported by DCAOrderForceCancelled.
Value
"below_min_amount"
forceCancelNoOrderOutput
untyped stringReasons ForceCancelOrder accepts, reported by DCAOrderForceCancelled.
Value
"no_order_output"
forceCancelExceedsPoolCapacity
untyped stringReasons ForceCancelOrder accepts, reported by DCAOrderForceCancelled.
Value
"exceeds_pool_capacity"
hasPartialFill
func(candidates []*v0.poolCandidate) boolhasPartialFill reports whether a candidate pool fills only part of the round within the price limit, with some output, so that a smaller round may fill. A pool that swaps nothing, such as one without liquidity, also reports codePartialFill but cannot fill any smaller round.
- OID
- 0782ac…7c8d:56
hasPartialFill details
orderCancelResult
typeorderCancelResult describes a closed order.
Value
v0.orderCancelResult
poolCandidate
typepoolCandidate is one pool of the pair and its evaluation for a round.
Value
v0.poolCandidate
poolWhitelist
typepoolWhitelist is the read-only membership contract used by pool selection. Production passes the common whitelist realm's read-only view; focused selection tests use an in-memory tree.
Value
v0.poolWhitelist
getCandidatePools
func(whitelistedPools v0.poolWhitelist, inputToken string, outputToken string) []*v0.poolCandidategetCandidatePools returns the whitelisted pools of the pair, ordered by fee tier.
- OID
- 0782ac…7c8d:58
getCandidatePools details
selectPool
func(whitelistedPools v0.poolWhitelist, limit *v0.PairPriceLimit, maxDeviationRate int64, maxLimitAge int64, inputToken string, outputToken string, amountIn int64, quoteAll bool) (*v0.poolCandidate, []*v0.poolCandidate)selectPool evaluates the pair's whitelisted pools for a round of amountIn under limit, the pair price limit (nil if none is set), and maxDeviationRate (Config.MaxPoolPriceDeviationRate), and maxLimitAge (Config.MaxPairPriceLimitAge), and returns the chosen pool (nil if none can fill it) with all candidates. quoteAll quotes every pool, even when the pair has only one.
- OID
- 0782ac…7c8d:60
selectPool details
quoteReferenceAmountOut
func(whitelistedPools v0.poolWhitelist, limit *v0.PairPriceLimit, maxDeviationRate int64, maxLimitAge int64, inputToken string, outputToken string, amountIn int64) int64quoteReferenceAmountOut quotes selling amountIn at once, now, on the pair's best whitelisted pool within the pair price limit: what a one-off swap of the whole order would return. Order fills are measured against it. It is 0 when no pool can absorb the whole amount within the limit.
- OID
- 0782ac…7c8d:61
quoteReferenceAmountOut details
selectRoundPool
func(whitelistedPools v0.poolWhitelist, limit *v0.PairPriceLimit, maxDeviationRate int64, maxLimitAge int64, group *v0.Group, amountIn int64) (*v0.poolCandidate, .uverse.error)selectRoundPool is selectPool for execution. When no pool can fill the round, it returns an error listing each candidate's reason. A pair without a whitelisted pool has no candidates.
- OID
- 0782ac…7c8d:62
selectRoundPool details
quoteExactIn
func(inputToken string, outputToken string, fee uint32, sqrtPriceLimitX96 string, amountIn int64) (int64, string, .uverse.error)quoteExactIn simulates selling amountIn on the pair's pool of fee tier fee, down to sqrtPriceLimitX96, and returns the pool output. It fails unless the whole input is consumed within the limit, and then also returns the ineligibility code of the failure. A partial fill (codePartialFill) returns the output of the input it consumed, 0 when the pool swapped nothing, such as one without liquidity; every other failure returns 0.
- OID
- 0782ac…7c8d:63
quoteExactIn details
minSqrtRatioPlusOne
untyped stringSqrt price bounds a swap price limit is clamped to; the pool requires a limit strictly inside (MIN\_SQRT\_RATIO, MAX\_SQRT\_RATIO).
Value
"4295128740"
maxSqrtRatioMinusOne
untyped stringSqrt price bounds a swap price limit is clamped to; the pool requires a limit strictly inside (MIN\_SQRT\_RATIO, MAX\_SQRT\_RATIO).
Value
"1461446703485210103287273052203988822378723970341"
poolFeeDenominator
uint64poolFeeDenominator is the denominator of pool fee tiers (3000 is 0.3%).
Value
1000000
q96Shift
uintValue
96
codeNoPriceLimit
untyped string// the pair direction has no limit
Value
"no_price_limit"
codePriceLimitStale
untyped string// the limit is older than its maximum age
Value
"price_limit_stale"
codePricePastLimit
untyped string// the pool price is already past the limit
Value
"price_past_limit"
codePriceDisplaced
untyped string// the pool price is too far on the favorable side
Value
"price_displaced"
codePriceUnavailable
untyped string// the pool price could not be read
Value
"price_unavailable"
codePartialFill
untyped string// the quote fills only part of the input
Value
"partial_fill"
codeNoOutput
untyped string// the quote returns no output
Value
"no_output"
codeQuoteFailed
untyped string// the pool rejected the quote
Value
"quote_failed"
reasonNoPriceLimit
untyped stringValue
"no price limit for the pair"
reasonPriceLimitStale
untyped stringValue
"pair price limit is older than its maximum age"
reasonInvalidLimitAge
untyped stringValue
"invalid max pair price limit age"
reasonPricePastLimit
untyped stringValue
"pool price is past the pair price limit"
reasonPriceDisplaced
untyped stringValue
"pool price deviates too far from the pair price limit"
reasonPoolPriceAbsent
untyped stringValue
"pool price unavailable"
reasonInvalidDeviation
untyped stringValue
"invalid max pool price deviation rate"
getPairPriceLimit
func(pairPriceLimits *v0.BPTree, inputToken string, outputToken string) *v0.PairPriceLimitgetPairPriceLimit returns the price limit of selling inputToken for outputToken, or nil if none is set.
- OID
- 0782ac…7c8d:64
getPairPriceLimit details
calculateSqrtPriceLimitX96
func(minOutputPerInputX128 *v1.Uint, fee uint32, zeroForOne bool) *v1.UintcalculateSqrtPriceLimitX96 converts minOutputPerInputX128 into the sqrt price limit of a swap on a pool of fee tier fee in the given direction, clamped to the range the pool accepts. The pool takes its fee from the input, so the marginal rate of a unit of input is P\*(1-fee) selling token0 (P = token1 per token0) and (1-fee)/P selling token1. Requiring that rate to stay at or above L gives: zeroForOne: P >= L/(1-fee), a lower bound, rounded up oneForZero: P <= (1-fee)/L, an upper bound, rounded down so the rounding never loosens the limit.
- OID
- 0782ac…7c8d:66
calculateSqrtPriceLimitX96 details
sqrtX128ToSqrtX96
func(priceX128 *v1.Uint, roundUp bool) *v1.UintsqrtX128ToSqrtX96 returns sqrt(priceX128 / 2^128) \* 2^96, that is sqrt(priceX128 \* 2^64), rounded up when roundUp is set. A priceX128 too large to shift by 64 bits is shifted by 64-2k bits and the root by k bits instead, which keeps the result within one part in 2^96.
- OID
- 0782ac…7c8d:67
sqrtX128ToSqrtX96 details
sqrtUint256
func(x *v1.Uint) *v1.UintsqrtUint256 returns floor(sqrt(x)) by Newton's method.
- OID
- 0782ac…7c8d:68
sqrtUint256 details
poolSqrtPriceLimit
func(poolPath string, fee uint32, zeroForOne bool, limit *v0.PairPriceLimit, maxDeviationRate int64, maxLimitAge int64) (string, string, string)poolSqrtPriceLimit returns the sqrt price limit of selling on poolPath under limit, or why the pool cannot trade under it. maxDeviationRate, in basis points of price, bounds how far the pool's price may sit on the favorable side of the limit (see isDisplacedPool); 0 disables that check. maxLimitAge, in seconds, is how old the limit may be (see isStalePriceLimit). It returns the limit, or the ineligibility code and reason.
- OID
- 0782ac…7c8d:69
poolSqrtPriceLimit details
isStalePriceLimit
func(limit *v0.PairPriceLimit, maxLimitAge int64, currentTimestamp int64) (bool, .uverse.error)isStalePriceLimit reports whether limit was set more than maxLimitAge seconds before currentTimestamp. A non-positive maxLimitAge is invalid: a stored config without the age fails closed instead of disabling the check.
- OID
- 0782ac…7c8d:70
isStalePriceLimit details
isDisplacedPool
func(currentSqrtPriceX96 *v1.Uint, sqrtPriceLimitX96 *v1.Uint, zeroForOne bool, maxDeviationRate int64) (bool, .uverse.error)isDisplacedPool reports whether the pool price sits more than maxDeviationRate, in basis points of price, on the favorable side of the swap price limit; 0 disables the check. Prices are compared through their square roots: P\_current / P\_limit > 1 + rate \<=> sqrtCurrent > sqrtLimit \* sqrt(1 + rate) when selling token0, and the reciprocal when selling token1.
- OID
- 0782ac…7c8d:71
isDisplacedPool details
parseMinOutputPerInputX128
func(value string) (*v1.Uint, .uverse.error)parseMinOutputPerInputX128 parses a decimal Q128 price limit.
- OID
- 0782ac…7c8d:72
parseMinOutputPerInputX128 details
swapDirection
func(inputToken string, outputToken string) (zeroForOne bool, token0 string, token1 string)swapDirection returns the pool direction of selling inputToken for outputToken and the pool's token order.
- OID
- 0782ac…7c8d:73
swapDirection details
swapExactIn
func(int, rlm .uverse.realm, group *v0.Group, fee uint32, sqrtPriceLimitX96 string, amountIn int64, amountOutMin int64) (int64, .uverse.error)swapExactIn sells amountIn on the pair's pool of fee tier fee, down to sqrtPriceLimitX96 (see calculateSqrtPriceLimitX96), and returns the output received by the escrow. A pool that reaches the limit before selling the whole input fails the round. The pool sends the output first, then calls the escrow's swap callback, which pays the input from the escrow without any allowance (see dca.NewSwapCallback). The pool result is checked against the escrow's balance changes: the whole input must be sold, and the output must reach amountOutMin (0 disables it).
- OID
- 0782ac…7c8d:75
swapExactIn details
calculatePayout
func(amountPerExecution int64, endAccumulatedX128 *v1.Uint, debtX128 *v1.Uint) (int64, .uverse.error)calculatePayout wraps pdca.CalculatePayout, reporting a backwards accumulator as invalid state.
- OID
- 0782ac…7c8d:76
calculatePayout details
orderPayout
typeorderPayout is one payout of an order's accrued output.
Value
v0.orderPayout
calculateOrderPayout
func(order *v0.Order, endAccumulatedX128 *v1.Uint) (v0.orderPayout, .uverse.error)calculateOrderPayout returns the payout of the output the order accrued up to endAccumulatedX128, with the order's execution fee deducted on its cumulative gross output (see pdca.CalculatePayoutExecutionFeeAmount).
- OID
- 0782ac…7c8d:78
calculateOrderPayout details
recordOrderPayout
func(order *v0.Order, payout v0.orderPayout)recordOrderPayout adds a payout to the order's lifetime claimed amount and execution fee.
- OID
- 0782ac…7c8d:79
recordOrderPayout details
calculateDebtX128AfterPayout
func(amountPerExecution int64, debtX128 *v1.Uint, payoutAmount int64) (*v1.Uint, .uverse.error)calculateDebtX128AfterPayout wraps pdca.CalculateDebtX128AfterPayout, reporting an invalid payout as invalid state.
- OID
- 0782ac…7c8d:80
calculateDebtX128AfterPayout details
getOrderEndAccumulatedOutputPerAmountX128
func(order *v0.Order, group *v0.Group) (*v1.Uint, bool, .uverse.error)getOrderEndAccumulatedOutputPerAmountX128 returns the accumulator an order is paid against, and whether all of its rounds have executed.
- OID
- 0782ac…7c8d:81
getOrderEndAccumulatedOutputPerAmountX128 details
releaseRoundMark
func(group *v0.Group, round uint64) .uverse.errorreleaseRoundMark drops one order reference from its end-round mark, removing the mark once no order references it.
- OID
- 0782ac…7c8d:82
releaseRoundMark details
feeRateMinAmount
typefeeRateMinAmount is the smallest amountPerExecution of the orders with one execution fee rate that sell in a round.
Value
v0.feeRateMinAmount
minAmountPerExecutionOf
func(minAmounts []v0.feeRateMinAmount) int64minAmountPerExecutionOf returns the smallest amountPerExecution of minAmounts, or 0 when it is empty.
- OID
- 0782ac…7c8d:83
minAmountPerExecutionOf details
maxExecutionFeeRateOf
func(minAmounts []v0.feeRateMinAmount) int64maxExecutionFeeRateOf returns the highest execution fee rate of minAmounts, or 0 when it is empty.
- OID
- 0782ac…7c8d:84
maxExecutionFeeRateOf details
calculateMinOrderAmountOut
func(minAmount v0.feeRateMinAmount, outputPerAmountX128 *v1.Uint) (int64, .uverse.error)calculateMinOrderAmountOut returns the output, net of its own execution fee rate, the order of minAmount is credited at outputPerAmountX128.
- OID
- 0782ac…7c8d:85
calculateMinOrderAmountOut details
getScheduleKey
func(group *v0.Group) string- OID
- 0782ac…7c8d:86
getScheduleKey details
validateOrderOutput
func(group *v0.Group, minAmounts []v0.feeRateMinAmount, minOrderAmountOut int64, outputPerAmountX128 *v1.Uint, executedAmountOut int64, orderAmount int64) .uverse.errorvalidateOrderOutput checks that the round credits the smallest order of each execution fee rate at least minOrderAmountOut of output net of that rate, computed as its payout is. Within one rate an order's net payout only grows with amountPerExecution, so every order of the round then receives at least that much net of its own fee.
- OID
- 0782ac…7c8d:87