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

[MEX-466] position creator swap information #1320

Merged

Conversation

claudiulataretu
Copy link
Collaborator

Reasoning

  • position creator transactions perform swaps on the input tokens to create the final position; no information about swaps were exposed to frontend

Proposed Changes

  • added models for each position creator with single token actions to expose swap information
  • updated position creator query to work for non-authenticated requests
  • made the transaction generation of position creator to work only for authenticated requests

How to test

query CreateDualFarmPositionSingleToken {
	createDualFarmPositionSingleToken(
		dualFarmAddress: <dual_farm_address>,
		payment: {
			tokenID: <token_id>,
			nonce: 0,
			amount: <amount>
		},
		tolerance: <tolerance>
	) {
			swaps {
				swapType
				tokenInID
				tokenOutID
				tokenInExchangeRate
				tokenOutExchangeRateDenom
				tokenInPriceUSD
				tokenOutPriceUSD
				amountIn
				amountOut
				intermediaryAmounts
				tokenRoute
				fees
				pricesImpact
				tolerance
		}
		transactions (
			dualFarmAddress: <dual_farm_address>,
		) {
				receiver
				data
		}
	}
}
  • query should return swap information if request is not authenticated and return null for transaction
  • query should return transaction if the request is authenticated

… AutoRouteModel

Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
- add new models for each single token transaction model
- add resolvers for each single token transaction model
- remove authentification from the position creator queries

Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
- added 2 new models for staking and energy single token position creator
- added resolvers for staking and energy single token position creator models

Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
@cfaur09
Copy link

cfaur09 commented Apr 10, 2024

createDualFarmPositionSingleToken 🟢
createPositionSingleToken 🟢
createStakingPositionSingleToken 🟢
createDualFarmPositionDualTokens 🟢
createFarmPositionDualTokens 🟢
createStakingPositionSingleToken 🟢

- removed the ternary operator for multiple lines
- added new method to serialize the swap route arguments
- refactored getMinimumAmountsForLiquidity method

Signed-off-by: Claudiu Lataretu <claudiu.lataretu@gmail.com>
@claudiulataretu claudiulataretu merged commit c0fc58f into feat/xexchange-v3 Apr 11, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants