invest_liquidity
An entrypoint for liquidity investment in the specific liquidity pool (pair). Also it votes for the users' bakers in case of liquidity investment to TOK/TEZ pools.
Call parameters
Field | Type | Description |
---|---|---|
pair_id | token_id_t (nat) | Identifier of the liquidity pool (pair) |
token_a_in | nat | Max amount of token A allowed to be spent |
token_b_in | nat | Max amount of token B allowed to be spent |
shares | nat | Amount of LP tokens to be acquired |
shares_receiver | address | Receiver of LP tokens |
candidate | key_hash | Baker for voting (is used only in time of investment to TOK/TEZ exchanges) |
deadline | timestamp | The time until which the transaction remains valid and will not be rejected |
Usage
Note: you need to pass positive TEZ/mutez amount to the send() method in case of FA1.2/TEZ or FA2/TEZ liquidity investment (see example below).
Also don't forget to add the DexCore contract as the operator for your FA2 tokens or make an approve for spending of FA1.2 tokens in time of liquidity investment.
Pass candidate: "tz1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZNkiRg"
in case of TOK/TOK exchange
Errors
108
- pair (pool) with the specifiedtoken_id
not listed.109
- pair doesn't have a liquidity.110
- zero amount of LP tokens (shares) expected.111
- low token A amount in.112
- low token B amount in.136
- reentrancy.141
- wrong amount of TEZ tokens were attached to transaction.144
- action outdated (the time until which the transaction remained valid was passed).412
- non payable entrypoint (can't accept TEZ tokens during call of an entrypoint). Only in case of investment to TOK/TOK liquidity pools (pairs).
Last updated