How to integrate with Gauntlet USD Alpha

gtUSDaarrow-up-right is the ERC20 for our flagship stablecoin vault on Base, Arbitrum, Optimism, and Ethereum Mainnet, which can be integrated into other DeFi applications. Here is a basic integration guide to incorporate gtUSDa into your protocol or app.

circle-info

gtUSDa is a transferable ERC20 on Base, Arbitrum, Optimism, and Ethereum Mainnet.

We also have a dedicated frontend for supplying into this vault at app.gauntlet.xyz/vaults/gtusdaarrow-up-right.

Contract Addresses

gtUSDa vault addresses

  • 0x000000000001CdB57E58Fa75Fe420a0f4D6640D5 (gtUSDa contract on Base)

  • 0x3bd9248048df95Db4fBD748C6CD99C1bAa40bAD0 (gtUSDa contract on Ethereum)

  • 0x000000001DC8bd45d7E7829fb1c969cbe4D0D1eC (gtUSDa contract on Arbitrum)

  • 0x000000001DC8bd45d7E7829fb1c969cbe4D0D1eC (gtUSDa contract on Optimism)

Token addresses

  • 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 (USDC contract on Base)

  • 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 (USDC contract on Ethereum Mainnet)

  • 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 (USDC contract on Arbitrum)

  • 0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85 (USDC contract on Optimism)

Provisioner addresses

  • 0x18CF8d963E1a727F9bbF3AEffa0Bd04FB4dBdA07 (provisioner contract on Base)

  • 0x74C4A66CE4F4779B11E7c63D42e51EEef3A80D11 (provisioner contract on Ethereum)

  • 0xDd4a42603E6d8E515C3468789375A98c376821b3 (provisioner contract on Arbitrum)

  • 0xCC923371F0d3A9cA75d98E767Df9dE1cdf5799Ef (provisioner contract on Optimism)

circle-info

Note: All examples below are executed on Base.

Supplying via Contract Calls

Supplying into gtUSDa is a combination of 2 function calls: an approve call to spend the USDC, and a requestDeposit call.

  1. call approvearrow-up-right on the USDC contract to allow the USDC amount to be spent by the provisioner contractarrow-up-right

    1. Note that this is not the vault contract itself, as the request runs through the provisioner to issue vault units asynchronously via a solving mechanism (see https://docs.aera.finance/entry-exit-with-provisioner for more details)

  2. requestDepositarrow-up-right . requestDeposit is an asynchronous operation, the user will submit the USDC to the provisioner and after the request is solved gtUSDa units will be sent back to the users wallet directly. This will generally happen within 6 hours though can take up to as long as 3 days (or otherwise based on deadline). See https://docs.aera.finance/entry-exit-with-provisioner for more details

    1. token: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 (USDC contract on Base)

    2. tokensIn: USDC amount in (decimal adjusted value)

    3. minUnitsOut: This parameter needs to be based on the current price of gtUSDa. To calculate it refer to the PriceAndFeeCalculatorarrow-up-right contract, specifically the convertTokenToUnitsarrow-up-right function call.

      1. convertTokenToUnits(0x000000000001CdB57E58Fa75Fe420a0f4D6640D5, 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, tokensIn) -> Returns the decimal adjusted gtUSDa units.

      2. Multiply the above value by 0.97 (some buffer in case there are price changes)

    4. solverTip: 0

    5. deadline: block.timestamp + 259200 (3 days in seconds)

    6. maxPriceAge: 3600 (1 hour in seconds)

    7. isFixedPrice: False

circle-info

minUnitsOut is technically not required for automatically priced orders if the vault price is trusted but is highly recommended for safety. Please do not include a solverTip as the solver will not solve these requests. Please do not include a large deadline as unfillable orders cannot be refunded ahead of the deadline.

Example Request to deposit 1000 USDC

Call approvearrow-up-right on the Base USDC contract to allow the provisioner to spend

call requestDepositarrow-up-right on the provisioner, parameterizing this call is important

Withdrawing via contract calls

To withdraw you similarly need to do an approve call followed by requestRedeem on the Provisioner Contractarrow-up-right with the correct parameters.

  1. call approvearrow-up-right on the gtUSDa contract to allow the gtUSDa amount to be spent by the provisioner contractarrow-up-right

  2. requestRedeemarrow-up-right This is similarly an asynchronous call where the user provides vaultUnits back to the Provisioner contract and after the request is solved the user will receive USDC in their wallet

    1. token: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 (USDC contract on base)

    2. unitsIn: The amount of vault units you wish to redeem, correctly decimal adjusted. If you want to calculate the unitsIn based on the USDC value for the user you can again use the convertTokenToUnitsarrow-up-right function on the PriceAndFeeCalculatorarrow-up-right contract as per the deposit call.

    3. minTokensOut: This parameter needs to be based on the current price of gtUSDa. To calculate it refer to the PriceAndFeeCalculatorarrow-up-right contract, specifically the convertUnitsToTokenarrow-up-right function.

      1. convertUnitsToToken(0x000000000001CdB57E58Fa75Fe420a0f4D6640D5, 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913, unitsIn) -> Returns the Decimal adjusted USDC value of the VaultUnits

      2. Multiply the above value by 0.97 (some buffer in case there are price changes)

    4. solverTip: 0

    5. deadline: block.timestamp + 259200 (3 days in seconds)

    6. maxPriceAge: 3600 (1 hour in seconds)

    7. isFixedPrice: False

circle-info

minTokensOut is technically not required for automatically priced orders if the vault price is trusted but is highly recommended for safety. Please do not include a solverTip as the solver will not solve these requests. Please do not include a large deadline as unfillable orders cannot be refunded ahead of the deadline.

Example Request to withdraw 1000 USDC

call approvearrow-up-right on the gtUSDa contract to allow the provisioner to spend

call requestRedeemarrow-up-right on the provisioner, parameterizing this call is important

[ADVANCED] Monitoring and refunding orders

Tracking orders

When an asynchronous order is placed, the user will have an active but unfilled order. To provide additional transparency to users, these orders can be monitored by tracking the following DepositRequested or RedeemRequested events:

Checking when orders are filled

When a deposit or redeem is filled, one of the following events will be emitted in the Provisioner:

Refunding expired orders

If the deadline passes but an order isn't solved (rare), the user has to claim back their USDC or gtUSDa tokens using the refundRequest function.

Getting the User's balance of gtUSDa

Simply call the balanceOfarrow-up-right function on gtUSDaarrow-up-right with the user's address.

Pricing gtUSDa units in USDC (and vice versa)

We provide simple price conversion utilities between gtUSDa and USDC via the PriceAndFeeCalculatorarrow-up-right contract.

Specifically there are two functions of relevance

  • convertTokensToUnitsarrow-up-right -> Takes in USDC value and returns amount of vaultUnits at current price

    • vault: 0x000000000001CdB57E58Fa75Fe420a0f4D6640D5 (gtUSDa vault contract)

    • token: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 (USDC contract on base)

    • tokenAmount: Decimal adjusted USDC value (USDC has 6 decimalsarrow-up-right)

  • convertUnitsToTokensarrow-up-right -> Takes in vaultUnits and returns USDC value at current price

    • vault: 0x000000000001CdB57E58Fa75Fe420a0f4D6640D5 (gtUSDa vault contract)

    • token: 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913 (USDC contract on base)

    • unitsAmount: Decimal adjusted gtUSDa value (gtUSDa has 18 decimalsarrow-up-right)

Fetching the APY of the vault

This one is a little trickier as of right now, but we aim to make this simpler in the future via an API. As of right now the best way to get the APY of the vault is to index the price of the vault units in USDC over a given time period and extrapolate this to a yearly APY number.

Calculating the TVL of the vault

To get the total TVL of the vault use the convertUnitsToTokensarrow-up-right function and use the totalSupplyarrow-up-right of gtUSDa as an input.

Last updated

Was this helpful?