NativePool
Native AMM or PMM Pool
Functions
getAmountIn
Call the Registry contract to get the amount of output token based on input amount
Name | Type | Description |
---|---|---|
| uint256 | Amount of output token |
| address | Input token |
| address | Output token |
getAmountOut
Call the Registry contract to get the amount of input token based on output amount
Name | Type | Description |
---|---|---|
| uint256 | Amount of input token |
| address | Input token |
| address | Output token |
pairExists
Check if the pair exists
Name | Type | Description |
---|---|---|
| address | The token address of one side of the pair |
| address | The token address of the other side of the pair |
getPairFee
Get fees for the given pair config
Name | Type | Description |
---|---|---|
| address | The token address of one side of the pair |
| address | The token address of the other side of the pair |
updatePairs
Update the pairs of this pool. In the form of array to update multiple pairs
Native V1 only supports 1 pair for each Pool. Will support multiple pairs soon.
Name | Type | Description |
---|---|---|
| uint256[] | Swap fee of the pair |
| address[] | The token address of one side of the pair |
| address[] | The token address of the other side of the pair |
| uint256[] | Pricing model ID this pair is using |
removePair
Remove the pair by specifying the token
Name | Type | Description |
---|---|---|
| address | The token address of one side of the pair |
| address | The token address of the other side of the pair |
swap
It can only be called by the Router contract.
Verify signature, order not expired, valid nonce, pair is whitelisted, valid amount input
Get firm quote based on pricing ID
Actually execute the swap and transfer the funds between user, Router, Pool and Treasury
Name | Type | Description |
---|---|---|
| bytes | Contains the data in an order. Including signer, buyer/seller address, expected deadline, buy/sell token/amount, etc. |
| bytes | Signature generated by the signer |
| int256 | The |
| address | Fund recipient of the swap (could be Router for multi-hop swaps) |
| bytes | Callback data after at the end of the swap |
setRouter
Set the router address allowed to call the swap function
Name | Type | Description |
---|---|---|
| address | The router address |
addSigner
Whitelist new signer for the Pool
Name | Type | Description |
---|---|---|
| address | The signer address |
removeSigner
Remove existing signer from the whitelist
Name | Type | Description |
---|---|---|
| address | The signer address |
getNonce
Get the nonce for the specific seller
Name | Type | Description |
---|---|---|
| address | The seller address |
increaseNonce
Increase the nonce by 1 for the specific seller
Name | Type | Description |
---|---|---|
| address | The seller address |
Last updated