> For the complete documentation index, see [llms.txt](https://smartscenarios.pirichain.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smartscenarios.pirichain.com/psce-functions/examples/a-sample-about-token-vesting.md).

# A sample about token vesting

In this Smart Scenario; It is divided into equal periods of 10 months  (Per month 2.1 Million PIRI). The asset is coded so that it can only be claimed once a month.

***Who will send those PIRIs?***&#x20;

*<mark style="color:purple;">Relavent PSce will send PIRI though its own balance. This PSce must be have 21 Millions of PIRI for complete properly end of 10 months.</mark>*

***How can manage the my PSce balance?***&#x20;

*<mark style="color:purple;">Though your code explained</mark>* [*<mark style="color:purple;">here.</mark>*](/psce-functions/examples/advanced-operation-withdraw-all-your-asset-from-pcse.md)

```javascript
const InvestorAddress='PRTMRKWZ56v4D8mV1oj813bqTgdfUm9J4woVTDMpGxF';

    const totalAmount=43_333; // for only testing.
    const cliffDate={};
    cliffDate["_2024"]=totalAmount*0.05; // Pay %5 on 2024 
    cliffDate["_2025"]=totalAmount*0.2; // Pay %25 on 2025
    cliffDate["_2026"]=totalAmount*0.75; // Pay %75 in 2026

async function withdraw(amount)
{
    if (EXECUTER_ADDRESS!==InvestorAddress)
    {
        return {error:1,data:'This PSce doesnt belong to you!'};
    }

    if (isNaN(amount))
            return {error:1,data:'Amount is not true format!'};

    if (parseFloat(amount)<=0)
            return {error:1,data:'Amount must be positive number!'};

    if (parseFloat(amount)>totalAmount)
            return {error:1,data:'Amount must be lower than total amount'};
    if (PSDATA==undefined) PSDATA={};

    if (PSDATA["withDraw"+new Date().getFullYear().toString()]==undefined)
        PSDATA["withDraw"+new Date().getFullYear().toString()]=0;
            if (PSDATA["withDraw"+new Date().getFullYear().toString()]+amount<=cliffDate["_"+new Date().getFullYear()])
            {
                PSDATA["takenDate_"+new Date().toString()]=amount;
                PSDATA["withDraw"+new Date().getFullYear().toString()]+=amount;
                await Map.saveMap(JSON.stringify(PSDATA));
                return await Transaction.sendPIRI(InvestorAddress,amount);

            }
            else
            {
                return {error:1,data:'You wont take this amount because of exceed to cliff limit!' };
            }
}
```
