Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 source realm

package v1 collects and distributes protocol fees from swaps.

Readme View source

Protocol Fee

Fee collection and distribution for protocol operations.

Overview

Protocol Fee contract collects fees from various protocol operations and distributes them to xGNS holders and DevOps.

Configuration

  • Router Fee: 0.15% of swap amount
  • Pool Creation Fee: 100 GNS
  • Withdrawal Fee: 1% of LP fees claimed
  • Unstaking Fee: 1% of staking rewards
  • Distribution: 100% to xGNS holders (default)

Fee Sources

  1. Swaps: 0.15% fee on all trades
  2. Pool Creation: 100 GNS per new pool
  3. LP Withdrawals: 1% of collected fees
  4. Staking Claims: 1% of rewards

Key Functions

DistributeProtocolFee

Distributes accumulated fees to recipients.

SetDevOpsPct

Sets DevOps funding percentage.

SetGovStakerPct

Sets xGNS holder percentage.

AddToProtocolFee

Adds fees to distribution queue.

Usage

1// Distribute accumulated fees
2tokenAmounts := DistributeProtocolFee()
3
4// Configure distribution
5SetDevOpsPct(2000)     // 20% to DevOps
6SetGovStakerPct(8000)  // 80% to xGNS holders
7
8// View tokens reserved for the next distribution
9GetReservedTokens()

Security

  • Admin-only configuration changes
  • Automatic fee accumulation
  • Multi-token support
  • Transparent distribution tracking

Overview

package v1 collects and distributes protocol fees from swaps.

This contract accumulates fees generated from trading activity and distributes them to devOps and governance stakers according to configurable percentages set through governance.

Functions 2

func NewProtocolFeeStateBy

Action
1func NewProtocolFeeStateBy(protocolFeeStore protocol_fee.IProtocolFeeStore) *protocolFeeState
source

NewProtocolFeeState creates a new instance of protocolFeeState with initialized values

Imports 11

Source Files 11