@CetusProtocol · Post #143 · 10.05.2023 г., 11:05
$CETUS FARMING STARTED 🔥🔥🔥 Supported pools: ✅ CETUS-SUI ✅ CETUS-USDC #Suinami🐳🐳 https://twitter.com/CetusProtocol/status/1656253086724415493?s=20 @everyone
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @pythonotes · Post #397 · 12 ное.
Использование Pydantic сегодня стало нормой, и это правильно. Но иногда на ревью вижу, что используют его не всегда корректно. Например, метод BaseModel.model_dump() по умолчанию не преобразует стандартные типы, такие как datetime, UUID или Decimal, в простой сериализуемый для JSON вид. Тогда пишут кастмоный сериализатор для этих типов чтобы функция json.dump() не падала с ошибкой. import uuid from datetime import datetime from decimal import Decimal from uuid import UUID from pydantic import BaseModel class MyModel(BaseModel): id: UUID date: datetime value: Decimal obj = MyModel( id=uuid.uuid4(), date=datetime.now(), value='1.23' ) print(obj.model_dump()) # не подходит для json.dump # { # 'id': UUID('4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1'), # 'date': datetime.datetime(2025, 12, 12, 12, 12, 12, 111111), # 'value': Decimal('1.23') # } # добавляем свой кастомный сериализатор json.dumps(obj.model_dump(), cls=MySerializer) # { # 'id': '4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1', # 'date': '2025-12-12T12:12:12.111111', # 'value': '1.23' # } В данном случае класс MySerializer обрабатывает datetime, UUID и Decimal. Например так: class MySerializer(json.JSONEncoder): def default(self, o): if isinstance(o, Decimal): return str(o) elif isinstance(o, datetime): return o.isoformat() elif isinstance(o, UUID): return str(o) return super().default(o) Специально для тех, кто всё еще так делает - в этом нет необходимости! Pydantic может это сделать сам, просто нужно добавить параметр mode="json". json.dumps(obj.model_dump(mode="json")) # { # 'id': '4f8c1bc4-25fd-40cd-9dbe-2c73639b0dc1', # 'date': '2012-12-12T12:12:12.111111', # 'value': '1.23' # } #pydantic#libs
Пребарај: #suinami
@CetusProtocol · Post #143 · 10.05.2023 г., 11:05
$CETUS FARMING STARTED 🔥🔥🔥 Supported pools: ✅ CETUS-SUI ✅ CETUS-USDC #Suinami🐳🐳 https://twitter.com/CetusProtocol/status/1656253086724415493?s=20 @everyone
Hashtags
@CetusProtocol · Post #138 · 08.05.2023 г., 10:04
THE $CETUS IDO IS LIVE NOW! 🎉 THE $CETUS IDO IS LIVE NOW! 🔥 THE $CETUS IDO IS LIVE NOW! 🚀 Let the #Suinami waves beat stronger! 🌊🐳 👉: https://app.cetus.zone/launchpad https://twitter.com/CetusProtocol/status/1655513092904861697?s=20 @everyone
Hashtags
@CetusProtocol · Post #137 · 07.05.2023 г., 17:19
The $CETUS IDO will be LIVE in 17 hours ⏰! You can access the IDO page via the "Launchpad" section on our website https://app.cetus.zone/launchpad. Get ready for it guys. LFG! 🚀🚀🚀#Suinami See IDO details: https://medium.com/@CetusProtocol/the-cetus-ido-is-coming-f7dedf4031a3 https://twitter.com/CetusProtocol/status/1655257429905666048?s=20 @everyone
Hashtags
@HaedalProtocol · Post #35 · 29.11.2023 г., 20:18
Users can view all the available trading pools of haSUI-SUI on @CetusProtocol and @Turbos_finance via https://haedal.xyz/defi👀👀 Stake and earn High APR with incentives through Haedal at one click🖱#Suinami🌊 https://x.com/HaedalProtocol/status/1729418342325428356?s=20
Hashtags
@HaedalProtocol · Post #34 · 29.11.2023 г., 20:18
Exciting news!🤩@HaedalProtocol just officially completed the second smart contract audit conducted by @osec_io , one of the leading audit firms on @SuiNetwork. We will keep building and launch more unique features along the way🏄🏻♂️#Suinami https://x.com/haedalprotocol/status/1727647068737679860?s=46&t=wHLWioW005cyd63U3CAzOA
Hashtags
@HaedalProtocol · Post #28 · 29.11.2023 г., 20:17
Great news 🤩🤩 Users will be able to receive both fee earnings and farming rewards by providing liquidity to the haSUI - SUI pool on @CetusProtocol now!!🎁🎁#Suinami🌊 https://x.com/HaedalProtocol/status/1717515766717878445?s=20
Hashtags
@HaedalProtocol · Post #26 · 29.11.2023 г., 20:16
We are excited to announce that haSUI has been accepted as collateral on @bucket_protocol🔥🔥 Users will be able to mint $BUCK with haSUI and interact with various applications for additional yields from now!! #Suinami🌊 https://x.com/HaedalProtocol/status/1714194057361277128?s=20
Hashtags
@HaedalProtocol · Post #22 · 08.09.2023 г., 09:51
We are excited to announce that liquidity pool of haSUI - SUI is LIVE on @CetusProtocol🎉🎉 Stake SUI to haSUI and add liquidity on Cetus for extra rewards💸#Suinami🌊 Access via https://app.cetus.zone/liquidity/deposit?poolAddress=0x871d8a227114f375170f149f7e9d45be822dd003eba225e83c05ac80828596bc @everyone
Hashtags
@CetusProtocol · Post #181 · 03.08.2023 г., 06:12
The Cetus user base has officially exceeded 500,000🔥🔥🔥. What an extremely fast growth! Can't wait for the next milestone🎯. Join #Cetus and surf #Suinami together.🌊🌊🐳 https://twitter.com/CetusProtocol/status/1685902779049816064?s=20 @everyone
@CetusProtocol · Post #178 · 03.08.2023 г., 06:11
We're super excited to launch the Order Split function on Cetus🔥🎉. Now the #Cetus swap can dynamically split orders between multiple pools & routes to minimize slippage & deliver best prices for a wide range of pairs, especially for giant orders⚖️. Surf #Suinami with Cetus.🌊 https://twitter.com/CetusProtocol/status/1683848388390047746?s=20 @everyone
@CetusProtocol · Post #169 · 28.06.2023 г., 18:42
New milestone reached🚩: $300M+ Cumulative Trading Volume on #Cetus has boosted in another short period of time💦 Keep the pace🌊#Suinami https://twitter.com/CetusProtocol/status/1673683506113941506?s=20 @everyone
@CetusProtocol · Post #134 · 04.05.2023 г., 11:50
Mission Accomplished ✅ $10,000,000+ TVL in 24h 🔥 What's next? 😉 #Cetus#Suinami🐳 @everyone https://twitter.com/CetusProtocol/status/1654090418638983170