Balmy
DCA
DCA
  • Introduction to the protocol
  • FAQ
  • Concepts
    • Positions
      • Actions
      • NFT/Permissions
      • Swap Intervals
    • Fees
    • Swaps
    • Token Integration
    • Yield Sources
  • Architecture
    • Core
      • Hub
      • Permission Manager
      • NFT Descriptor
    • Periphery
      • Companion
      • Libraries
  • Tech Guides
    • Interacting with the protocol
    • Smart Contract Registry
    • Swaps
      • Next Swap
      • Executing a Flash Swap
    • Position Management
      • Creating a Position
      • Modifying a Position
      • Withdrawing from a Position
      • Terminating a Position
    • Permission Management
    • Subgraphs
      • Playground
      • Fetch all pairs
      • Fetch all tokens
      • Fetch all active intervals
      • Fetch positions by address
    • Github
  • Mean explained by friends
    • By Perpetual Protocol
    • By Ceazor's Snack Sandwich
  • Other
    • Bug Reports
Powered by GitBook
On this page
  • InputBuilding
  • ModifyPositionWithRate
  • SecondsUntilNextSwap

Was this helpful?

  1. Architecture
  2. Periphery

Libraries

PreviousCompanionNextInteracting with the protocol

Last updated 2 years ago

Was this helpful?

We've built quite a few libraries on the Periphery that should make your life as a dev easier.

InputBuilding

Like we explain in the , the parameters needed to execute a swap are quite particular. In order to help with integrations, we've built this library that takes a more human-friendly parameters format, and converts them into the format that the Hub expects.

ModifyPositionWithRate

In v1, when you modified a position, you would specify a new rate and amount of swaps. In v2 we changed the approach, but we've built this library for users that still prefer the old one.

You can check the examples in the .

SecondsUntilNextSwap

Executing a DCA position is all about timing. If you'd like to understand how much longer you'll have to wait until the next swap is available, you can use this library that will calculate it for you.

swap section
position management section