Registry
To manage pricers
Functions
registerPricer
Register a new pricer to registry.
Only owner of registry can register new pricer. Each id can only be assigned to one pricer, and assigned once, no modification.
parameters:
id
uint256
Pricer id to assign
addr
address
Pricer contract address
getAmountOut
Calculate amount of output token, given amount of input token, fee ratio, pricer id, treasury address, and address of input and output token.
parameters:
amountIn
uint256
Amount of input token
fee
uint256
Fee ratio, in basis point. e.g. 100 means 1% fee
id
unit256
Pricer whose logic would be applied for computation
treasury
address
Treasury address where to read asset balance from, as input of computation
tokenIn
address
Input token
tokenOut
address
Output token
getAmountIn
Calculate amount of input token, given amount of output token, fee ratio, pricer id, treasury address, and address of input and output token.
parameters:
amountOut
uint256
Amount of output token
fee
uint256
Fee ratio, in basis point. e.g. 100 means 1% fee
id
unit256
Pricer whose logic would be applied for computation
treasury
address
Treasury address where to read asset balance from, as input of computation
tokenIn
address
Input token
tokenOut
address
Output token
Last updated