perp-curie-contract icon indicating copy to clipboard operation
perp-curie-contract copied to clipboard

Feature: Add getters in exchange

Open jinyang1994 opened this issue 2 years ago • 1 comments

Background

Sometimes you need to use FirstTradedTimestamp, LastSettledTimestamp, and LastFundingGrowthGlobal for statistics. Although I can find them through contract events, I think it would be very convenient if you can use some getters, so I added the following functions:

  • Exchange.getFirstTradedTimestamp
  • Exchange.getLastSettledTimestamp
  • Exchange.getLastFundingGrowthGlobal

PR Reminders

Be ware of the followings

  • [ ] implement deployment script for your changes in deployment repo
  • [ ] add verification in hardhat simulation(000-prepare-simulation-check, 902-newMarket-check or 903-simulation-check) and system test(901-system-test) in deployment repo
  • [x] update change log

  1. Contract: make sure the code follows our convention, ex: naming, explicit returns, etc.; if uncertain, discuss with others

  2. Test: make sure tests can cover most normal and edge cases; if not, open follow-up tickets. Also, look out for failed tests and fix them!

  3. CHANGELOG.md: update when external interfaces are changed

  4. Workflow:

    • Github: assign the pr to yourself; if pairing, can merge directly; else, assign someone to help review
    • Asana: assign the corresponding ticket to yourself and leave the pr link on it for easier follow-ups
    • Discord: if someone is mentioned in this pr, tag on Discord

jinyang1994 avatar Feb 16 '23 13:02 jinyang1994