Swap Core V2
Contract info
Contract name: pancake::swap Contract address: c7efb4076dbe143cbcd98cfaaa929ecfc8f299203dfff63b95ccb6bfe19850fa::swap
Admin Multi Sig: b11ccaed0056a75472539c2b0d9511c82fc6a36622bec7578216af5fe550dd0d
Types
Name | Type | Description |
---|---|---|
X |
| The coin type address of token X in the pair. |
Y |
| The coin type address of token Y in the pair. |
Resources
LPToken
The liquidity token corresponds to each pool XY.
TokenPairMetadata
The metadata of pool XY.
Name | Type | Description |
---|---|---|
creator |
| The creator address of pool. |
fee_amount |
| The total LP token collected from all the swaps in the pool. |
k_last |
| The multiply of reserve_x and reserve_y in the pool from the last swap. |
balance_x |
| The total amount of token X in the pool. |
balance_y |
| The total amount of token Y in the pool. |
mint_cap |
| The mint capability created when the LP is created. |
burn_cap |
| The burn capability created when the LP is created. |
freeze_cap | coin::FreezeCapability | The freeze capability created when the LP is created. |
TokenPairReserve
The tokens reserves of pool XY.
Name | Type | Description |
---|---|---|
reserve_x |
| The total amount of token X in the pool. |
reserve_y |
| The total amount of token Y in the pool. |
block_timstamp_last |
| The timestamp when reserves get updated. |
SwapInfo
The metadata of the module
Name | Type | Description |
---|---|---|
signer_cap |
| The signer capability created when the module is deployed. |
fee_to |
| The address that the fee will be sent to. |
admin |
| The admin address of the module |
pair_created |
| The event emit when the pool is created. |
Public Functions
Register LP
Register the LP token to the account.
Input Values
Name | Type | Description |
---|---|---|
sender |
| The sender's signer when calling the function. |
Is Paired Created
Check if the pool XY is created or not.
Return Values
Type | Description |
---|---|
bool | Whether the pool is created or not. |
LP Balance
Check LP balance of user.
Input Values
Name | Type | Description |
---|---|---|
addr |
| The user address. |
Return Values
Type | Description |
---|---|
| The amount of LP user own. |
Total LP Supply
The total amount of LP exist created from pool XY.
Return Values
Type | Description |
---|---|
| The total supply of LP tokens. |
Token Reserve
The token reserves of the pool XY.
Return Values
Position | Type | Description |
---|---|---|
0 |
| The total amount of token X in the pool. |
1 |
| The total amount of token Y in the pool. |
2 |
| The timestamp when reserves get updated. |
Token Balance
The token balance of the pool XY.
Return Values
Position | Type | |
---|---|---|
0 |
| The total amount of token X in the pool. |
1 |
| The total amount of token Y in the pool. |
Last updated