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