ILeo

Git Source

Inherits: ILeoEvents

Functions

vestPosition

vest a position that the caller owns.

function vestPosition(address pool, uint256 id) external;

Parameters

NameTypeDescription
pooladdressto take the position from
iduint256of the position to take

createCampaign

create a campaign with the parameters given.

takes extraMax from the user of the token given

function createCampaign(
    bytes8 campaignId,
    address pool,
    int32 tickLower,
    int32 tickUpper,
    uint64 perSecond,
    address token,
    uint256 extraMax,
    uint64 starting,
    uint64 ending
) external;

Parameters

NameTypeDescription
campaignIdbytes8to modify for the pool given
pooladdressto reward positions that participate in with
tickLowerint32to reward positions in this range with
tickUpperint32to reward positions in this range with
perSeconduint64distribution to send
tokenaddressto give out
extraMaxuint256to start the pool amount with for this pool
startinguint64to when to start the token distribution with
endinguint64for when to stop the token distribution

updateCampaign

create a campaign with the parameters given.

takes extraMax from the user of the token given

function updateCampaign(
    bytes8 campaignId,
    address pool,
    int32 tickLower,
    int32 tickUpper,
    uint64 perSecond,
    address token,
    uint256 extraMax,
    uint64 starting,
    uint64 ending
) external;

Parameters

NameTypeDescription
campaignIdbytes8to modify for the pool given
pooladdressto reward positions that participate in with
tickLowerint32to reward positions in this range with
tickUpperint32to reward positions in this range with
perSeconduint64distribution to send
tokenaddressto give out
extraMaxuint256to start the pool amount with for this pool
startinguint64to when to start the token distribution with
endinguint64for when to stop the token distribution

campaignRevisions

the amount of times this campaign was modified for the pool

function campaignRevisions(address pool, bytes8 campaignId) external view returns (uint256);

Parameters

NameTypeDescription
pooladdressto check the campaign for
campaignIdbytes8to check revisions for

Returns

NameTypeDescription
<none>uint256the amount of times the campaign was modified

cancelCampaign

cancel an ongoing campaign by amending it to have 0

only usable by the admin of the pool

function cancelCampaign(address pool, bytes8 campaignId) external;

Parameters

NameTypeDescription
pooladdressto modify the campaign for
campaignIdbytes8to modify

campaignDetails

details of a campaign

function campaignDetails(address pool, bytes8 campaignId)
    external
    view
    returns (
        int32 tickLower,
        int32 tickUpper,
        uint64 perSecond,
        address token,
        uint256 distributed,
        uint256 maximum,
        uint64 startingTimestamp,
        uint64 endingTimestamp
    );

Parameters

NameTypeDescription
pooladdressthis campaign is for
campaignIdbytes8to identify this campaign

poolLp

pool LP tokens vested to Leo for this pool

function poolLp(address pool) external returns (uint256 lp);

Parameters

NameTypeDescription
pooladdressto check

Returns

NameTypeDescription
lpuint256tokens to return

collect

collect rewards for a position vested in a pool with the campaigns given

function collect(PositionDetails[] memory positionDetails, bytes8[] memory campaignIds)
    external
    returns (PoolRewards[] memory poolRewards, CampaignRewards[] memory campaignRewards);

Parameters

NameTypeDescription
positionDetailsPositionDetails[]to check
campaignIdsbytes8[]to check

divestPosition

divest a position, returning the position ID to the user

function divestPosition(address pool, uint256 positionId) external;

Parameters

NameTypeDescription
pooladdressto check
positionIduint256to check

Structs

PositionDetails

struct PositionDetails {
    address token;
    uint256 id;
}

PoolRewards

struct PoolRewards {
    address pool;
    uint128 amount0Lp;
    uint128 amount1Lp;
}

CampaignRewards

struct CampaignRewards {
    address campaignToken;
    uint256 rewards;
}