Asymetrix Protocol
  • 🏁What is Asymetrix Protocol?
    • Overview
    • Inspiration
    • Why stETH?
    • What to expect?
    • Team
  • 🔥ASYMETRIX V2
    • What's new in Version 2?
    • Understanding esASX
    • MINI POOLS (coming soon)
    • BOOSTS
      • ODDS BOOST
      • esASX BOOST
    • DASHBOARD (BOOSTS Practice guide)
    • CLAIM esASX. Step-by-step guide
    • Converting esASX into ASX with penalty
    • BOUNTY - Discounted esASX
  • 💼ASYMETRIX PROTOCOL GUIDE
    • How it works
    • User's odds
    • FAQ
    • Glossary
  • 🙋‍♂️GOVERNANCE / TOKEN
    • Governance model
    • ASX token distribution
    • How does the ASX token capture value of protocol growth?
    • Asymetrix flywheel
  • 🛡️SECURITY
    • Audits
    • Bug bounties
    • Possible risks
  • 🌐RESOURCES
    • Deployed contacts
    • Developers docs
      • PrizeDistributionFactory
      • PrizeFlush
      • TwabRewards
      • BeaconTimelockTrigger
      • DrawCalculatorTimelock
      • TWABDelegator
      • Delegation
      • Ticket
      • Reserve
      • PrizeDistributor
      • PrizeDistributionBuffer
      • DrawCalculator
      • DrawBuffer
      • DrawBeacon
      • StakePrizePool
      • ASX
      • EIP2612PermitAndDeposit
      • RNGServiceChainlinkV2
      • Vesting
    • Links
    • Media kit
Powered by GitBook
On this page
  • Write methods description
  • initialize()
  • Read methods description
  • calculateNumberOfUserPicks()
  • drawBuffer()
  • getDrawBuffer()
  • getNormalizedBalancesForDrawIds()
  • getPrizeDistributionBuffer()
  • prizeDistributionBuffer()
  • ticket()
  1. RESOURCES
  2. Developers docs

DrawCalculator

The DrawCalculator calculates the amount of user picks based on the user average weighted balance (during each draw period).

Write methods description

initialize()

Allows to initialize the contract during the deployment.

Parameters:

Name
Type
Description

_ticket

address

Address of the ticket.

_drawBuffer

address

Address of the DrawBuffer.

_prizeDistributionBuffer

address

Address of the PrizeDistributionBuffer.

Read methods description

calculateNumberOfUserPicks()

Calculates the picks amount for a user for multiple draws. Typically called by a PrizeDistributor.

Parameters:

Name
Type
Description

_user

address

User for which to calculate picks amount.

_drawIds

uint32[]

drawId array for which to calculate picks amount for.

Return:

Name
Type
Description

_picks

uint256[]

List of number of user picks ordered by drawId.

drawBuffer()

Address of the DrawBuffer connected to the DrawCalculator.

getDrawBuffer()

Address of the DrawBuffer connected to the DrawCalculator.

getNormalizedBalancesForDrawIds()

Returns a user's balances expressed as a fraction of the total supply over time.

Parameters:

Name
Type
Description

_user

address

The user's address.

_drawIds

uint32[]

The _drawIds to consider.

Return:

Name
Type
Description

_balances

uint256[]

Array of balances.

getPrizeDistributionBuffer()

Read global prizeDistributionBuffer variable.

prizeDistributionBuffer()

Read global prizeDistributionBuffer variable.

ticket()

Address of the Ticket associated with DrawCalculator.

PreviousPrizeDistributionBufferNextDrawBuffer

Last updated 2 years ago

🌐