SWP Data-Tables

SWP-Pair Global Properties

The global configuration for the SWP-Pair infrastructure is stored in the SWP|Properties table, defined within the SWP module and structured according to the {SWP|PropertiesSchema}.

This table maintains four key global properties that govern the behaviour of the SWP-Pair architecture:

  1. principals:[string] – A list of DPTF tokens designated as Principal Tokens for SWP-Pair issuance.

    • For SWP-Pair Types W or P, the first token must be a Principal Token (ownership is not enforced at issuance).

    • For SWP-Pair Type S, the first token must already be part of an existing W or P-type SWP-Pair before it can be used in an S-type issuance.

  2. liquid-boost:bool – A global toggle that, when set to true, enables automatic boosting of the KadenaLiquidIndex.

    • This boost occurs by burning an amount of LKDA equal to the liquidity provider fee set during SWP-Pair creation, increasing the index value with each swap.

  3. spawn-limit:decimal – The minimum amount of KDA liquidity required to create a new non-principal SWP-Pair (Liquidity Pool).

    • Initially set to 1000 KDA.

  4. inactive-limit: decimal – The minimum KDA liquidity required for swaps to remain active in a non-principal SWP-Pair.

    • If liquidity falls below this limit, swaps are automatically disabled.

    • To re-enable swaps, the pool’s liquidity must be replenished above this threshold.

SWP-Pair Individual Properties

Each individual SWP-Pair’s configuration is stored in the SWP|Pair table, defined in the SWP module and structured according to the {SWP|PairSchema}. This schema defines 18 distinct properties for managing and operating SWP-Pairs:

  1. owner-konto:string – The standard or smart Ouronet account that owns the SWP-Pair, referred to as the SWP-Pair Manager (SWPPM).

    • Ownership must be verified for any operation related to this SWP-Pair.

  2. can-change-owner:bool – Indicates whether the SWP-Pair Manager can be changed.

  3. can-add:bool – Determines if liquidity can be added or removed.

    • If set to <false>, liquidity operations are disabled.

  4. can-swap:bool – Determines if swapping is enabled.

    • If set to <false>, swaps are disabled.

    • This property will automatically switch to <false> if liquidity falls below the global <inactive-limit>.

  5. genesis-weights:[decimal] – The initial weight distribution of tokens when the SWP-Pair was created.

  6. weights:[decimal] – The current weight distribution used in the SWP-Pair's operations.

  7. genesis-ratio:[object{Swapper.PoolTokens}] – The initial token amounts issued at the time of SWP-Pair creation.

  8. pool-tokens:[object{Swapper.PoolTokens}] – The current token balances held by the SWP-Pair.

  9. token-lp:string – The identifier of the native DPTF LP Token associated with this SWP-Pair.

  10. fee-lp:decimal – The portion of the swap fee (in promile) allocated to increase LP token value, benefiting liquidity providers.

  11. fee-special:decimal – The portion of the swap fee (in promiles) allocated to external accounts.

  12. fee-special-targets:[object{Swapper.FeeSplit}] – Specifies the target Ouronet accounts and their respective shares for distributing the <fee-special>.

  13. fee-lock:bool – Indicates whether the SWP-Pair’s fee structure is locked. Once a proper fee structure is set, it can be locked in place. If <true>, the fee parameters cannot be changed unless unlocked.

  14. unlocks:integer – The number of times the <fee-lock> has been unlocked for this SWP-Pair.

  15. amplifier:decimal – Represents the amplifier value, relevant only for S-Type SWP-Pairs, used in the computation of the swap amounts. The Amplifier or Amplification Coefficient decides how “curved” the line is for a Stable Swap Pool, the higher the A, the less curved the line is and the less the relative price movement impact.

  16. primality:bool – Indicates whether the SWP-Pair is marked as primal.

  17. frozen-lp:bool – Specifies whether Frozen LP mode is enabled.

    • When set to <true> (immutable), the SWP-Pair can accept Frozen Tokens for liquidity and can generate Frozen LP from native LP.

  18. sleeping-lp:bool – Specifies whether Sleeping LP mode is enabled.

    • When set to <true> (immutable), the SWP-Pair can accept Sleeping Tokens and can generate Sleeping LP from native LP.

SWP-Pair Pool Data

Data for all existing SWP-Pairs is stored in the SWP|Pools table, defined within the SWP module and structured according to the {SWP|PoolsSchema}.

This table includes the following key:

  1. pool:[string] – Stores all active SWP-Pair data, organized by type and token count.

    • Each entry is labelled using a prefix that indicates the SWP-Pair type:

      • P: Represents W- or P-Type SWP-Pairs.

      • S: Represents S-type SWP-Pairs.

    • The prefix is followed by a number indicating the number of tokens in the pair.

      • For example:

        • P2 stores all W and P-type SWP-Pairs that contain 2 tokens.

        • S3 stores all S-type SWP-Pairs that contain 3 tokens.

    This structure facilitates efficient management and traceability of tokens across all existing pools.

Last updated