ReplicatingSolver
ChangeOracle
ChangeOracle
This event is emitted when the Pragma oracle address is changed.
SetMarketParams
SetMarketParams
This event is emitted when a solver market's parameters are updated by its owner. These market parameters are used to query the relevant oracle price feed from Pragma and transform this price into (virtual) bid and ask liquidity positions, against which incoming swaps are executed.
This file contains the core logic for transforming market parameters into virtual bid and ask positions.
SetMarketParams
events should be indexed to track the active market parameters of a solver market and reconstruct the quote price for the solver market.
market_id
is the unique id of the market (seeCreateMarket
above)min_spread
is the spread, denominated in limits (1.00001 or 0.001% tick) added to the oracle price to arrive at the bid upper or ask lower pricerange
is the range, denominated in limits, of the virtual liquidity position that the swap is executed over (we apply the same calculations as Uniswap liquidity positions). The bid lower price is calculated by asbid_upper - range
, and the ask upper price is calculated asask_lower + range
max_delta
is a dynamic shift applied to the bid and ask prices in the event of a skew in the composition of the pool (e.g. if the pool is 90% ETH and 10% DAI, the price of ETH will be shifted byskew * max_delta
to incentivise swappers to move the pool back to 50/50 ratio)max_skew
is a hard cap applied to the skew of the pool, above which swaps are rejectedbase_currency_id
is the Pragma ID of the base tokenquote_currency_id
is the Pragma ID of the quote tokenmin_sources
is the minimum number of oracle sources for the oracle price to be considered valid, below which swaps are rejectedmax_age
is the maximum age of the oracle price, above which swaps are rejected
QueueMarketParams
QueueMarketParams
Market parameter updates can be delayed through a queuing mechanism to prevent malicious updates by the contract owner. A set of queued market parameters can only be set after the configured delay (see SetDelay
event below).
SetDelay
SetDelay
Sets the required delay before queued market parameters can be set.
Last updated