Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cowprotocol/services
/ functions
Functions
8,522 in github.com/cowprotocol/services
⨍
Functions
8,522
◇
Types & classes
3,082
↓ 1 callers
Function
pool_address_from_id
Extract the pool address from an ID. This takes advantage that the first 20 bytes of the ID is the address of the pool. For example the GNO-BAL pool
crates/liquidity-sources/src/balancer_v2/pool_fetching/mod.rs:449
↓ 1 callers
Method
pool_by_id
Returns a pool by ID or none if no such pool exists.
crates/liquidity-sources/src/balancer_v2/pool_fetching/pool_storage.rs:106
↓ 1 callers
Function
pool_created_token_addresses
Collects the unique set of token addresses from all `PoolCreated` events emitted by `factory` in `logs`.
crates/pool-indexer/src/indexer/uniswap_v3.rs:732
↓ 1 callers
Function
pool_event_emitters
Unique emitter addresses for the per-pool events (`Initialize`/`Swap`/`Mint`/`Burn`). Feeds the DB lookup that filters out foreign emitters before `co
crates/pool-indexer/src/indexer/uniswap_v3.rs:410
↓ 1 callers
Function
pool_id
(pool: &WeightedProductOrder)
crates/driver/src/boundary/liquidity/balancer/v2/weighted.rs:63
↓ 1 callers
Function
pool_id
(pool: &StablePoolOrder)
crates/driver/src/boundary/liquidity/balancer/v2/stable.rs:59
↓ 1 callers
Method
pool_ids_for_token_pair
Returns all pools containing both tokens from `TokenPair`
crates/liquidity-sources/src/balancer_v2/pool_fetching/pool_storage.rs:80
↓ 1 callers
Method
pool_ids_for_token_pairs
Given a collection of `TokenPair`, returns all pools containing at least one of the pairs.
crates/liquidity-sources/src/balancer_v2/pool_fetching/pool_storage.rs:98
↓ 1 callers
Function
pool_state
( version: Version, info: PoolInfo, common: BoxFuture<'static, common::PoolState>, )
crates/liquidity-sources/src/balancer_v2/pools/weighted.rs:120
↓ 1 callers
Method
pools_by_id
(&self, pool_ids: HashSet<B256>, block: Block)
crates/liquidity-sources/src/balancer_v2/pool_fetching/cache.rs:59
↓ 1 callers
Method
post_interactions
(&self)
crates/driver/src/domain/competition/solution/mod.rs:234
↓ 1 callers
Method
post_process_settlement
(&self, settlement: super::SettlementEvent)
crates/autopilot/src/domain/settlement/observer.rs:82
↓ 1 callers
Method
post_processing
( &self, auction: &domain::Auction, competition_simulation_block: u64, ranking
crates/autopilot/src/run_loop.rs:468
↓ 1 callers
Function
postprocessing
Observe that postprocessing (encoding & merging) of solutions is about to start.
crates/driver/src/infra/observe/mod.rs:104
↓ 1 callers
Function
postprocessing_timed_out
(solver: &Solver, auction_id: Option<auction::Id>)
crates/driver/src/infra/notify/mod.rs:139
↓ 1 callers
Method
pre_interaction
(mut self, interaction: Interaction)
crates/driver/src/tests/setup/mod.rs:288
↓ 1 callers
Function
pre_signature_event
( ex: &mut PgTransaction<'_>, block_number: i64, owner: Address,
crates/database/src/orders.rs:1828
↓ 1 callers
Method
prepare_simulation
( &self, order: &Order, full_app_data: &str, full_balance_check: bool, )
crates/shared/src/order_creation_simulation.rs:106
↓ 1 callers
Method
prepare_state_overrides
Configures all the state overrides that are needed to mock the given trade (approval, sell_token balance, helper contract at solver address, allow lis
crates/price-estimation/src/trade_verifier.rs:498
↓ 1 callers
Method
prepare_url
(&self, cid: &str)
crates/orderbook/src/ipfs.rs:54
↓ 1 callers
Function
prepend_panic_handler
Installs a panic handler that executes [`handler`] plus whatever panic handler was already set up. This can be useful to make absolutely sure to clean
crates/observe/src/panic_hook.rs:24
↓ 1 callers
Method
price
Returns the price of a token relative to the native token. I.e., the price of the native token is 1 and the price of a token T is represented as how m
crates/shared/src/external_prices.rs:69
↓ 1 callers
Method
price_improvement
(&self, quote: &order::Quote)
crates/driver/src/domain/competition/solution/scoring.rs:279
↓ 1 callers
Method
price_improvement
( &self, quote: &domain::fee::Quote, )
crates/autopilot/src/domain/settlement/trade/math.rs:277
↓ 1 callers
Method
price_improvement_over_quote
Calculate price improvement over quote. Returns 0 if there's no improvement (instead of error).
crates/winner-selection/src/arbitrator.rs:388
↓ 1 callers
Method
price_in_buy_token_f64
The price of the estimate denominated in buy token. The resulting price is how many units of buy_token are bought for one unit of sell_token (buy_amo
crates/price-estimation/src/lib.rs:213
↓ 1 callers
Function
price_in_eth
Convert a token amount to ETH using this price. Formula: `amount * price / 10^18`
crates/winner-selection/src/primitives.rs:20
↓ 1 callers
Method
prices
The uniform price vector this settlement proposes. Deprecated: only emitted on the `/solve` response so that autopilots running the previous code can
crates/driver/src/domain/competition/solution/settlement.rs:323
↓ 1 callers
Function
probe_aave_token
Probes whether `token` is an Aave v3 aToken and returns its `(pool, underlying)` pair. Accepts the token iff the pool registers it as the aToken for i
crates/balance-overrides/src/balance/aave.rs:122
↓ 1 callers
Function
process_frame
Traverses the call stack and pushes relevant calls to `events`. Introspection of the `settle()` call gets forwarded to [`process_settle_frame`].
crates/simulator/src/report.rs:109
↓ 1 callers
Function
process_settle_frame
This function expects to get the [`CallFrame`] of the `settle()` call to be passed in. Since we are only interested in a relatively high level report
crates/simulator/src/report.rs:158
↓ 1 callers
Method
process_settle_request
( &self, auction_id: auction::Id, solution_id: u64, submission_deadline: Block
crates/driver/src/domain/competition/mod.rs:876
↓ 1 callers
Method
protocol_fee
Computed protocol fee in surplus token.
crates/driver/src/domain/competition/solution/fee.rs:89
↓ 1 callers
Method
protocol_fee
Protocol fee is defined by a fee policy attached to the order.
crates/driver/src/domain/competition/solution/scoring.rs:251
↓ 1 callers
Method
protocol_fee
Protocol fee is defined by a fee policy attached to the order.
crates/autopilot/src/domain/settlement/trade/math.rs:249
↓ 1 callers
Method
protocol_fee
Calculate a single protocol fee based on policy type.
crates/winner-selection/src/arbitrator.rs:293
↓ 1 callers
Method
protocol_fee_in_sell_token
Returns the protocol fee denominated in the sell token.
crates/driver/src/domain/competition/solution/fee.rs:203
↓ 1 callers
Method
protocol_fees
(&self)
crates/driver/src/domain/competition/solution/trade.rs:33
↓ 1 callers
Method
protocol_fees
Protocol fees are defined by fee policies attached to the order. Denominated in SURPLUS token
crates/autopilot/src/domain/settlement/trade/math.rs:146
↓ 1 callers
Method
protocol_fees
Calculate total protocol fees for an order. Returns the total fee in the surplus token.
crates/winner-selection/src/arbitrator.rs:260
↓ 1 callers
Method
provide_context
( &self, token: Address, timeout: Duration, )
crates/price-estimation/src/competition/quote.rs:135
↓ 1 callers
Method
provider
(&self)
crates/liquidity-sources/src/balancer_v2/pool_fetching/registry.rs:40
↓ 1 callers
Method
provider
(&self)
crates/cow-amm/src/registry.rs:34
↓ 1 callers
Function
publish
Enqueues the event to be sent to the event bus in a background task.
crates/observe/src/event_bus/mod.rs:168
↓ 1 callers
Function
publish_messages
Reads messages off the in-memory queue and hands the publish ack future off to [`await_acks`].
crates/observe/src/event_bus/mod.rs:108
↓ 1 callers
Method
put_app_data_document
( &self, app_data: Option<AppDataHash>, document: AppDataDocument, )
crates/e2e/src/setup/services.rs:720
↓ 1 callers
Function
query_order_refund_status
Queries on-chain refund status for a single order. Returns `None` if the status query fails. Marks orders as `Invalid` if the owner cannot receive ET
crates/refunder/src/refund_service.rs:48
↓ 1 callers
Method
query_without_retry
( &self, query: &str, variables: &Option<Map<String, Value>>, )
crates/liquidity-sources/src/subgraph.rs:69
↓ 1 callers
Method
quote
Generate a quote for this order. This calls `/solve` on the solver with a "fake" auction which contains a single order, and then determines the quote
crates/driver/src/domain/quote.rs:128
↓ 1 callers
Method
quote
Quote an order using a UniswapV2 pool unless it already has concrete amounts. This determines the buy and sell amount of the order in the auction.
crates/driver/src/tests/setup/blockchain.rs:677
↓ 1 callers
Method
quoteExactInputSingle
( data: &[u8], )
contracts/generated/contracts-generated/uniswapv3quoterv2/src/lib.rs:2300
↓ 1 callers
Method
quoteExactOutputSingle
( data: &[u8], )
contracts/generated/contracts-generated/uniswapv3quoterv2/src/lib.rs:2281
↓ 1 callers
Function
quote_req
Create a request for the driver /quote endpoint.
crates/driver/src/tests/setup/driver.rs:180
↓ 1 callers
Method
quote_tx_origin
(&self)
crates/driver/src/infra/solver/mod.rs:334
↓ 1 callers
Method
quote_using_limit_orders
Use limit orders for quoting instead of market orders
crates/driver/src/infra/solver/mod.rs:322
↓ 1 callers
Function
quoted
Observe the result of quoting an auction.
crates/driver/src/infra/observe/mod.rs:284
↓ 1 callers
Function
quoting
Observe that the quoting process is about to start.
crates/driver/src/infra/observe/mod.rs:431
↓ 1 callers
Function
rate_limited
( rate_limiter: Arc<RateLimiter>, estimation: impl Future<Output = Result<T, PriceEstimationError>>, )
crates/price-estimation/src/lib.rs:235
↓ 1 callers
Method
rate_limiter
(&self, name: &str)
crates/price-estimation/src/factory.rs:160
↓ 1 callers
Function
ray_div
Ray-division: `(a * RAY + b/2) / b`, round-half-up. Matches Aave's `WadRayMath.rayDiv` bit-for-bit so the scaled amount we write into storage equals t
crates/balance-overrides/src/balance/aave.rs:99
↓ 1 callers
Function
read_by_auction_ids
( ex: &mut PgConnection, auction_ids: &[AuctionId], )
crates/database/src/settlement_executions.rs:79
↓ 1 callers
Function
read_by_order_uid
( ex: &mut PgConnection, order_uid: &OrderUid, )
crates/database/src/order_execution.rs:64
↓ 1 callers
Function
read_line
(socket: &mut UnixStream)
crates/observe/src/heap_dump_handler.rs:243
↓ 1 callers
Function
read_line
(socket: &mut UnixStream)
crates/observe/src/tracing/reload_handler.rs:99
↓ 1 callers
Function
read_order
( ex: &mut PgConnection, uid: &OrderUid, )
crates/database/src/jit_orders.rs:184
↓ 1 callers
Method
read_state
(&self, pair: TokenPair, block: BlockId)
crates/liquidity-sources/src/uniswap_v2/pool_fetching.rs:48
↓ 1 callers
Method
read_watermark
Read persisted watermark for resuming after reconnect.
crates/solana-indexer/src/persistence.rs:39
↓ 1 callers
Method
receiver
(&self)
crates/driver/src/domain/competition/solution/trade.rs:102
↓ 1 callers
Method
receiver
The address which will receive the output of this order. If a custom receiver address was specified by the user explicitly, return that address. Other
crates/driver/src/domain/competition/order/mod.rs:161
↓ 1 callers
Method
record_into_liquidity
Turns 0x OrderRecord into liquidity which solvers can use.
crates/solver/src/liquidity/zeroex.rs:57
↓ 1 callers
Function
recover_jit_order_owner
Recovers the owner and signature from a `JitOrder`.
crates/price-estimation/src/trade_verifier.rs:877
↓ 1 callers
Method
reduce_next_try
Adjusts the next fill amount that should be tried. Always halves the last tried amount.
crates/solvers/src/domain/solver/dex/fills.rs:140
↓ 1 callers
Function
reference_scores
( ex: &mut PgConnection, auction_id: i64, )
crates/e2e/tests/e2e/database.rs:60
↓ 1 callers
Method
refresh
`None` (existing entry preserved) when `fetch_all` is uncertain — no positive confirmation and at least one backend failed.
crates/order-validation/src/banned/cached.rs:135
↓ 1 callers
Method
regular_swap_given_in
Comes from `_onRegularSwap(true, ...)`: https://etherscan.io/address/0xf9ac7B9dF2b3454E841110CcE5550bD5AC6f875F#code#F2#L270
crates/liquidity-sources/src/balancer_v2/swap/mod.rs:224
↓ 1 callers
Method
regular_swap_given_out
Comes from `_onRegularSwap(false, ...)`: https://etherscan.io/address/0xf9ac7B9dF2b3454E841110CcE5550bD5AC6f875F#code#F2#L270
crates/liquidity-sources/src/balancer_v2/swap/mod.rs:252
↓ 1 callers
Method
relative
Returns the minimum surplus for the specified token amount.
crates/solvers/src/domain/dex/minimum_surplus.rs:30
↓ 1 callers
Method
release
Releases the leader lock if it was held Should be called after breaking out of run loop (for example: due to shutdown)
crates/autopilot/src/leader_lock_tracker.rs:67
↓ 1 callers
Method
relevant_pairs
All pool token pairs that could be used along a path candidate for these token pairs.
crates/liquidity-sources/src/base_tokens.rs:37
↓ 1 callers
Method
remaining_maker_amount
Scales the `maker_amount` according to how much of the partially fillable amount was already used.
crates/liquidity-sources/src/zeroex.rs:223
↓ 1 callers
Method
remaining_stages
(&self)
crates/price-estimation/src/competition/mod.rs:204
↓ 1 callers
Method
removeSolver
( data: &[u8], )
contracts/generated/contracts-generated/gpv2allowlistauthentication/src/lib.rs:1512
↓ 1 callers
Method
remove_amms
(&self, amm_addresses: &[Address])
crates/cow-amm/src/cache.rs:101
↓ 1 callers
Method
remove_cached_blocks_older_than
(&mut self, oldest_to_keep: u64)
crates/liquidity-sources/src/recent_block_cache.rs:440
↓ 1 callers
Method
replace_current_auction
( &self, new_auction_id: dto::AuctionId, new_auction_data: dto::RawAuctionData, )
crates/autopilot/src/database/auction.rs:116
↓ 1 callers
Method
replace_current_auction_in_db
Spawns a background task that replaces the current auction in the DB with the new one.
crates/autopilot/src/infra/persistence/mod.rs:156
↓ 1 callers
Function
replace_events
( transaction: &mut PgTransaction<'_>, events: Vec<(GPv2SettlementEvents, Log)>, from_block: u64,
crates/autopilot/src/database/events.rs:95
↓ 1 callers
Method
replace_order
Replaces the `old_order` with `validated_new_order` in the database (cancels the old one and inserts the new one), but not before performing some vali
crates/orderbook/src/orderbook.rs:442
↓ 1 callers
Method
request
( &self, url: Url, set_current_block_header: bool, )
crates/liquidity-sources/src/zeroex.rs:415
↓ 1 callers
Function
request_sent
()
crates/solvers/src/infra/metrics.rs:52
↓ 1 callers
Method
requests_for_order
(&self, order: &Order)
crates/solvers/src/domain/solver/baseline.rs:278
↓ 1 callers
Method
required_balance
The balance required to ensure settlement execution with the given gas parameters.
crates/driver/src/domain/competition/solution/settlement.rs:433
↓ 1 callers
Function
requires_cancellation
Whether a submitted settlement whose receipt is missing should be cancelled. We cancel only when the re-simulation reverts and the signer's pending no
crates/driver/src/domain/mempools.rs:671
↓ 1 callers
Method
requires_setup
A signature check requires setup when there are interactions to be taken into account or when the balance override is set. Interactions require setup
crates/signature-validator/src/lib.rs:53
↓ 1 callers
Method
reserves_without_bpt
This method returns an iterator over the stable pool reserves while filtering out the BPT token for the pool (i.e. the pool address). This is used bec
crates/liquidity-sources/src/balancer_v2/swap/mod.rs:183
↓ 1 callers
Method
reset_requests_complete
(&self, method: &str, path: &str)
crates/orderbook/src/api.rs:394
↓ 1 callers
Method
reset_requests_rejected
(&self)
crates/orderbook/src/api.rs:386
↓ 1 callers
Method
resimulate_until_revert
Re-simulate all proposed solutions on every new block and drop any that start reverting. Returns once every solution has reverted; otherwise runs fore
crates/driver/src/domain/competition/mod.rs:539
↓ 1 callers
Method
resolve_protocol_instruction
Resolve the program against `account_keys`, keeping the instruction only if that program is the settlement or SolFlow program. The `accounts` field ke
crates/solana-indexer/src/indexer/decoder.rs:151
↓ 1 callers
Function
response_body_with_size_limit
Extracts the bytes of the response up to some size limit. Returns an error if the byte limit was exceeded.
crates/autopilot/src/infra/solvers/mod.rs:154
← previous
next →
2,301–2,400 of 8,522, ranked by callers