Pools created through the Factory are 'owned' by the factory admin (DAO). Ownership can be transferred only within the Factory contract, and this is done through the use of the commit_transfer_ownership() and accept_transfer_ownership() functions.
The appropriate value for A and gamma is dependent upon the type of coin being used within the pool, and is subject to optimisation and pool-parameter update based on the market history of the trading pair. It is possible to modify the parameters for a pool after it has been deployed. However, it requires a vote within the Curve DAO and must reach a 15% quorum.
This function is only callable by the admin of the factory contract.
Function to immediately stop ramping A and gamma parameters and set them to the current value.
Emits: StopRampA
Source code
eventStopRampA:current_A:uint256current_gamma:uint256time:uint256@externaldefstop_ramp_A_gamma():assertmsg.sender==Factory(self.factory).admin()# dev: only ownerA_gamma:uint256[2]=self._A_gamma()current_A_gamma:uint256=shift(A_gamma[0],128)current_A_gamma=bitwise_or(current_A_gamma,A_gamma[1])self.initial_A_gamma=current_A_gammaself.future_A_gamma=current_A_gammaself.initial_A_gamma_time=block.timestampself.future_A_gamma_time=block.timestamp# now (block.timestamp < t1) is always False, so we return saved AlogStopRampA(A_gamma[0],A_gamma[1],block.timestamp)
This function is only callable by the admin of the factory contract.
Function to commit new parameters. The new parameters do not take immedaite effect, they need to be applied first.
Emits: CommitNewParameters
Input
Type
Description
_new_mid_fee
uint256
new mid fee value
_new_out_fee
uint256
new out fee value
_new_admin_fee
uint256
new admin fee value
_new_fee_gamma
uint256
new fee-gamma value
_new_allowed_extra_profit
uint256
new allowed_extra_profit value
_new_adjustment_step
uint256
new adjustment_step value
_new_ma_time
uint256
new ma_time value
Source code
eventCommitNewParameters:deadline:indexed(uint256)admin_fee:uint256mid_fee:uint256out_fee:uint256fee_gamma:uint256allowed_extra_profit:uint256adjustment_step:uint256ma_half_time:uint256@externaldefcommit_new_parameters(_new_mid_fee:uint256,_new_out_fee:uint256,_new_admin_fee:uint256,_new_fee_gamma:uint256,_new_allowed_extra_profit:uint256,_new_adjustment_step:uint256,_new_ma_half_time:uint256,):assertmsg.sender==Factory(self.factory).admin()# dev: only ownerassertself.admin_actions_deadline==0# dev: active actionnew_mid_fee:uint256=_new_mid_feenew_out_fee:uint256=_new_out_feenew_admin_fee:uint256=_new_admin_feenew_fee_gamma:uint256=_new_fee_gammanew_allowed_extra_profit:uint256=_new_allowed_extra_profitnew_adjustment_step:uint256=_new_adjustment_stepnew_ma_half_time:uint256=_new_ma_half_time# Feesifnew_out_fee<MAX_FEE+1:assertnew_out_fee>MIN_FEE-1# dev: fee is out of rangeelse:new_out_fee=self.out_feeifnew_mid_fee>MAX_FEE:new_mid_fee=self.mid_feeassertnew_mid_fee<=new_out_fee# dev: mid-fee is too highifnew_admin_fee>MAX_ADMIN_FEE:new_admin_fee=self.admin_fee# AMM parametersifnew_fee_gamma<10**18:assertnew_fee_gamma>0# dev: fee_gamma out of range [1 .. 10**18]else:new_fee_gamma=self.fee_gammaifnew_allowed_extra_profit>10**18:new_allowed_extra_profit=self.allowed_extra_profitifnew_adjustment_step>10**18:new_adjustment_step=self.adjustment_step# MAifnew_ma_half_time<7*86400:assertnew_ma_half_time>0# dev: MA time should be longer than 1 secondelse:new_ma_half_time=self.ma_half_time_deadline:uint256=block.timestamp+ADMIN_ACTIONS_DELAYself.admin_actions_deadline=_deadlineself.future_admin_fee=new_admin_feeself.future_mid_fee=new_mid_feeself.future_out_fee=new_out_feeself.future_fee_gamma=new_fee_gammaself.future_allowed_extra_profit=new_allowed_extra_profitself.future_adjustment_step=new_adjustment_stepself.future_ma_half_time=new_ma_half_timelogCommitNewParameters(_deadline,new_admin_fee,new_mid_fee,new_out_fee,new_fee_gamma,new_allowed_extra_profit,new_adjustment_step,new_ma_half_time)
eventNewParameters:admin_fee:uint256mid_fee:uint256out_fee:uint256fee_gamma:uint256allowed_extra_profit:uint256adjustment_step:uint256ma_half_time:uint256@external@nonreentrant('lock')defapply_new_parameters():assertmsg.sender==Factory(self.factory).admin()# dev: only ownerassertblock.timestamp>=self.admin_actions_deadline# dev: insufficient timeassertself.admin_actions_deadline!=0# dev: no active actionself.admin_actions_deadline=0admin_fee:uint256=self.future_admin_feeifself.admin_fee!=admin_fee:self._claim_admin_fees()self.admin_fee=admin_feemid_fee:uint256=self.future_mid_feeself.mid_fee=mid_feeout_fee:uint256=self.future_out_feeself.out_fee=out_feefee_gamma:uint256=self.future_fee_gammaself.fee_gamma=fee_gammaallowed_extra_profit:uint256=self.future_allowed_extra_profitself.allowed_extra_profit=allowed_extra_profitadjustment_step:uint256=self.future_adjustment_stepself.adjustment_step=adjustment_stepma_half_time:uint256=self.future_ma_half_timeself.ma_half_time=ma_half_timelogNewParameters(admin_fee,mid_fee,out_fee,fee_gamma,allowed_extra_profit,adjustment_step,ma_half_time)
Getter for the admin actions deadline. This is the deadline after which new parameter changes can be applied. When committing new changes, there is a three-day timespan after being able to apply them (ADMIN_ACTIONS_DELAY), otherwise the call will revert.