Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angle protocol write adapters #262

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

0xtekgrinder
Copy link
Contributor

Description

Adds two write adaptors:

  • one for the saving module doc
  • one for the transmuter doc

Pre-merge author checklist

  • A brief description of the protocol and adapters is added to the PR
  • Files outside the protocol folder are not being edited and, if they are, it's clearly explained why in the PR
  • update me comments are removed
  • Contracts used are verified for that chain block explorer
  • Test cases with a block number have been added to the testCases.ts file for every relevant method that has been implemented
    • positions
    • prices
    • deposits
    • withdrawals
    • profits
    • tvl
    • apr
    • apy
  • getAddress from ethers
    • Is used to parse hardcoded addresses
    • Is used to parse addresses that come from contract calls when it is not clear they'll be in checksum format
    • It is NOT used to parse addresses from input methods
    • It is NOT used to parse addresses from metadata
  • For every adapter that extends SimplePoolAdapter
    • getPositions is not overwritten and, if it is, it's clearly explained why in the PR
    • unwrap is not overwritten and, if it is, it's clearly explained why in the PR
  • If the adapters requires to fetch static data on-chain (e.g. pool ids, token metadata, etc)
    • The adapter implements IMetadataBuilder
    • The buildMetadata method is implemented with the @CacheToFile decorator
    • All the static data is stored within the metadata JSON file

@jpsains
Copy link
Collaborator

jpsains commented Jul 3, 2024

👋

Hey hey @0xtekgrinder ,

Thanks for your contribution, great PR. ❤️❤️

Can I ask a favour, please can you add a few 'tx-params' test cases to cover deposit and withdrawals in your products?

Add the test cases here: packages/adapters-library/src/adapters/angle-protocol/tests/testCases.ts

Then rerun npm run build-snapshots -- -p angle-protocol to generate your new snapshots

There are a few examples in the project e.g. here: packages/adapters-library/src/adapters/aave-v3/tests/testCases.ts

Example

  {
    method: 'tx-params',
    key: 'supply',
    chainId: Chain.Ethereum,
    input: {
      productId: 'a-token',
      action: WriteActions.Deposit,
      inputs: {
        asset: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
        amount: '10000000000000000000',
        onBehalfOf: '0x5B541d54e79052B34188db9A43F7b00ea8E2C4B1',
        referralCode: 0,
      },
    },
  },

@jpsains jpsains added the question Further information is requested label Jul 3, 2024
0xtekgrinder and others added 3 commits July 5, 2024 13:18
* feat: write adapter for savings

* feat: angle transmuter write adapter

* feat: corsschain transmuter
@0xtekgrinder
Copy link
Contributor Author

Hey @jpsains I just added some test cases and updated the adaptor to remove assetDetails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants