deposit

An entrypoint that deposits (stakes) tokens. In time of every deposit it claims user's rewards if timelock is finished (only for farms with timelock) or in farms without timelock it just claims user's rewards. In the case of claiming, rewards are transferred to the user and to the referrer (harvest_fee). Also setups a referrer for a user, votes for a user's baker if the QuipuSwap V1 TOK/TEZ LP token is deposited (staked).

Call parameters

type deposit_type       is [@layout:comb] record [
  fid                     : fid_type;
  amt                     : nat;
  referrer                : option(address);
  rewards_receiver        : address;
  candidate               : option(key_hash);
]
FieldTypeDescription

fid

fid_type (nat)

Farm's ID

amt

nat

Amount of tokens to deposit

referrer

option(address)

User's referrer

rewards_receiver

address

Receiver of earned tokens

candidate

option(key_hash)

The baker for voting (only for QuipuSwap V1 TOK/TEZ LP staked tokens)

Usage

const tFarmAddress = "KT1...";
const params = {
    fid: 1,
    amt: 100,
    referrer: "tz1.../KT1...", // or null
    rewards_receiver: "tz1.../KT1...",
    candidate: "tz1...", // or null
};
const tFarm = await tezos.contract.at(tFarmAddress);
const operation = await tFarm.methodsObject.deposit(params).send();

await operation.confirmation();

Errors

  • QSystem/farm-not-set - farming with fid parameter doesn't exist.

  • TFarm/farm-is-paused - farm is paused by an administrator.

  • TFarm/can-not-refer-yourself - user is trying to refer himself.

  • TFarm/baker-is-required - baker parameter is required (not optional) for QuipuSwap V1 TOK/TEZ LP staked tokens.

  • TFarm/baker-is-banned - baker from the parameters is banned by an administrator.

Last updated