# Locking $SLING

Locking $SLING is at the heart of the Slingshot ecosystem. It can be done easily within the [Slingshot dApp](https://app.slingshotdao.com).

{% embed url="<https://app.slingshotdao.com>" %}

## Simple version

To interact with the ecosystem, users need power, which they get in return for locking their $SLING.

In it's most simple terms, a users power is determined by:

1. How much $SLING they have locked
2. How long they have locked it for

The more $SLING a user locks and the longer they lock it for, the more power they get.

As time goes on, a users lock duration becomes smaller (i.e. 30 days -> 15 days -> 5 days -> unlocked). Because of this, Power also becomes smaller over time before it eventually reaches 0.

## Detailed version

Slingshot uses a Voting Escrow smart contract to permisionlessly manage the locking of $SLING. All of the locked tokens and the resulting power balances are held within the smart contract.

1. A user can only have one lock at a time (per wallet).\
   &#x20;
2. The minimum lock duration is 30 days.\
   &#x20;
3. The maximum lock duration is 4 years.\
   &#x20;
4. A user receives more power linearly as the lock duration increases. \
   For example:
   1. 100 $SLING locked for 1 year = 25 Power
   2. 100 $SLING locked for 2 years = 50 Power
   3. 100 $SLING locked for 4 years = 100 Power\
      &#x20;
5. Power decays in realtime. Power is constantly recalculated based on the lock duration (which is decreasing every second). \
   \
   Because a users Power is a function of their lock duration (which is decreasing every second) a users Power also decreases every second.\
   &#x20;
6. Users can extend their lock duration (up to 4 years) at any time. \
   \
   This is an effective way to maintain Power which is otherwise slowly decaying (see point 5).\
   &#x20;
7. Users can add more $SLING to their lock at any time.\
   &#x20;
8. Users can only withdraw their locked $SLING once the lock duration expires.\
   \
   It is not possible to partially withdraw $SLING from a lock.

## The calculation

The Power calculation for the Voting Escrow contract is as follows:

(tokenAmount / 126144000) \* (⌊unlockTimestamp / 604800⌋ \* 604800 — currentTimestamp)

* tokenAmount: *The number of $SLING locked in the contract*.
* 126144000: *Represents 4 years in seconds (4 x 365 x 24 x 60 x 60).*
* unlockTimestamp: *The Unix timestamp when the locked $SLING will be unlocked.*
* 604800: *Represents 1 week in seconds (7 x 24 x 60 x 60)*.
* currentTimestamp: *The current Unix timestamp at the time of calculation.*

## Audits

Slingshots smart contracts have been audited, including the Voting Escrow contract discussed above. You can read more about security audits here.

{% content-ref url="../tokenomics/security-audit" %}
[security-audit](https://docs.slingshotdao.com/slingshot-dao/tokenomics/security-audit)
{% endcontent-ref %}
