SID

SID - A unique identifier which includes the following data:

  • Type of synthetic token

  • Native chain id

  • ProtocolId - The protocol is given a unique number recorded in MasterChef. This is because multiple protocols can be combined under one MasterChef on the same network, so each protocol needs its own distinct identifier.

  • PoolId - Multiple pools can be part of a single protocol on one network, with each pool having its own unique number.

Let's see by example how to work with our SID:

SID: 0x388000000100000000

Breakdown:

  • Chain ID: First 64 bits

  • Protocol ID: Next 32 bits

  • Pool ID: Last 32 bits

Calculations:

  • Chain ID Calculation:

    • uint64 chainId = (SID & (uint128(maxUint64) << 64)) >> 64;

    • chainId = 0x3880000000000000 >> 64;

    • chainId = 0x38; (in hexadecimal notation)

    • Corresponds to 56 in decimal notation, which represents the Binance Smart Chain.

  • Protocol ID Calculation:

    • uint32 protocolId = (SID & (uint128(maxUint32) << 32)) >> 32;

    • protocolId = 0x80000001; (in hexadecimal notation)

    • Corresponds to 2147483649 in decimal notation.

Summary:

  • Chain ID: 0x38 (or 56 in decimal notation)

  • Protocol ID: 0x80000001 (or 2147483649 in decimal notation)

  • Pool ID: 0

The leading unit in the Protocol ID indicates that this SID is an OnlyLpStakingSid. This structure enables easy identification and future extensions for protocols.

We have our own library that will allow developers to not have to read all this data manually. The library can be found in the attachments section.

Last updated