Acala icon indicating copy to clipboard operation
Acala copied to clipboard

honzon-distribution pallet

Open xlc opened this issue 3 years ago • 0 comments

  • Types
    • enum DistributionDestination
      • StableAsset { poolId: StableAssetPoolId }
    • struct DistributionParams
      • cap: Balance
      • maxStep: Balance
      • targetMin: Ratio
      • targetMax: Ratio
  • Config
    • type UpdateOrigin: EnsureOrigin
    • type AdjustPeriod: Get<(BlockNumber, BlockNumber)>
  • Storages
    • Params: map DistrubutionDestination => DistributionParams
    • Amount: map DistrubutionDestination => Balance
  • Calls
    • fn update_params(origin, params: Option<DistributionParams>)
      • ensure UpdateOrigin
    • fn force_adjust(origin, dest: DistributionDestination)
      • ensure UpdateOrigin
      • apply distrubution adjustment
  • Pallet
    • fn on_initialize
      • if now % AdjustPeriod.0 == AdjustPeriod.1
        • for (dest, params) in Params
          • Check dest value
          • if lower than min target
            • Mint & add liqudiity
          • if higher than max target
            • Withdraw liquidity and burn

xlc avatar Jul 08 '22 03:07 xlc